I am deciding whether to go all in with
js_of_ocaml (supplemented with
bonsai or similar from OCaml community) or Rescript.
There are lot of data points for Rescript/ReasonML – its been used to build a lot of websites and the code that is transpiled is indeed quite clean and readable. There are other upsides and downsides to Rescript which I will not repeat here.
js_of_ocaml are probably much fewer and I’ve not been able to pickup many HOWTOs and experience reports. So I was hoping for a perspective from the
js_of_ocaml side from anyone who works regularly with it. Specific experience reports using
brr would also be appreciated.
The main issue that I perceive with jsoo is bloat. I jsoo compiled a
ocaml-vdom counters (react style) example and that comes to ~100K js minified. A lot of that minified js is probably “pay once” – code for the transpiled ocaml runtime bits for the browser and subsequent code is not going to add more.
So with such a significant tax, I want to know in which scenarios would
js_of_ocaml be really worth it.
My understanding is if you already have a good amount of OCaml code that you could run in the browser it makes sense to use
js_of_ocaml OTOH If you are starting from a clean slate, you’re probably better off just using Rescript. Agree? Disagree?
Any comments or experience reports on
js_of_ocaml and the merits of using jsoo would be useful.