caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] Ocsigen Js_of_ocaml 2.0
@ 2014-04-11 13:12 Jérôme Vouillon
  2014-04-11 13:36 ` Jacques-Pascal Deplaix
  0 siblings, 1 reply; 3+ messages in thread
From: Jérôme Vouillon @ 2014-04-11 13:12 UTC (permalink / raw)
  To: caml-list, ocsigen

Hi,

We are happy to announce release 2.0 of Js_of_ocaml, the compiler from
OCaml bytecode to JavaScript.

A lot of efforts has been put in reducing the size of the generated
JavaScript code. Much shorter variable names are used; unnecessary
whitespaces and semicolons are omitted; multiple occurrences of a same
constant are shared... The runtime is minified as well. You can expect
a space reduction of 15% to 20%.

Recursive modules are now supported. Tail calls between mutually
recursive functions are optimized (using trampolines). In particular,
lexers produced by ocamllex are now properly optimized.

The runtime now simulates a small filesystem (in memory), which makes
it possible to use the OCaml I/O functions. The standard outputs are
by default redirected to the JavaScript console, which is convenient
for debugging.

A larger part of the OCaml libraries are supported: bigarrays, the
time-related functions of the Unix library.

A number of incompatible changes have been made. In particular:
- JavaScript numbers are simply given type 'float' rather than type
  'float Js.t';
- the compiler generates "strict mode" JavaScript; therefore,
  'Js.Unsafe.variable "this"' does not refer to the JavaScript
  global object ("window" in browsers) anymore; you can use
  'Js.Unsafe.global' instead;
- runtime primitives are now wrapped together with the generated code
  in a huge function so as not to pollute the global scope.

LINKS

Project home page  http://ocsigen.org/js_of_ocaml/
Download           http://ocsigen.org/download/js_of_ocaml-2.00.tar.gz
Get source code    git clone https://github.com/ocsigen/js_of_ocaml.git
Documentation      http://ocsigen.org/js_of_ocaml/manual/


Regards,

-- Jérôme Vouillon and Hugo Heuzard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] [ANN] Ocsigen Js_of_ocaml 2.0
  2014-04-11 13:12 [Caml-list] [ANN] Ocsigen Js_of_ocaml 2.0 Jérôme Vouillon
@ 2014-04-11 13:36 ` Jacques-Pascal Deplaix
  2014-04-11 13:42   ` Jacques-Pascal Deplaix
  0 siblings, 1 reply; 3+ messages in thread
From: Jacques-Pascal Deplaix @ 2014-04-11 13:36 UTC (permalink / raw)
  To: Jérôme Vouillon, caml-list, ocsigen

Note also that this release includes an ocamlbuild plugin which can be 
used with ocaml >= 4.01.

You can now build your javascript program with the following "steps":
  $ ls
yourprogram.ml myocamlbuild.ml
  $ cat myocamlbuild.ml
Ocamlbuild_plugin.dispatch Ocamlbuild_js_of_ocaml.dispatcher;;
  $ ocamlbuild -plugin-tags js_of_ocaml.ocamlbuild yourprogram.js

Then yourprogram.js can be found in the _build directory

The full Changelog is available here:
https://github.com/ocsigen/js_of_ocaml/blob/089b051f4f819caa51036627846c35a194b9430c/CHANGES

On 04/11/2014 03:12 PM, Jérôme Vouillon wrote:
> Hi,
>
> We are happy to announce release 2.0 of Js_of_ocaml, the compiler from
> OCaml bytecode to JavaScript.
>
> A lot of efforts has been put in reducing the size of the generated
> JavaScript code. Much shorter variable names are used; unnecessary
> whitespaces and semicolons are omitted; multiple occurrences of a same
> constant are shared... The runtime is minified as well. You can expect
> a space reduction of 15% to 20%.
>
> Recursive modules are now supported. Tail calls between mutually
> recursive functions are optimized (using trampolines). In particular,
> lexers produced by ocamllex are now properly optimized.
>
> The runtime now simulates a small filesystem (in memory), which makes
> it possible to use the OCaml I/O functions. The standard outputs are
> by default redirected to the JavaScript console, which is convenient
> for debugging.
>
> A larger part of the OCaml libraries are supported: bigarrays, the
> time-related functions of the Unix library.
>
> A number of incompatible changes have been made. In particular:
> - JavaScript numbers are simply given type 'float' rather than type
>    'float Js.t';
> - the compiler generates "strict mode" JavaScript; therefore,
>    'Js.Unsafe.variable "this"' does not refer to the JavaScript
>    global object ("window" in browsers) anymore; you can use
>    'Js.Unsafe.global' instead;
> - runtime primitives are now wrapped together with the generated code
>    in a huge function so as not to pollute the global scope.
>
> LINKS
>
> Project home page  http://ocsigen.org/js_of_ocaml/
> Download           http://ocsigen.org/download/js_of_ocaml-2.00.tar.gz
> Get source code    git clone https://github.com/ocsigen/js_of_ocaml.git
> Documentation      http://ocsigen.org/js_of_ocaml/manual/
>
>
> Regards,
>
> -- Jérôme Vouillon and Hugo Heuzard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] [ANN] Ocsigen Js_of_ocaml 2.0
  2014-04-11 13:36 ` Jacques-Pascal Deplaix
@ 2014-04-11 13:42   ` Jacques-Pascal Deplaix
  0 siblings, 0 replies; 3+ messages in thread
From: Jacques-Pascal Deplaix @ 2014-04-11 13:42 UTC (permalink / raw)
  To: Jérôme Vouillon, caml-list, ocsigen

Oups, the working command line for ocamlbuild is rather this one:
  $ ocamlbuild -use-ocamlfind -plugin-tags "package(eliom.ocamlbuild)" 
yourprogram.js

On 04/11/2014 03:36 PM, Jacques-Pascal Deplaix wrote:
> Note also that this release includes an ocamlbuild plugin which can be 
> used with ocaml >= 4.01.
>
> You can now build your javascript program with the following "steps":
>  $ ls
> yourprogram.ml myocamlbuild.ml
>  $ cat myocamlbuild.ml
> Ocamlbuild_plugin.dispatch Ocamlbuild_js_of_ocaml.dispatcher;;
>  $ ocamlbuild -plugin-tags js_of_ocaml.ocamlbuild yourprogram.js
>
> Then yourprogram.js can be found in the _build directory
>
> The full Changelog is available here:
> https://github.com/ocsigen/js_of_ocaml/blob/089b051f4f819caa51036627846c35a194b9430c/CHANGES 
>
>
> On 04/11/2014 03:12 PM, Jérôme Vouillon wrote:
>> Hi,
>>
>> We are happy to announce release 2.0 of Js_of_ocaml, the compiler from
>> OCaml bytecode to JavaScript.
>>
>> A lot of efforts has been put in reducing the size of the generated
>> JavaScript code. Much shorter variable names are used; unnecessary
>> whitespaces and semicolons are omitted; multiple occurrences of a same
>> constant are shared... The runtime is minified as well. You can expect
>> a space reduction of 15% to 20%.
>>
>> Recursive modules are now supported. Tail calls between mutually
>> recursive functions are optimized (using trampolines). In particular,
>> lexers produced by ocamllex are now properly optimized.
>>
>> The runtime now simulates a small filesystem (in memory), which makes
>> it possible to use the OCaml I/O functions. The standard outputs are
>> by default redirected to the JavaScript console, which is convenient
>> for debugging.
>>
>> A larger part of the OCaml libraries are supported: bigarrays, the
>> time-related functions of the Unix library.
>>
>> A number of incompatible changes have been made. In particular:
>> - JavaScript numbers are simply given type 'float' rather than type
>>    'float Js.t';
>> - the compiler generates "strict mode" JavaScript; therefore,
>>    'Js.Unsafe.variable "this"' does not refer to the JavaScript
>>    global object ("window" in browsers) anymore; you can use
>>    'Js.Unsafe.global' instead;
>> - runtime primitives are now wrapped together with the generated code
>>    in a huge function so as not to pollute the global scope.
>>
>> LINKS
>>
>> Project home page  http://ocsigen.org/js_of_ocaml/
>> Download http://ocsigen.org/download/js_of_ocaml-2.00.tar.gz
>> Get source code    git clone https://github.com/ocsigen/js_of_ocaml.git
>> Documentation      http://ocsigen.org/js_of_ocaml/manual/
>>
>>
>> Regards,
>>
>> -- Jérôme Vouillon and Hugo Heuzard
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-11 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-11 13:12 [Caml-list] [ANN] Ocsigen Js_of_ocaml 2.0 Jérôme Vouillon
2014-04-11 13:36 ` Jacques-Pascal Deplaix
2014-04-11 13:42   ` Jacques-Pascal Deplaix

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).