I’m pleased to announce the release of js_of_ocaml 5.9.0. It should soon be available in opam.
Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes it
possible to run pure OCaml programs in JavaScript environment like browsers and
Node.js.
Most significant changes:
Support for OCaml 5.3
Speedup sourcemap generation and improve sourcemap accuracy.
Prepare the merge of the wasm_of_ocaml fork back into the js_of_ocaml repo.
JS backtraces are really expansive. They now need to be explicitly requested with OCAMLRUNPARAM=b=1. This speeds up programs linked with libraries enabling backtraces programmatically using Printexc.record_backtrace true.
This speeds up programs linked with libraries enabling backtraces programmatically using Printexc.record_backtrace true.
Are there really libraries calling record_backtrace? Do we know which? I use it in my executables, but any library doing so is taking too many liberties, much like libraries that print to stdout/stderr unconditionally.
I’m pretty sure I did this in some of my testing libraries (none of which is publicly released though) in order to report location of failing tests. So perhaps that’s the kind of libraries were this can be found.
It’s the kind of “fixing” that ends up confusing everyone at some point. Here goes future discussions: “but I did explicitly require backtraces with Printexc.record_backtraces”, “ah but in js_of_ocaml…”.
I still prefer to call Printexc.record_backtraces in my js_of_ocaml programs to enable backtraces rather than have to set some fake js_of_ocaml notion of process environment.
Why rather not ask base to have a more sensitive default when Sys.backend_type = Other "js_of_ocaml" ?