When comparing Js_of_ocaml vs Babel (6to5), the Slant community recommends Babel (6to5) for most people. In the question“What are the best languages that compile to JavaScript? ” Babel (6to5) is ranked 8th while Js_of_ocaml is ranked 33rd. The most important reason people chose Babel (6to5) is:
Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro All OCaml features
Js_of_ocaml brings all OCaml features to Javascript: static typing, type inference, modules, functional programming style...
Pro Support ES6(Harmony)
Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support.
Pro Plugins for custom features
Pro Future forward thinking
Cons
Con Documentation
Documentation is still scarce
Con Generated ES5 is ugly and performs badly
Output looks far from handwritten ES5, is quite large with a lot of extra statements to execute.