caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] BuckleScript 1.4.3 - Link time dead code elimination
@ 2017-02-13 15:57 Hongbo Zhang (BLOOMBERG/ 731 LEX)
  0 siblings, 0 replies; only message in thread
From: Hongbo Zhang (BLOOMBERG/ 731 LEX) @ 2017-02-13 15:57 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

Dear OCaml developers:
   BuckleScript is an optimizing compiler for OCaml to generate readable JavaScript, it is 
open sourced by Bloomberg [1].
   We are glad to announce 1.4.3, this release brings JS native module support to BuckleScript. In combination of existing JS bundler like rollup, it generates very small JS code output, below is an example:
   test.ml
   ```
    Js.log (List.length [1;2;3])
   ```
    test.js -- comments removed
    ```
    import * as List from "../lib/es6/list"
    console.log(List.length ([1,[2,[3,0]]]))
    ```
     test.bundle.js --comments removed
     ```
     (function (){
       var invalid_argument = [ "Invalid_argument", -3];
       function length(l) {
            var _len = 0;
            var _param = l;
            while(true) {
               var param = _param;
               var len = _len;
               if (param) {
                    _param = param[1];
                    _len = len + 1 | 0;
                    continue ;      
                }
               else {
                    return len;
                }
           }
        }
        console.log(length([1,2,3]));
      })()
     ```
   Documentation is available here: http://bloomberg.github.io/bucklescript/Manual.html
   To install:
        npm install -g bs-platform
   Happy hacking in OCaml! -- Hongbo
[1]: https://github.com/bloomberg/bucklescript/   



[-- Attachment #2: Type: text/html, Size: 2468 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-13 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 15:57 [Caml-list] [ANN] BuckleScript 1.4.3 - Link time dead code elimination Hongbo Zhang (BLOOMBERG/ 731 LEX)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).