caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: caml-list@inria.fr
Subject: [Caml-list] native code toplevel
Date: Sun, 17 Nov 2002 09:16:52 +0100	[thread overview]
Message-ID: <15831.20596.196145.659042@hector.lesours> (raw)
In-Reply-To: <200211161432.gAGEWo124537@nez-perce.inria.fr>

>>>>> "Oleg" == Oleg  <oleg_inconnu@myrealbox.com> 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: basile<at>starynkevitch<dot>net 
alias: basile<at>tunes<dot>org 
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


  parent reply	other threads:[~2002-11-17  8:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-16 14:32 Oleg
2002-11-16 23:16 ` malc
2002-11-17  2:24   ` Oleg
2002-11-17  7:41     ` Sven Luther
2002-11-17 14:00       ` Oleg
2002-11-17 11:21     ` malc
2002-11-17 10:20   ` Stefano Zacchiroli
2002-11-17 23:59     ` Jacques Garrigue
2002-11-18  0:31       ` Walid Taha
     [not found]       ` <Pine.GSO.4.33.0211171823060.28956-100000@frosty.cs.rice.ed u>
2002-11-18  1:00         ` Chris Hecker
2002-11-18  1:04       ` Oliver Bandel
2002-11-17  8:16 ` Basile STARYNKEVITCH [this message]
2002-11-17  8:35   ` Sven Luther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15831.20596.196145.659042@hector.lesours \
    --to=basile@starynkevitch.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).