Re: overview of bootstrapping caml light

From: Xavier Leroy (
Date: Wed Feb 26 1997 - 10:58:20 MET

From: Xavier Leroy <>
Message-Id: <>
Subject: Re: overview of bootstrapping caml light
In-Reply-To: <> from Lyn A Headley at "Feb 25, 97 10:49:33 pm"
To: (Lyn A Headley)
Date: Wed, 26 Feb 1997 10:58:20 +0100 (MET)

> I have been trying to understand the bootstrapping process
> which takes place during caml light installation. If you'll
> indulge me, I'd like to present my view of what is going on,
> to see if I have the right idea, and then ask some questions.
> The first step is building the runtime system(written in C). This
> includes an interpreter for the caml light abstract machine. Then the
> produced executable, "runtime", is invoked on the file "compiler,"
> which I *think* is a byte-compiled implementation of a *subset* of the
> caml-light language. In this way the core library, actual compiler,
> linker, librarian, and toplevel are compiled into bytecode.

No, it's not a subset, it's the previous generation compiler for the
whole language. The essence of bootstrapping is to use the N-th
generation compiler to compile the (N+1)-th generation compiler.

For Caml Light, the N-th generation compiler is composed of the
bytecode files src/{camlcomp,camllink,camllibr,camllex} and the (N+1)-th
generation is built in compiler/camlcomp, linker/camllink,
librar/camllibr, lex/camllex, and toplevel/camltop. The parts written
in C (camlrun and camlyacc) are outside the bootstrapping cycle, since
they can be rebuilt independently at any time.

For general background on bootstrapping, and in particular the use of
T-diagrams to understand what's happening, see section 11.2 of the
Dragon book (Aho, Sethi, Ullman, "Compilers -- principles, techniques
and tools").

Also note that the Caml Light bootstrapping process does not handle
changes in the abstract machine very well. This has been fixed in
Objective Caml, which follows exactly the T-diagram approach.

Hope this helps,

- Xavier Leroy

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:09 MET