BuckleScript 1.7.0
First class uncurried calling convention
As a functional language, the vanilla OCaml only provides curried calling convention, BuckleScript employs fairly advanced optimizations for curried calling convention, however, the most efficient code is efficient code not relying on optimizations.
Since this release, we provide first class uncurried calling convention, all toolchains provided by BuckleScript can understand uncurried calling convention
.Curried calling convention
.test.ml
let f g x = g x [@bs] // <1>
<1> f
is curried function, g
is uncurrid function due to [@bs]
annotation
bsc.exe -i test.ml # infer the type
val f : ('a -> 'b [@bs]) -> 'a -> 'b // <1>
<1> g
is inferred as uncurried function 'a -> 'b [@bs]
while f
is curried function
.test.js
function f (g,x){ // <1>
return g (x) // <2>
}
<1> f
is optimized and flattened
<2> g
works like uncurried function
API documentation
Now ocamldoc
can understand [@bs]
natively(instead of printing a desugared output), we provide an API documentation for the library shipped with BuckleScript, we plan to ship the documentation generator in next release.
Js.Promise.t
More Interop including Unicode string and interpolation support
Catch exceptions raised on JS side
See Catch exception
Mixed data source
See bs.open
ES6 support in Safari
See fix es6 support in browser
bs-dev-dependencies
support in the build system
See build schema
bs.as
accept json literal support
See json payload
Bug fixes, performance improvement, and stress tests
[#1549](Notable bug fixes https://github.com/bucklescript/bucklescript/issues/1549), #1539, #1520