Compiler ยท Nov 18, 2019

What's new in BuckleScript v7 (Part 1)

Hongbo Zhang
Compiler Team

New major dev release available

The new major version of BuckleScript is coming -7.0.0-dev.1 is now released for testing!

We are maintaining 5.* and 6.* for OCaml 4.02 and 4.06 for a while, since this release we are moving forward and focusing on release 7.* (for OCaml 4.06).

This is a major release comes with lots of nice features listed here.

We talk about some highlights here

  • refmt upgraded to latest, it comes with better error message

  • OCaml Records compiled into JS objects

This is one of the most desired features, it is finally landed.

See the generated code below for excitement!

RE
type t = { x: int, y: int, z: int, }; let obj = {x: 3, y: 2, z: 2}; let obj2 = {...obj, y: 4};
JS
var obj2 = { x: 3, y: 4, z: 2 }; var obj = { x: 3, y: 2, z: 2 };

This new change makes record much more useful and its interaction with private type; unboxed option type will make interop with JS much nicer!

As always, we continue improving our optimizer in various commits, we belive that not only a better language but also an implementation of high quality is key to push typed functional programming into industry.

Happy hacking!

Want to read more?
Back to Overview