17 Apr 2016
Bucklescript -- great language for great platform
deliver most applications, the
no installation process makes it the best channel
are in high demand, and indeed there are tons of them,
so how bucklescript is unique here?
Unlike most transpilers, bucklescript has several advantages:
It’s OCaml with excellent FFI support.
OCaml has a ML like type system, advanced module system.
Unlike Haskell, two features really make
structural typing and row polymorphism: the best part to model JS FFI
OCaml’s built-in support of structual typing and row polymorphism makes writing
type description filein OCaml for JS much easier
straigtforward imperative programming
OCaml is a practical language, it is not opinionated, it encourages people do functional programmming in general, but when people really need do some mutations, it does not get in your way, you don’t need struggle with the type system.
Hashtblare first class data structures in OCaml
Compiles just so fast, no longer waiting for compilation!
The original OCaml compiler is already among one of the fastest compilers, instead of emitting asm code or byte code, we emit JS directly which also saves the time for linking, since the generated JS code is just plain commonJS code.
With the forthcoming flambda optimization, bucklescript will simply benefit from all optimizations on the asm backend.
You can play with the playground: bucklescript compiler in Js backend, even the JS backend is pretty fast.