Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCamlJit 2.0
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-24 (09:05)
From: Jerome Vouillon <Jerome.Vouillon@p...>
Subject: Compiling to Javascript
On Wed, Nov 24, 2010 at 08:20:45AM +0100, Alain Frisch wrote:
> On 11/19/2010 8:46 PM, Dario Teixeira wrote:
> >Actually, Facebook has a compiler that transforms PHP source code into C++ [1],
> >and they claim a 50% reduction in CPU usage.
> I haven't looked into this project, but I've a hard time believing
> this is a better approach than compiling PHP to Javascript. The
> translation would probably produce quite idiomatic Javascript code
> on which modern
> interpreters do an amazing job (and they keep improving).

I'm not so sure about that.  For instance, PHP has complex implicit
conversion rules which are not the same as Javascript rules.  These
would have to be made explicit, at a high cost.  The calling
convention is likely to be different too.

On the other hand, OCaml compiles well to Javascript.  We experience
performances comparable to those of the bytecode interpreter with
Js_of_ocaml, our compiler ( ).
(I should really make an official release soon...)

-- Jerome