alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
<discocaml>
<sarna> hey, how do you deal with the fact that functions need to be declared before they're used? do you just write stuff bottom-up? I like having private/less used functions at the end of the file in other languages
<discocaml>
<sarna> I've been thinking about joining all function definitions with `and` but it seems cursed
dnh has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<discocaml>
<octachron> I tend to use submodules to group together utility functions.
<discocaml>
<sarna> that looks good, I'll try it out - thanks!
spip has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
xd1le has quit [Quit: xd1le]
<discocaml>
<sarna> ah, a submodule still needs to be declared at the top of the file, that's inconvenient :(
<discocaml>
<dmitrig> I think people tend to read the mli and jump to definitions from there, rather than reading an entire module from top to bottom. Declarations in mli files can be in whatever order makes sense and usually don't include private stuff
<discocaml>
<deepspacejohn> I think that most OCaml users consider that a feature, not a bug. Declaring values before you use them makes understanding code a lot easier, since you don't have to search everywhere to figure out where a value is coming from.
<discocaml>
<deepspacejohn> Scrolling up to find a helper function is just as easy as scrolling down, so it never bothered me.
szkl has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
motherfsck has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
<discocaml>
<sarna> gotcha
<discocaml>
<sarna> > In fact, by default, OCaml has backtraces turned off, and even if you have them turned on at runtime, you can’t get backtraces unless you have compiled with debugging symbols. Base reverses the default, so if you’re linking in Base, you will have backtraces enabled by default.
<discocaml>
<sarna> how does Base do this? can I achieve this without depending on Base?
<companion_cube>
OCAMLRUNPARAM=b in your env
<companion_cube>
or `Printexc.record_backtrace true`
<discocaml>
<sarna> sure, how do I make that permanent? so when I build the binary and send it over the wire it persists
<discocaml>
<sarna> oh neat, this `Printexc` line does the trick :))
<discocaml>
<sarna> sorry to be annoying, but how does that work even with `--release`? I ran `dune build --verbose` and I don't see `ocamlopt -g` anywhere. are debugging symbols now included by default? I can't find anything on it on the web :(
noddy has joined #ocaml
<companion_cube>
hmmmm I think -g is always included with dune?
<discocaml>
<sarna> that'd be awesome, but I can't find any confirmation in dune docs - no hits for debug, debugging, backtrace..
<companion_cube>
I mean just compile in release and check if you can still get backtraces :)
<discocaml>
<sarna> I do!
<discocaml>
<sarna> then I will, uh, accept the mystery
<zozozo>
@sarna : the `-g` option is passed to ocamlopt, it's juste not the first option, in practice, you'll a lot of `ocamlopt -w <...> -strict-sequence -strict-formats -short-paths -keep-locs -g ...` in the logs of dune, so the `-g` option is there, just in the middle of other options
Absalom has joined #ocaml
<discocaml>
<sarna> right, that's it! also, `dune printenv --release` shows that `-g` is passed. y'all are the best :)
motherfsck has quit [Ping timeout: 240 seconds]
John_Ivan has joined #ocaml
deadmarshal_ has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
deadmarshal_ has joined #ocaml
amk has quit [Ping timeout: 240 seconds]
amk has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
<companion_cube>
does POWER still exist? where is it in use?
Haudegen has quit [Quit: Bin weg.]
<octachron>
IBM still sells expensive POWER9 servers
<companion_cube>
I didn't realize IBM did freaking CPUs
Tuplanolla has joined #ocaml
<haesbaert>
companion_cube: they double as a home heater
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
bgs has joined #ocaml
bgs has quit [Remote host closed the connection]
bartholin has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Anarchos has joined #ocaml
dnh has quit [Ping timeout: 248 seconds]
Anarchos has quit [Client Quit]
Anarchos has joined #ocaml
neiluj has quit [Quit: WeeChat 3.7.1]
oriba has joined #ocaml
sllk has joined #ocaml
motherfsck has joined #ocaml
Anarchos has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
John_Ivan has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]