Hacker News new | ask | show | jobs
by mercurial 3579 days ago
From a practical standpoint, what's the difference between js_of_ocaml?
3 comments

much more readable transpiled output, really nice (and getting nicer) FFI to javascript. but it doesn't interface with existing ocaml stuff as well (doesn't use `.cmo/.cma` so it needs to compile everything from source afaict)
People gave you the part in favor of bucklescript, so I'll give you the other side of the story:

bucklescript doesn't respect the OCaml memory model and runtime semantics, which makes it incompatible with some part of the ecosystem.

Js_of_ocaml already has various features that bucklescript doesn't have: dynlink, support for concurrency libraries such as lwt and async, etc. It's also much more stable and battle-tested.

to be precise, Js_of_ocaml does not respect OCaml memory model either, think about float. But I think Js_of_ocaml is really great, BuckleScript and Js_of_ocaml have different use cases.
it is generate more readable JS. and we have spent lots of time in polishing the FFI to make OCaml/JS interaction easier