caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yoann Padioleau <padator@wanadoo.fr>
To: Benedikt Meurer <benedikt.meurer@googlemail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCamlJit 2.0
Date: Fri, 19 Nov 2010 10:43:19 -0800	[thread overview]
Message-ID: <FF0D5F27-226B-4B40-9D85-E51B8135B0D8@wanadoo.fr> (raw)
In-Reply-To: <D252EA22-12B7-4161-8F51-B09A505424D7@googlemail.com>


On Nov 16, 2010, at 6:52 AM, Benedikt Meurer wrote:

> 
> Hello everybody,

Hi, 

> 
> OCamlJit 2.0 is a new Just-In-Time engine for Objective Caml 3.12.0 on desktop processors (x86/x86-64). It translates the OCaml byte-code used by the interpreter (ocamlrun and ocaml) to x86/x86-64 native code on-demand and runs the generated native code instead of interpreting the byte-code. It is designed to run with minimal compilation overhead (translating only what is being executed, avoiding costly code generation and optimization techniques), while being 100% compatible with the byte-code runtime (including serialization and hashing of closures, etc.).
> 
> OCamlJit 2.0 was specifically designed for desktop processors and is not really portable to anything else in its current shape, because the target audience are people using the interactive top-level and the byte-code interpreter for rapid prototyping/development

The target audience seems quite small to me. I think this project is very interesting from an educational point of view (to understand more
the internals of OCaml) but I doubt we really need a JIT for OCaml. ocamlc + ocamlopt are very hard to beat.

What would be really nice is to make a JIT for a language that really need one, like PHP! There are lots of companies out there (Yahoo, Facebook,
wikimedia) that spend hundreds of millions of dollars on machines that run PHP bytecode interpreters implemented by people who are not Xavier Leroy.
It's not trivial to statically determine types in PHP which prevent to write really efficient compilers for PHP. JIT are perfect in such situation.
I started to develop some basic compiler infrastructure around PHP at https://github.com/facebook/pfff if you are interested.
Improving the current PHP implementation by 5% can save millions of dollars to Wikimedia. Think about it next time you see
Jimmy Wales asking for money to fund Wikipedia; there are many ways computer scientists can help him.

> (which is unlikely to happen on anything else but x86/x86-64). The implementation currently requires a system that adheres to the SysV ABI, which includes Linux, BSD, OS X, but excludes Win32/Win64 (patches/ideas are welcome). It was tested on Linux/x86 (Debian), Linux/amd64 (CentOS) and Mac OS X 10.6 (64bit). The x86 implementation requires SSE2 capable processors (otherwise it falls back to the byte-code interpreter), so it won't speedup your OCaml programs running on 486 CPUs. :-)
> 
> OCamlJit 2.0 runs most benchmarks at 2-6 times faster than the byte-code interpreter. The interactive top-level benefits twice when used with the JIT engine: (a) the compiler stages are JIT compiled and (b) the generated byte-code is JIT compiled. A tech report describing a slightly earlier prototype and including performance measures of OCamlJit 2.0 on Mac OS X (64bit) is available at:
> 
> http://arxiv.org/abs/1011.1783
> 
> The source code is available from the Git repository (master branch) at:
> 
> http://gitorious.org/ocamljit2/ocamljit2
> 
> Installation is similar to installation of Objective Caml, just run
> 
> ./configure -prefix /path/to/ocamljit2 [options]
> 
> followed by
> 
> make world opt
> make install
> 
> This will install a fully working Objective Caml 3.12.0 to /path/to/ocamlji2, where /path/to/ocamljit2/bin/ocamlrun and /path/to/ocamljit2/lib/libcamlrun_shared.so include the JIT engine in addition to the byte-code interpreter (fallback to the byte-code interpreter is necessary for debugging with ocamldebug). The configure script prints a line indicating whether the JIT engine is enabled or not (if not, it'll be just a regular OCaml 3.12 installation).
> 
> Comments are welcome.
> 
> Enjoy!
> 
> Benedikt Meurer
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 




  parent reply	other threads:[~2010-11-19 18:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 14:52 Benedikt Meurer
2010-11-16 17:07 ` [Caml-list] " bluestorm
2010-11-16 17:32   ` Benedikt Meurer
2010-11-17  8:44 ` Native toplevel? (was: OCamlJit 2.0) Alain Frisch
2010-11-17 10:46   ` Satoshi Ogasawara
2010-11-17 11:38   ` Sylvain Le Gall
2010-11-17 22:57   ` [Caml-list] Native toplevel? Wojciech Daniel Meyer
2010-11-18 16:49   ` [Caml-list] Native toplevel? (was: OCamlJit 2.0) Ashish Agarwal
2010-11-19 18:09     ` David MENTRE
2010-11-19 18:24       ` Hezekiah M. Carty
2010-11-19 18:30         ` Ashish Agarwal
2010-11-19 18:42           ` Benedikt Meurer
2010-11-20 11:49     ` Jon Harrop
2010-11-18 18:19   ` Benedikt Meurer
     [not found]   ` <2025993285.616104.1290144569061.JavaMail.root@zmbs4.inria.fr>
2010-11-19 10:02     ` [Caml-list] Re: Native toplevel? Fabrice Le Fessant
2010-11-19 19:16       ` Benedikt Meurer
2010-11-19 18:43 ` Yoann Padioleau [this message]
2010-11-19 19:10   ` [Caml-list] OCamlJit 2.0 Benedikt Meurer
2010-11-20 15:59     ` Yoann Padioleau
2010-11-19 19:46   ` Dario Teixeira
2010-11-19 20:20     ` Yoann Padioleau
2010-11-20 15:19       ` [Was: OCamlJit 2.0] Vincent Balat
2010-11-20 15:42         ` [Caml-list] " Benedikt Meurer
2010-11-20 16:10           ` Yoann Padioleau
2010-11-20 16:25             ` Benedikt Meurer
2010-11-20 17:35               ` Yoann Padioleau
2010-11-20 17:08             ` Jon Harrop
2010-11-20 17:37               ` Yoann Padioleau
2010-11-20 17:48                 ` Sylvain Le Gall
2010-11-20 18:51                   ` [Caml-list] " Jon Harrop
2010-11-20 18:05                 ` [Caml-list] " Jon Harrop
2010-11-20 17:15             ` Gerd Stolpmann
2010-11-23  2:09             ` Elias Gabriel Amaral da Silva
2010-11-24  7:20     ` [Caml-list] OCamlJit 2.0 Alain Frisch
2010-11-24  7:59       ` Yoann Padioleau
2010-11-24  9:04       ` Compiling to Javascript Jerome Vouillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FF0D5F27-226B-4B40-9D85-E51B8135B0D8@wanadoo.fr \
    --to=padator@wanadoo.fr \
    --cc=benedikt.meurer@googlemail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).