Version française
Home     About     Download     Resources     Contact us    
Browse thread
overview of bootstrapping caml light
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: overview of bootstrapping caml light
> 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