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 1D087BC58 for ; Wed, 15 Sep 2010 19:37:34 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlYBAJKhkExKfVK0kGdsb2JhbACVLYwyCBUBAQEBCQkMBxEDH6sXi0YBBY9KAQSFQQ X-IronPort-AV: E=Sophos;i="4.56,371,1280700000"; d="scan'208";a="57330351" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail3-smtp-sop.national.inria.fr with ESMTP; 15 Sep 2010 19:37:33 +0200 Received: by wyb40 with SMTP id 40so281817wyb.39 for ; Wed, 15 Sep 2010 10:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:organization:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=pJV68UwRTU4HQ7/nr1CBMfi3hWNHVDvayDlgWYZddno=; b=F6r+k6g8E8coww8CK089hVD+GxeeiJB+9uTKm3ku/I6QERVMqWqZBe1pkFwRNldu3X HljuOlJFHw7VzVqPMmjZxTLtJgbIK/4zwLQbzRDbeM6lLrAjW5N8cSUhqgvb1DH2yN2s HFgRhpo8gNPA/VtTTNMGsk97Fsqx5404NP720= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:organization:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; b=bIK5UOuifsQKgsNj3qY2PNswwkEY4EeiRzFOGK5fx8KMgq4rSjv9MXNNR72P8mLEJJ DD3RFyVnhwmBAgF0rV2Lu13ib+vkMXtu1OzeygJouv8oN28zPFtKrVspxKYXx4Q/sVj6 h4dz1TN2vk+BGM7ggbLmpdfdnzs0usnvV6i3g= Received: by 10.216.186.207 with SMTP id w57mr5596851wem.19.1284572253590; Wed, 15 Sep 2010 10:37:33 -0700 (PDT) Received: from WinEight ([87.115.152.182]) by mx.google.com with ESMTPS id k83sm1162863weq.14.2010.09.15.10.37.30 (version=SSLv3 cipher=RC4-MD5); Wed, 15 Sep 2010 10:37:31 -0700 (PDT) From: Jon Harrop To: "'Basile Starynkevitch'" , "'Vincent Gripon'" , References: <4C8F660B.4060901@telecom-bretagne.eu> <20100914124341.GA11500@hector.lesours> In-Reply-To: <20100914124341.GA11500@hector.lesours> Subject: RE: [Caml-list] Compiling Ocaml sources to c sources Date: Wed, 15 Sep 2010 18:36:59 +0100 Organization: Flying Frog Consultancy Message-ID: <004b01cb54fc$9c435020$d4c9f060$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: ActUCo/ZkV2w+/70TgmZJQIW1yqnXwA8cX0Q Content-Language: en-gb X-Spam: no; 0.00; ocaml:01 ocaml:01 non-trivial:01 recursion:01 bytecode:01 compiler:01 bytecode:01 compilation:01 cheers:01 garbage:01 caml-list:01 tail:01 compiling:02 native:03 btw:03 > * 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... Cheers, Jon.