<adrien>
mclovin: yes, there's some cost to it but my benchmarks it wasn't costly ... but now that I'm revisiting everything, it's time to fix it, thanks for pointing it out
xd1le has joined #ocaml
<adrien>
Analysis.compute_overlaps is the one that I extracted from Analysis.analyze
bartholin has joined #ocaml
companion_cube has quit [Ping timeout: 255 seconds]
alexherbo2 has quit [Remote host closed the connection]
waleee has joined #ocaml
John_Ivan has quit [Read error: Connection reset by peer]
waleee has quit [Quit: WeeChat 3.8]
alexherbo2 has joined #ocaml
<discocaml>
<Alistair> GADT puzzle: Runtime types are often encoded as `'t ty` for some GADT `ty`. Is it possible to add weak/unification variables to this GADT and write a function `unify : 'a ty -> 'b ty -> ('a, 'b) eq option`?
John_Ivan has joined #ocaml
bartholin has quit [Quit: Leaving]
John_Ivan_ has joined #ocaml
John_Ivan has quit [Ping timeout: 252 seconds]
John_Ivan__ has joined #ocaml
John_Ivan_ has quit [Ping timeout: 276 seconds]
John_Ivan_ has joined #ocaml
John_Ivan__ has quit [Ping timeout: 240 seconds]
oriba has joined #ocaml
xd1le has quit [Quit: xd1le]
waleee has joined #ocaml
John_Ivan__ has joined #ocaml
John_Ivan_ has quit [Ping timeout: 260 seconds]
John_Ivan_ has joined #ocaml
John_Ivan__ has quit [Ping timeout: 255 seconds]
Stumpfenstiel has joined #ocaml
John_Ivan__ has joined #ocaml
John_Ivan_ has quit [Ping timeout: 255 seconds]
neiluj has joined #ocaml
<neiluj>
hi!
<neiluj>
thinking about a tool: when running a program it would print a trace of all function calls (and location in the project) with the values of the arguments and the outputs
<neiluj>
that would be handy when modifying foreign code bases
<neiluj>
what do you think?
<companion_cube>
sounds kind of slow, no? :)
<companion_cube>
if you want to do that, I'd suggest a ppx that automatically instruments functions to emit spans in some tracing format
<companion_cube>
well, printing all that would be super slow
<neiluj>
ah right, you'd have to select some level of granularity i guess
<neiluj>
because currently i'm kind of guessing where to modify stuff in a big code base, it's hard to understand what's going on, which code paths are executed or not...
<neiluj>
thanks for the links :)
<octachron>
The bytecode debugger is probably faster than logging all function calls.
<neiluj>
it still works well with the asynchronous library lwt?
<companion_cube>
octachron: do you actually use it?
Tuplanolla has joined #ocaml
<neiluj>
i know someone debugging ocaml programs with gdb and rr :)
<neiluj>
it's hard to navigate
<neiluj>
we ended up relying on printfs...
<companion_cube>
I use print + tracy, tbh
<neiluj>
how hard is it to use tracy? do you have to instrument your caml code?
<companion_cube>
yeah
<companion_cube>
(actually, in general I have my own instrumentation, which spits out a chrome://tracing compatible file, which I can then feed to tracy, pfiu)
<companion_cube>
(dune can also produce this kind of file, for example)
<neiluj>
i'll spend time to learn this one, seems worth it
<companion_cube>
magic-trace is cool but it's a heavy hammer :)
<companion_cube>
it produces an incredible amount of data afaict
<neiluj>
the holy grail to me, in addition to these tools would be a tool similar to gdb but totally visual: you move from function to function in the *caml* code and can go forward and backward, in an animated way
<neiluj>
right
<companion_cube>
that'd be lovely… but also a bit SF for now
<neiluj>
:)
<neiluj>
the ppx approach could work no? although bringing too much overhead
<neiluj>
the graphical part is doable i think
<companion_cube>
doing your own graphical interface?
<neiluj>
yep, given the function location, display the code at the location to have a bit of context, highlight function, display value for each argument in little boxes... and then buttons to move to the next function call or the previous one
<octachron>
companion_cube, from time to time, yes?
<companion_cube>
hmm… in emacs, I guess?
<companion_cube>
or really via the CLI?
<octachron>
via the CLI, but my use case is generally to have quick look at the callstack before adding logging.
<companion_cube>
oh, I see.
<companion_cube>
(I guess I just use gdb for that, even though I don't see locals)
<neiluj>
gdb --args "dune exec .../main.exe" followed by r in gdb's prompt says "no executable file specified", rings a bell?
<neiluj>
or --args "_build/path/to/main.exe"
<companion_cube>
maybe `dune build` and then gdb the binary
<neiluj>
ah right
<neiluj>
for some reason if main.exe takes extra arguments gdb doesn't parse them
<neiluj>
ah without quotes the binary arguments are parsed!
alexherbo2 has quit [Remote host closed the connection]
Stumpfenstiel has quit [Quit: No Ping reply in 180 seconds.]
olle has joined #ocaml
Stumpfenstiel has joined #ocaml
<discocaml>
<masterbuilder> what happens if integer literals do not fit in an `int`? are the excess bits just ignored?
<companion_cube>
compilation error afaik
<discocaml>
<NULL> From where? In the code, you get a compiler error
<discocaml>
<octachron> `Error: Integer literal exceeds the range of representable integers of type int`
<discocaml>
<masterbuilder> oh, okay, cool
Serpent7776 has quit [Ping timeout: 240 seconds]
czy has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
czy has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
Tuplanolla has quit [Quit: Leaving.]
azimut has quit [Ping timeout: 255 seconds]
Stumpfenstiel has quit [Ping timeout: 276 seconds]
azimut has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 255 seconds]
azimut has quit [Ping timeout: 255 seconds]
John_Ivan__ has quit [Read error: Connection reset by peer]