Skip to content

Latest commit

 

History

History
74 lines (46 loc) · 2.66 KB

Release.1.7.0.adoc

File metadata and controls

74 lines (46 loc) · 2.66 KB

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

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.

More bindings including Js.Promise.t

Unicode string and interpolation support

Catch exceptions raised on JS side

Mixed data source

See bs.open

ES6 support in Safari

bs-dev-dependencies support in the build system

bs.as accept json literal support

Bug fixes, performance improvement, and stress tests

Notable bug fixes #1549, #1539, #1520