Skip to content

Commit b8711b7

Browse files
committed
tweak
1 parent 4122e23 commit b8711b7

File tree

2 files changed

+80
-10
lines changed

2 files changed

+80
-10
lines changed

docs/blog/index.html

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,19 +426,56 @@ <h1>Announcing BuckleScript 1.0</h1>
426426
</div>
427427
</div>
428428
<div id="content">
429-
<hr>
430429
<div class="paragraph">
431430
<p>BuckleScript is an optimizing compiler which compiles <a href="http://ocaml.org/">OCaml</a>
432-
into JavaScript module by module without name mangling.</p>
431+
into JavaScript module by module <em>without name mangling</em>. The generated code is <em>highly readable</em> and <em>super small</em>,
432+
see <a href="http://bloomberg.github.io/bucklescript/js-demo/">Hello world</a> example
433+
and <a href="http://bloomberg.github.io/bucklescript/js-demo/#Use_JS_standard_Library_WIP">examples of calling JS libraries</a>.
434+
BuckleScript is strongly inspired by TypeScript and BabelJS, readability and easy integration with existing JS libraries are essential.</p>
433435
</div>
434436
<div class="paragraph">
435-
<p>The generated code is highly readable and very small, see <a href="http://bloomberg.github.io/bucklescript/js-demo/">Hello world</a> example
436-
and <a href="http://bloomberg.github.io/bucklescript/js-demo/#Use_JS_standard_Library(WIP)">examples of calling JS libraries</a></p>
437+
<p>However, there are a few things we believe we do it much better:</p>
438+
</div>
439+
<div class="dlist">
440+
<dl>
441+
<dt class="hdlist1">More type safety and more performant code generated</dt>
442+
<dd>
443+
<p>BuckleScript does not invent a new language, it is OCaml. OCaml offers an industrial-strength
444+
state-of-the-art type system and provides very strong type inference (i.e. No
445+
verbose type annotation required compared with typescript), which proves
446+
<a href="http://queue.acm.org/detail.cfm?id=2038036">invaluable</a> in managing large projects.<br>
447+
OCaml&#8217;s type system is not just for tooling, it is a <em>sound</em> type system which means it is guaranteed that there will
448+
be no runtime type errors after type checking. Based on it, BuckleScript provide many optimizations during offline
449+
compilation, see a simple benchmark <a href="https://github.com/bloomberg/bucklescript#bucklescript-ocaml-stdlib">here</a></p>
450+
</dd>
451+
<dt class="hdlist1">All the benefits of OCaml stay and a feature rich FFI</dt>
452+
<dd>
453+
<p>You program can be compiled into <em>native code</em>, <em>JS</em> and even <em>unikernel</em>. The BuckleScript compiler will become even faster
454+
thanks to <a href="https://blogs.janestreet.com/flambda/">more and more optimizations</a> in the upstream compiler.<br>
455+
Thanks to OCaml&#8217;s native support of Object structural type system, BuckleScript&#8217;s FFI can model JS object natively.
456+
Some powerful type system features like polymorphic variants and GADTs are also invaluable to model existing JS libraries.<br>
457+
Unlike most language FFI, the design goal of <a href="http://bloomberg.github.io/bucklescript/Manual.html#_ocaml_calling_js">BuckleScript FFI</a> is to avoid writing any unsafe JS stubs code while remain the
458+
native efficiency. We try to avoid any allocation for the FFI.</p>
459+
</dd>
460+
<dt class="hdlist1">Compilation speed is the key to developer experience</dt>
461+
<dd>
462+
<p>Our internal benchmark shows that BuckleScript is at least 10x faster than TypeScript,
463+
there is no magic here: the BuckleScript compiler is written in OCaml which is
464+
compiled to blazing fast native code.<br>
465+
However, it does not prevent the reach of BuckleScript compiler,
466+
it is also compiled to a JS file (gzipped: 700KB for pure OCaml + 300KB for support of <a href="https://github.com/facebook/reason/">Reason</a>).<br>
467+
<a href="http://bloomberg.github.io/bucklescript/js-demo/">The whole playground</a> is powered by the compiler compiled into JS, you can see it is still quite fast.</p>
468+
</dd>
469+
</dl>
470+
</div>
471+
<div class="paragraph">
472+
<p>BuckleScript reaches 1.0 now, it covers the whole OCaml language (except some features highly coupled with runtime, like Gc module, etc)
473+
if you are interested in BuckleScript, please refer to the <a href="http://bloomberg.github.io/bucklescript/Manual.html">manual</a></p>
437474
</div>
438475
</div>
439476
<div id="footer">
440477
<div id="footer-text">
441-
Last updated 2016-08-31 09:40:55 EDT
478+
Last updated 2016-08-31 10:27:57 EDT
442479
</div>
443480
</div>
444481
</body>

site/docsource/blog/index.adoc

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,43 @@ September 1, 2016 by Hongbo Zhang
66
:page-layout: article
77

88

9-
'''
10-
119
BuckleScript is an optimizing compiler which compiles http://ocaml.org/[OCaml]
12-
into JavaScript module by module without name mangling.
10+
into JavaScript module by module _without name mangling_. The generated code is _highly readable_ and _super small_,
11+
see http://bloomberg.github.io/bucklescript/js-demo/[Hello world] example
12+
and http://bloomberg.github.io/bucklescript/js-demo/#Use_JS_standard_Library_WIP[examples of calling JS libraries].
13+
BuckleScript is strongly inspired by TypeScript and BabelJS, readability and easy integration with existing JS libraries are essential.
14+
15+
However, there are a few things we believe we do it much better:
16+
17+
More type safety and more performant code generated::
18+
19+
BuckleScript does not invent a new language, it is OCaml. OCaml offers an industrial-strength
20+
state-of-the-art type system and provides very strong type inference (i.e. No
21+
verbose type annotation required compared with typescript), which proves
22+
http://queue.acm.org/detail.cfm?id=2038036[invaluable] in managing large projects. +
23+
OCaml's type system is not just for tooling, it is a _sound_ type system which means it is guaranteed that there will
24+
be no runtime type errors after type checking. Based on it, BuckleScript provide many optimizations during offline
25+
compilation, see a simple benchmark https://github.com/bloomberg/bucklescript#bucklescript-ocaml-stdlib[here]
26+
27+
All the benefits of OCaml stay and a feature rich FFI::
28+
29+
You program can be compiled into _native code_, _JS_ and even _unikernel_. The BuckleScript compiler will become even faster
30+
thanks to https://blogs.janestreet.com/flambda/[more and more optimizations] in the upstream compiler. +
31+
Thanks to OCaml's native support of Object structural type system, BuckleScript's FFI can model JS object natively.
32+
Some powerful type system features like polymorphic variants and GADTs are also invaluable to model existing JS libraries. +
33+
Unlike most language FFI, the design goal of http://bloomberg.github.io/bucklescript/Manual.html#_ocaml_calling_js[BuckleScript FFI] is to avoid writing any unsafe JS stubs code while remain the
34+
native efficiency. We try to avoid any allocation for the FFI.
35+
36+
Compilation speed is the key to developer experience::
37+
38+
Our internal benchmark shows that BuckleScript is at least 10x faster than TypeScript,
39+
there is no magic here: the BuckleScript compiler is written in OCaml which is
40+
compiled to blazing fast native code. +
41+
However, it does not prevent the reach of BuckleScript compiler,
42+
it is also compiled to a JS file (gzipped: 700KB for pure OCaml + 300KB for support of https://github.com/facebook/reason/[Reason]). +
43+
http://bloomberg.github.io/bucklescript/js-demo/[The whole playground] is powered by the compiler compiled into JS, you can see it is still quite fast.
44+
45+
1346

14-
The generated code is highly readable and very small, see http://bloomberg.github.io/bucklescript/js-demo/[Hello world] example
15-
and http://bloomberg.github.io/bucklescript/js-demo/#Use_JS_standard_Library(WIP)[examples of calling JS libraries]
47+
BuckleScript reaches 1.0 now, it covers the whole OCaml language (except some features highly coupled with runtime, like Gc module, etc)
48+
if you are interested in BuckleScript, please refer to the http://bloomberg.github.io/bucklescript/Manual.html[manual]

0 commit comments

Comments
 (0)