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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8B47EBDCB for ; Fri, 9 Sep 2005 14:43:53 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j89ChrlL024674 for ; Fri, 9 Sep 2005 14:43:53 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA22588 for ; Fri, 9 Sep 2005 14:43:52 +0200 (MET DST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j89ChpDV020839 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 9 Sep 2005 14:43:52 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay03.plus.net with esmtp (Exim) id 1EDiER-0002Et-FU for caml-list@inria.fr; Fri, 09 Sep 2005 13:43:51 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@inria.fr Subject: Compiling to OCaml bytecode Date: Fri, 9 Sep 2005 06:22:57 +0100 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509090622.58156.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 43218389.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43218388.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 bytecode:01 ocaml's:01 bytecode:01 compiler:01 ocaml:01 ocaml's:01 dynlink:01 loadfile:01 cmo:01 compiler:01 frog:98 compile:01 compiles:01 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DATE_IN_PAST_06_12 autolearn=disabled version=3.0.3 I am interested in improving the performance of a simple term-level interpreter. As OCaml's bytecode is so fast, I'd like to replace the interpreter with a JIT compiler that compiles to OCaml bytecode and then uses OCaml's bytecode interpreter to execute the generated code efficiently and handle the results. Does the OCaml distribution expose everything needed to do this? I assume the Dynlink module is where I should be looking. I've never used it before but it looks as though it only loads from file (the "loadfile" function), so I'd have to compile to a .cmo file and load that. What is the easiest way to recover the result? If the necessary functionality is not already exposed, could it and/or what are the odds that it will be added? Also, is a bytecode-compiled JIT bytecode compiler likely to outperform a native-code-compiled term-level interpreter? I assume the JIT compiler would itself need to be compiled to bytecode in order to provide the bytecode interpreter for the generated code. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists