by implicit · 11y ago · 0 comments
OCaml syntax is super idiosyncratic and doesn't resemble anything, but, once you retrain your eyes, the underlying semantics are terrific.
js_of_ocaml imposes very minimal code overhead (6k-ish). Sourcemaps work great, and OCaml values are mapped into JS in a very straightforward way. You can read them in a JS debugger.
Ocsigen's lwt library is also the best "callback hell" solution I've found.
The only advice I can offer is that the documentation actually is correct and pretty complete, but there's nevertheless something about its organization that makes it difficult to find what you're after.
In particular, start by reading this page carefully: http://ocsigen.org/js_of_ocaml/2.5/manual/library
It explains everything at a high level.