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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C93AFBC59 for ; Wed, 15 Sep 2010 20:17:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMBAHqqkEzRVda0kGdsb2JhbACTX4V9AYgGCBUBAQEBCQkMBxEDH6tFiTKCFIZQLYhUAQEDBYU8BIRFhWc X-IronPort-AV: E=Sophos;i="4.56,372,1280700000"; d="scan'208";a="69586159" Received: from mail-iw0-f180.google.com ([209.85.214.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 15 Sep 2010 20:17:16 +0200 Received: by iwn8 with SMTP id 8so464943iwn.39 for ; Wed, 15 Sep 2010 11:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=WugLqQMSiad4xmt71bxN14CMScmW7wifonk4R/VGfkc=; b=Jjp/tlJih1zb8Nt/x24Er5OZg6HSynfmM8lQmPa0+fLiKe76jQOSxiyZaWP244+IaL 2b3s6pVJ1jLeaLJLc1Zjlrb49NQtb3EGXRWHA+f65qiT4Dhg1GTo3jFHu3svH3+fUpb1 naj4EgEdhyJkoW0YnZC3+irdhq/e2ekhezmCk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=G9tknz8jzHECVnmHJOf32xV4GMPDE/V7hjGGpNhJ35VG86Cpz+ldu7F68SF7d1hmpr UerKeKwDQnnfY+dP2nvFhn6EIwGXU1EzQL2XLprKYO4ryt9z/q0our0LUqTs04o7/huo qL9tck2thdjOKga9tLde9iBZ347ieQkpuyq9c= MIME-Version: 1.0 Received: by 10.231.182.204 with SMTP id cd12mr2133101ibb.101.1284574634766; Wed, 15 Sep 2010 11:17:14 -0700 (PDT) Received: by 10.231.159.131 with HTTP; Wed, 15 Sep 2010 11:17:14 -0700 (PDT) In-Reply-To: <004b01cb54fc$9c435020$d4c9f060$@com> References: <4C8F660B.4060901@telecom-bretagne.eu> <20100914124341.GA11500@hector.lesours> <004b01cb54fc$9c435020$d4c9f060$@com> Date: Wed, 15 Sep 2010 21:17:14 +0300 Message-ID: Subject: Re: [Caml-list] Compiling Ocaml sources to c sources From: Eray Ozkural To: Jon Harrop Cc: Basile Starynkevitch , Vincent Gripon , caml-list@yquem.inria.fr Content-Type: multipart/alternative; boundary=0016363b8f64cb0a140490505642 X-Spam: no; 0.00; ocaml:01 eray:01 ozkural:01 ocaml:01 non-trivial:01 recursion:01 bytecode:01 compiler:01 bytecode:01 compilation:01 real-world:01 speedup:01 compilation:01 eray:01 ozkural:01 --0016363b8f64cb0a140490505642 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Sep 15, 2010 at 8:36 PM, Jon Harrop < jonathandeanharrop@googlemail.com> wrote: > > * Hacking a C generator inside Ocaml is non-trivial, because of the > > garbage collector, currified function calls, and tail recursion > > etc. > > BTW, I was always surprised nobody had converted the bytecode interpreter > into a via-C compiler by unwinding the C code the interpreter goes through > to execute a specific OCaml bytecode program. You could even use this with > something like Clang to get JIT compilation to native code. Not very > efficient but surely much faster than interpreted bytecode... > Hmm, this would only optimize the bytecode fetch/decode step of the ocaml execution cycle. I am not sure that it will result in much real-world speedup. In fact, that seems to be the main problem with many of these so-called JIT interpreters, which in my opinion, do not seem to have learnt from the HAL architectures of IBM OS's etc. Was probably also the problem with Transmeta; cheap compilation entails cheap performance. Best, -- Eray Ozkural, PhD candidate. Comp. Sci. Dept., Bilkent University, Ankara http://groups.yahoo.com/group/ai-philosophy http://myspace.com/arizanesil http://myspace.com/malfunct --0016363b8f64cb0a140490505642 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Sep 15, 2010 at 8:36 PM, Jon Harrop <jona= thandeanharrop@googlemail.com> wrote:
> =A0 * Hacking a C generator inside Ocaml is non-triv= ial, because of the
> =A0 =A0 garbage collector, currified function calls, and tail recursio= n
> =A0 =A0 etc.

BTW, I was always surprised nobody had converted the bytecode interpr= eter
into a via-C compiler by unwinding the C code the interpreter goes through<= br> to execute a specific OCaml bytecode program. You could even use this with<= br> something like Clang to get JIT compilation to native code. Not very
efficient but surely much faster than interpreted bytecode...

Hmm, this would only optimize the bytecode fetch/dec= ode step of the ocaml execution cycle. I am not sure that it will result in= much real-world speedup.

In fact, that seems to be the main problem with many of= these so-called JIT interpreters, which in my opinion, do not seem to have= learnt from the HAL architectures of IBM OS's etc. Was probably also t= he problem with Transmeta; cheap compilation entails cheap performance.

Best,

--
Eray Ozkural, Ph= D candidate.=A0 Comp. Sci. Dept., Bilkent University, Ankara
http://groups.yahoo.com/group/= ai-philosophy
http://myspace.com/arizanesil= http://myspace.com/malfunct
--0016363b8f64cb0a140490505642--