There are a few things we believe BuckleScript does better than TypeScript:
Generated code is more efficient and fully type-safe
- BuckleScript is not a new language, it is OCaml. OCaml offers an industrial-strength state-of-the-art type system and provides very strong type inference (i.e. unlike TypeScript, no verbose type annotation is required), which proves invaluable in managing large projects.
- OCaml’s type system is not just for tooling; it is a sound type system which means it is guaranteed there will be no runtime type errors after type checking. Based on this guarantee, BuckleScript provides many optimizations during offline compilation. You can view a simple benchmark here!
All the benefits of OCaml with a feature rich and efficient Foreign Function Interface (FFI)
- Your program can be compiled
- Unlike most language FFIs, the design goal of our FFI is to avoid writing any unsafe JS “stub” code with a performance cost. In particular, we try to avoid any unnecessary memory allocations in the FFI.
Compilation speed is key to a good developer experience
- Our internal benchmarks show that BuckleScript compiles at least ten times faster than TypeScript. There is no magic here, the BuckleScript compiler is written in OCaml which is compiled to blazing fast native code.
We are pleased to announce a stable 1.0 release of BuckleScript, which covers the whole OCaml language (except some features highly coupled with runtime, like the GC and Unix modules, etc.). To learn more about BuckleScript, please refer to the user manual. We welcome your feedback.