adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.08 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.08/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
Haudegen has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 246 seconds]
bartholin has joined #ocaml
AtumT has quit [Quit: AtumT]
mfp has quit [Ping timeout: 248 seconds]
ygrek has joined #ocaml
Haudegen has joined #ocaml
keep_learning_M has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
addem has joined #ocaml
addem has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 246 seconds]
addem has joined #ocaml
addem has quit [Quit: Leaving]
addem has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
addem has quit [Ping timeout: 245 seconds]
hio has joined #ocaml
gravicappa has joined #ocaml
ggole has joined #ocaml
gareppa has joined #ocaml
narimiran has joined #ocaml
Jeanne-Kamikaze has quit [Quit: Leaving]
jao has quit [Ping timeout: 272 seconds]
keep_learning_M has quit [Quit: This computer has gone to sleep]
gareppa has quit [Quit: Leaving]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
ehirdoy has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
ziyourenxiang has joined #ocaml
ruffy_ has quit [Quit: WeeChat 2.3]
Haudegen has joined #ocaml
toolslive has joined #ocaml
toolslive has quit [Client Quit]
toolslive has joined #ocaml
toolslive has quit [Client Quit]
<xvilka> arghh
<xvilka> Raised at file "format.ml" (inlined), line 242, characters 35-52 drives me mad
<xvilka> exceptions are cancer
<flux[m]> export OCAMLRUNPARAM=b ;)
<flux[m]> exceptions are nice. I would not enjoy having val int_of_string : string -> int Result.t.
<xvilka> flux[m]: it doesn't work on native builds
<octarin> yeah, faster than option return functions
<flux[m]> it doesn't? I thought it does.
<xvilka> flux[m]: nope, it doesn't
<flux[m]> well, ue bytecode then :)
<flux[m]> I just tested, they work fine as long as you use -g when compilng with ocamlopt
<xvilka> flux[m]: it happens in production, and with this useless exception messages I am having A LOT of trouble to reproduce, then find the place where it happens
<xvilka> will use Rust in the future projects
<xvilka> too much issues with OCaml
<flux[m]> ocamlopt -g -o foo foo.ml; OCAMLRUNPARAM=b ./foo -> you get backtrace
<flux[m]> many moons ago it used to be the case that backtraces didn't work with native code, though. must've been 3.0 or before maybe.
<xvilka> flux[m]: just tried again, nope, still that useless line
<xvilka> Fighting this since
<flux[m]> "does not exist or is private"
<flux[m]> nevertheles, I get this output: fooFatal error: exception Assert_failure("foo.ml", 3, 2) Raised at file "foo.ml", line 3, characters 2-14 Called from file "foo.ml" (inlined), line 6, characters 14-20 Called from file "foo.ml", line 8, characters 8-15
<xvilka> and some dependencies still not 4.08 ready
<xvilka> so it is a gridlock
<xvilka> Even mulling over the thought to rewrite existing project in Rust as well
<flux[m]> ah, so something eats the backtrace?
<xvilka> it has _almost_ everything
<xvilka> yes
<flux[m]> but in particular it has nothing to do with native code building?
<flux[m]> not sure what Leonidas means
<flux[m]> it certainly affects -g -compiled regular binaries
<flux[m]> and even if Format reraises the exception, why would it not show your source code where all the control flow originates from?
<xvilka> flux[m]: yeah, seems just a bug, not that it doesn't produce the backtrace
<xvilka> flux[m]: I have no idea tbh
<xvilka> f* word became my most favorite lately. I guess this is how F# name was born.
<flux[m]> xvilka: does that code use some other library in addition to Lwt?
<flux[m]> (I can't compile the fragment)
<xvilka> flux[m]: yes, Core
<Leonidas> flux[m]: yeah, I think this was incorrect.
<flux[m]> so interestingly if I remove your exception capture code, it works fine :)
<flux[m]> xvilka: if I reorder the code so that Printexc.get_backtrace () is first, it works as it should
<flux[m]> so it seems the backtrace is eaten by Exn.to_string
<flux[m]> these kind of thread-local values are quite dangerous :/
<flux[m]> so it seems perhaps that somewhere within Exn.to_string's implementation it's expected that an exception is issued
<flux[m]> so best to have as little code from catching the exception and inspecting it :)
jaar has joined #ocaml
jnavila has joined #ocaml
<flux[m]> it is quite sad there is no, say, Printeexc.get_backtrace ~exn () available, as that would certainly solve the issue. I'm guessing there are performance implications.
mfp has joined #ocaml
<flux[m]> I added a message to the discuss thread mentioning this solution. I hope it is indeed the solution ;).
<theblatte> xvilka: see https://github.com/ocaml/ocaml/pull/1731, 4.08 should be better
<theblatte> or you can hunt down all the places where you reraise exceptions and make sure to preserve the backtrace, eg https://github.com/facebook/infer/blob/master/infer/src/istd/IExn.ml
<flux[m]> it seems 4.08 is not yet an option for XVilka due to dependencies lagging, but it's certainly nice that it's been fixed
<theblatte> flux[m]: yes, the issue is usually `try ... with exn -> some_logging_that_uses_Format (); raise exn`
<theblatte> worth wrapping these in something that preserves the backtrace
<theblatte> we did that in infer and now the backtraces are all beautifully useful :)
<flux[m]> capture_backtrace (fun ().. ) (fun backtrace -> ..) :-)
<xvilka> theblatte: yes, I know about 4.08, I use it for some parts of the project, but as a whole is not yet ready due to the numerous amount of dependencies
<xvilka> flux[m]: let me try
<xvilka> flux[m]: wow, you are my savior!
<xvilka> it works \o/
<xvilka> marked your answer as a solution
andrewalker has joined #ocaml
dimitarvp has joined #ocaml
keep_learning_M has joined #ocaml
dimitarvp has quit [Client Quit]
<flux[m]> :)
<xvilka> I wish to know that months before
khodzha has quit [Ping timeout: 245 seconds]
jnavila has quit [Ping timeout: 246 seconds]
khodzha1 has joined #ocaml
jnavila has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
khodzha1 has quit [Read error: Connection reset by peer]
jnavila has quit [Ping timeout: 250 seconds]
keep_learning_M has quit [Quit: This computer has gone to sleep]
khodzha has joined #ocaml
ayberkt has joined #ocaml
Haudegen has quit [Remote host closed the connection]
keep_learning_M has joined #ocaml
keep_learning_M has quit [Client Quit]
<oni-on-ion> ocaml is superb
jao has joined #ocaml
<def`> :)
jnavila has joined #ocaml
Haudegen has joined #ocaml
keep_learning_M has joined #ocaml
spew has joined #ocaml
jnavila has quit [Ping timeout: 245 seconds]
wonderer109 has joined #ocaml
narimiran has quit [Ping timeout: 248 seconds]
wonderer109 has quit [Remote host closed the connection]
AtumT has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
al-damiri has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
jnavila has joined #ocaml
ziyourenxiang has quit [Ping timeout: 258 seconds]
Haudegen has quit [Remote host closed the connection]
iovec has joined #ocaml
interruptinuse has quit [Quit: ZNC - https://znc.in -- bye bye!]
interruptinuse has joined #ocaml
Haudegen has joined #ocaml
ggole has quit [Quit: Leaving]
jaar has quit [Quit: Leaving]
klntsky has quit [Ping timeout: 260 seconds]
klntsky has joined #ocaml
keep_learning_M has quit [Quit: This computer has gone to sleep]
ygrek has joined #ocaml
kotrcka has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
gravicappa has quit [Ping timeout: 245 seconds]
narimiran has joined #ocaml
erwanou_ has quit [Ping timeout: 245 seconds]
erwanou has joined #ocaml
jnavila has quit [Remote host closed the connection]
iovec has quit [Quit: Connection closed for inactivity]
quarters has quit [Changing host]
quarters has joined #ocaml
quarters has joined #ocaml
narimiran_ has joined #ocaml
narimiran has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Jeanne-Kamikaze has quit [Quit: Leaving]
narimiran_ is now known as narimiran
khodzha has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 258 seconds]
narimiran has quit [Ping timeout: 245 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
spew has quit [Quit: Connection closed for inactivity]
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #ocaml