Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] LLVM: A native-code compiler for MiniML in ~100LOC
Date: Sun, 02 Dec 2007 11:00:05 +0100	[thread overview]
Message-ID: <47528225.5040802@inria.fr> (raw)
In-Reply-To: <200711262052.18186.jon@ffconsultancy.com>

> I went through the usual steps in trying this and was extremely
> impressed with the results. After only two days I was able to create
> an optimizing native-code compiler for a subset of CAML large enough
> to represent the following Fibonacci program:

Yes, LLVM is an impressive project and your example demonstrates that
LLVM is very well suited to run-time code generation.

However, I have a point of terminology to make: the language you
implemented is not what is normally called Mini-ML in the literature.

Your language has first-order, second-class functions, while Mini-ML
has higher-order, first-class functions.  A runtime code generator for
Mini-ML would be significantly more complex, since it has to deal with
first-class functions either through closure conversion or
defunctionalization, meaning in both cases dynamic allocation and
garbage collection.

Which brings us back to Basile's original question about LLVM and the
Caml garbage collector.  The following page suggests that they can
already work together:

        http://llvm.org/docs/GarbageCollection.html

- Xavier Leroy


  parent reply	other threads:[~2007-12-02 10:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 20:52 Jon Harrop
2007-11-27 16:57 ` [Caml-list] " Tom Primožič
2007-12-02 10:00 ` Xavier Leroy [this message]
2007-12-02 16:21   ` Jon Harrop

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=47528225.5040802@inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /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