English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
LLVM: A native-code compiler for MiniML in ~100LOC
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-12-02 (10:00)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] LLVM: A native-code compiler for MiniML in ~100LOC
> 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:


- Xavier Leroy