From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1D020BC57 for ; Fri, 19 Nov 2010 19:43:22 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArQFAANU5kxQDPIvYGdsb2JhbACULo4zCxcLCAYUAx+jMpo9hUsEhFqJDw X-IronPort-AV: E=Sophos;i="4.59,224,1288566000"; d="scan'208";a="67527531" Received: from smtp21.orange.fr ([80.12.242.47]) by mail3-smtp-sop.national.inria.fr with ESMTP; 19 Nov 2010 19:43:21 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2107.orange.fr (SMTP Server) with ESMTP id 079C01C00088; Fri, 19 Nov 2010 19:43:21 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2107.orange.fr (SMTP Server) with ESMTP id ED7531C00058; Fri, 19 Nov 2010 19:43:20 +0100 (CET) Received: from [172.24.130.66] (out1-1601fw.corp.tfbnw.net [66.220.144.27]) by mwinf2107.orange.fr (SMTP Server) with ESMTP id F27D21C00088; Fri, 19 Nov 2010 19:43:19 +0100 (CET) X-ME-UUID: 20101119184319993.F27D21C00088@mwinf2107.orange.fr X-ME-User-Auth: padator@wanadoo.fr Subject: Re: [Caml-list] OCamlJit 2.0 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Yoann Padioleau In-Reply-To: Date: Fri, 19 Nov 2010 10:43:19 -0800 Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Benedikt Meurer X-Mailer: Apple Mail (2.1081) X-Spam: no; 0.00; ocaml:01 byte-code:01 ocamlrun:01 ocaml:01 byte-code:01 compilation:01 translating:01 runtime:01 hashing:01 prototyping:01 ocamlc:01 ocamlopt:01 bytecode:01 trivial:01 statically:01 On Nov 16, 2010, at 6:52 AM, Benedikt Meurer wrote: >=20 > Hello everybody, Hi,=20 >=20 > 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.). >=20 > 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. :-) >=20 > 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: >=20 > http://arxiv.org/abs/1011.1783 >=20 > The source code is available from the Git repository (master branch) = at: >=20 > http://gitorious.org/ocamljit2/ocamljit2 >=20 > Installation is similar to installation of Objective Caml, just run >=20 > ./configure -prefix /path/to/ocamljit2 [options] >=20 > followed by >=20 > make world opt > make install >=20 > 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). >=20 > Comments are welcome. >=20 > Enjoy! >=20 > Benedikt Meurer >=20 > _______________________________________________ > 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 >=20