|
|
|
|
|
by hongboz
3818 days ago
|
|
Hi, thanks for your interest in it. This project has been released to exchange some ideas and collect feedback from the OCaml and JavaScript communities.
It is still in an very early stage and more like research projects though we already had some good results. Note that ocamlscript is inspired from typescript and js_of_ocaml, we like the readability of typescript
generated js code, while don't want to loose the expressivity of a powerful langauge, ocaml, here in particular. The main difference from js_of_ocaml is that js_of_ocaml maps the whole bytecode
program into a js file while ocamlscript maps an ocaml module to es6 module. Indeed, there is some difference in the runtime representation between js_of_ocaml and ocaml, for example, ocamlscript uses
js string and array for ocaml string and arrray(we do this since we want an optimal js output at the price of a bit runtime incompability),
this may make interaction between js_of_ocaml and ocaml a bit harder, but that's exactly why we made an early release to hear what other people may think.
js_of_ocaml is an excellent project and we learned a lot from it and will seek some collaborations to share some workload. |
|
OCamlScript does some cross-module optimization it seems. That's really cool, and js_of_ocaml does several optimizations as well, but for both approaches, it seems we'll not be able to take advantage of all really great f-lambda optimizations to come because they happen at a compiler stage after OCamlScript and js_of_ocaml have already intercepted their intermediate representations. Do you (or Drup) have thoughts on that?