BuckleScript

BuckleScript

  • Docs
  • Try
  • API
  • Community
  • Blog
  • Languages iconEnglish
    • 日本語
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • 中文
    • 繁體中文
    • Help Translate
  • GitHub

›Recent Posts

Recent Posts

  • A story of exception encoding in BuckleScript
  • What's new in release 7.3
  • Generalized uncurry support in BuckleScript 7.3
  • Announcing bs-platform 7.2
  • Loading stdlib from memory

BuckleScript 1.7.0

October 7, 2017

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.

More Interop including Js.Promise.t

Unicode string and interpolation support

See String interpolation

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

Recent Posts