March 17, 2019
In this article, we will explain briefly the origins of each one of them, show the upsides and strong points of each solution, and lastly conclude with some guidelines on what use cases fit each one better.
High-level view of the OCaml compilation process, highlighting the part that is handled by Js_of_ocaml
High-level view of the OCaml compilation process, highlighting the part that is handled by BuckleScript, in comparison to Js_of_ocaml
The following is a non-exhaustive list of the benefits of each of them.
compiler-libs(which allows to work with the OCaml compiler, parsetree, etc) that are not available in BuckleScript, are very easy to use in Js_of_ocaml. This allows to create in-browser applications that are mind blowing, like sketch.sh.
booleanhave the same representation, while Js_of_ocaml needs to convert to
So, when to use each one? Here are some examples of situations where you want to use one or the other.
I hope you enjoyed the comparison, if you want to share your experiences with BuckleScript or Js_of_ocaml or have a suggestion, reach out on Twitter.