From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA16485; Sun, 17 Nov 2002 09:17:00 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 JAA16479 for ; Sun, 17 Nov 2002 09:16:59 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from kraid.nerim.net (kraid.nerim.net [62.4.16.95]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gAH8GxX24263 for ; Sun, 17 Nov 2002 09:16:59 +0100 (MET) Received: from hector.lesours (lesours.starynkevitch.net [80.65.224.217]) by kraid.nerim.net (Postfix) with ESMTP id 6F9C940E29 for ; Sun, 17 Nov 2002 09:06:46 +0100 (CET) Received: from basile by hector.lesours with local (Exim 3.36 #1 (Debian)) id 18DKby-0001bd-00 for ; Sun, 17 Nov 2002 09:16:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15831.20596.196145.659042@hector.lesours> Date: Sun, 17 Nov 2002 09:16:52 +0100 To: caml-list@inria.fr Subject: [Caml-list] native code toplevel In-Reply-To: <200211161432.gAGEWo124537@nez-perce.inria.fr> References: <200211161432.gAGEWo124537@nez-perce.inria.fr> X-Mailer: VM 7.07 under Emacs 21.2.2 From: Basile STARYNKEVITCH Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "Oleg" == Oleg writes: Oleg> Hi I found the same question in the archives, but with no Oleg> answers: why isn't there a native code toplevel? Sometimes I Oleg> need high performance and interactivity (CMUCL can do it, Oleg> why not O'Caml?) I also share the same wishes. And actually, the toplevel might (suboptimally) dynamically translate the bytecode to machine code (i.e. do Just In Time compilation). There are tools, in particular Ian Piumarta's CCG (Ian Piumarta is also at Inria but on another project) or GNU lightning tools that could help. CCG is a set of clever C macros to generate x86 (or Sparc) machine code. Basically, with CCG you code in some kind of assembler syntax which produces C code generating it. CCG is plateform specific. Lightning uses CCG to abstract a RISC machine with few registers. You code in this RISC machine and get a C code generating code for several plateform. The only tricky point is to get tail recursive calls compiled properly. Perhaps in a not-too-remote future Ocaml might generate C-- code (see www.cminusminus.org) and the QuickC-- (coded in Ocaml) compiler might generate machine code either in memory or in shared objects (.so files) which could be opened with dlopen/dlclose/dlsym at runtime. For information, the TCC compiler generate code in memory (on x86). Of course there are several plateforms (ie Linux/s390 or Linux/HPPA) which might not have these tools available. References: C-- = http://www.cminusminus.org/ Lightning = http://www.gnu.org/software/lightning/ TCC = http://fabrice.bellard.free.fr/tcc/ As a selfish x86 coder, I would be delighted with a JIT OCaml, and even more with a library able to dynamically load code at runtime. Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet alias: basiletunesorg 8, rue de la Faïencerie, 92340 Bourg La Reine, France ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners