From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 2F521BC69 for ; Thu, 16 Aug 2007 18:24:53 +0200 (CEST) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.185]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7GGOplD012243 for ; Thu, 16 Aug 2007 18:24:52 +0200 Received: from mac.com (smtpin02-en2 [10.13.10.147]) by smtpout.mac.com (Xserve/smtpout15/MantshX 4.0) with ESMTP id l7GGOpP4010500 for ; Thu, 16 Aug 2007 09:24:51 -0700 (PDT) Received: from [10.0.1.152] (c-24-218-151-219.hsd1.ma.comcast.net [24.218.151.219]) (authenticated bits=0) by mac.com (Xserve/smtpin02/MantshX 4.0) with ESMTP id l7GGOnSF015741 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Thu, 16 Aug 2007 09:24:50 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <5C180944-2CD9-48FB-8802-8AF57972AD2C@gmail.com> References: <5C180944-2CD9-48FB-8802-8AF57972AD2C@gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-2-668366172 Message-Id: <4DB2486A-4E68-4843-A02C-B058DB2CA28D@mac.com> From: Gordon Henriksen Subject: Re: [Caml-list] JIT VM in OCaml: Impossible? Date: Thu, 16 Aug 2007 12:24:39 -0400 To: Caml List X-Mailer: Apple Mail (2.752.3) X-Miltered: at discorde with ID 46C47A54.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 runtime:01 compiler:01 compiler:01 bytecode:01 runtime:01 bytecode:01 10,:98 10,:98 wrote:01 wrote:01 compile:01 compile:01 caml-list:01 --Apple-Mail-2-668366172 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed On 2007-08-16, at 10:10, Joel Reymont wrote: > Is it possible to write a JIT VM in OCaml? > > It seems that this should not be possible as OCaml does not allow =20 > for code generation at runtime. Am I mistaken? Sure. You could write a compiler and assembler in ocaml. But you'd =20 need to write glue code in C or assembly to convert the ocaml =20 representation to machine data structures, and to call into your =20 ocaml-based compiler implementation on-demand when a function is called. But to compile your language/bytecode to ocaml source, and then JIT =20 compile that? No help there, no=85 =97 Gordon --Apple-Mail-2-668366172 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=WINDOWS-1252
On 2007-08-16, at = 10:10, Joel Reymont wrote:

Is it possible to write a JIT = VM in OCaml?
It seems that this should not be = possible as OCaml does not allow for code generation at runtime. Am I = mistaken?

Sure. You could write a = compiler and assembler in ocaml. But you'd need to write glue code in C = or assembly to convert the ocaml representation to machine data = structures, and to call into your ocaml-based compiler implementation = on-demand when a function is called.

But to compile your = language/bytecode to ocaml source, and then JIT compile that? No help = there, no=85

=97 Gordon

= --Apple-Mail-2-668366172--