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
[Caml-list] Ocaml and C--
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-06-05 (11:46)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Ocaml and C--
> Supposing that QC-- will deliver it promises (but Norman Ramsey, Simon
> Peyton Jones and Christian Lindig are impressively serious and clever
> guys), will Ocaml switch to target C-- or will Ocaml continue to
> natively target the usual architectures (x86, Alpha, Sparc, ia64,
> x86-64...)?

The x86-64 generator is in the works, but not there yet -- mostly
because the hardware is not there yet either :-)

To answer your question, switching to C-- will be an option when C--
has code generators for all the platforms of interest for OCaml, and
is sufficiently better than the hand-written OCaml code generators
(e.g. in performance or portability).  OCaml is already at a stage
where it has decent code generators for many platforms, so the effort
of switching to a new framework must be compensated by other

The situation is very different for new compilers, or existing
compilers that do not (yet) have good native-code generators; in this
case, C-- is a lot more interesting.

> What is the relation between C-- and Ocaml (apart a mutual respect of
> the leading developers in each team)?

I think I'm the one who coined the name "C--" to refer to a low-level,
weakly-typed intermediate code with operations corresponding roughly
to machine instructions, and minimal support for exact garbage
collection and exceptions.  See my POPL 1992 paper describing the
experimental Gallium compiler.  Such an intermediate code is still in
use in the ocamlopt compiler.

I had many interesting discussions with Simon PJ and Norman Ramsey
when they started to design their intermediate language.  Simon liked
the name "C--" and kindly asked permission to re-use the name.

However, C-- is more general than the intermediate code used by
ocamlopt, since it is designed to accommodate the needs of many source
languages, and present a clean, abstract interface to the GC and
run-time system.  The ocamlopt intermediate code is somewhat
specialized for the needs of Caml and for the particular GC we use.

At any rate, I think C-- is an excellent design and I wish the C--
team the best of luck in implementing and popularizing it.

- Xavier Leroy
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr