Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
From Bytecode to JavaScript: the Js_of_ocaml Compiler [pdf] (univ-paris-diderot.fr)
19 points by inglor on March 7, 2015 | hide | past | favorite | 2 comments


I'm glad I've had the chance to experiment with js_of_ocaml. I'd like to see continued effort to take advantage of all the potential optimizations, and tutorials/examples of using source maps (which are supported btw). So far, I am impressed with the potential!

JavaScript is clearly the world's most ubiquitous/targeted VM that performs well, and js_of_ocaml allows us to take advantage of that but with a sophisticated type system. Modern JS JITs can enable very high performance (especially JavaScriptCore in my experience), but the dark side is that it's easy to accidentally include a small piece of code that causes JIT deoptimizations.

When you start with a different source language (especially when it is statically typed) and use a controlled JS compilation toolchain, it allows the output to be generated in a way that is more likely to be stable in modern JITs. If there's an issue in the compilation, you fix it once and all apps built in the original source language are likely to avoid the issue. Furthermore, the compiled output could be tuned for particular JS engines, and servers (or app containers) can decide at the proper time, which version of the compilation the app should be executed with.


It would be nice to see updated benchmarks - I understand there have been many performance improvements in JS engines and js_of_ocaml since the original time of writing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: