4 ms·
I think "all of Ocaml compiles to JS " is a bit optimistic. AFAIK, code using Jane Street's Core stdlib doesn't work. But a lot of Ocaml code should be fine.
by mercurial 12y ago
I think "all of Ocaml compiles to JS " is a bit optimistic. AFAIK, code using Jane Street's Core stdlib doesn't work. But a lot of Ocaml code should be fine.
- jlrubin 12y agoThis is because Core relies on OS/FFI. I think as long as it isn't using OS/FFI it can compile, although I may be wrong on that count.
- avsm 12y agoAll of the core compiler library does compile to efficient JavaScript. For instance, see the IOCamlJS interactive notebooks that embed the entire compiler in the browser with a web UI. Just press the play button: - http://andrewray.github.io/iocamljs/oh261.html http://andrewray.github.io/iocamljs/oh261.html (H.261 video decoding) - http://www.ujamjar.com/hardcaml/ http://www.ujamjar.com/hardcaml/ (HardCaml RTL hardware description language, similar to Chisel in Scala) - http://gazagnaire.org/fuconf14/ http://gazagnaire.org/fuconf14/ (building a 2048 game implementation)
- ufo 12y agoHe was talking about Jane Street's replacement stdlib. I heard Core_kernel can be compiled to JS though.