caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* overview of bootstrapping caml light
@ 1997-02-26  4:49 Lyn A Headley
  1997-02-26  9:58 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Lyn A Headley @ 1997-02-26  4:49 UTC (permalink / raw)
  To: caml-list

[il y a un sommaire pauvre de ce message au fin]

dear caml-list,

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.

my questions:

1.) does the included bytecode file "compiler" implement only a subset
of the language? It seems that this is indeed the case, otherwise
there would be no point in compiling the subdirectory "compiler,"
would there?  And yet, if it is a subset, why?  I mean why not just
include a bytecoded compiler for the *entire* language?  Basically I
am wondering why the subdirectory "compiler" is included in the
distribution.

2.) How do src/runtime/parsing.c, src/runtime/lexing.c, 
src/compiler/parser.ml, src/compiler/lexer.ml, src/lex,
and src/yacc fit into this whole picture?

-------------------------------------------------------
[en francais]

j'essaye comprendre le processus de 'bootstrapping'.

questions:

1) est-ce que le fichier (dossier?) 'compiler' travaille pour un petit 
part de la langue caml?  

2) comment est-ce-que l'analysis de la syntaxe travaile?





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: overview of bootstrapping caml light
  1997-02-26  4:49 overview of bootstrapping caml light Lyn A Headley
@ 1997-02-26  9:58 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 1997-02-26  9:58 UTC (permalink / raw)
  To: Lyn A Headley; +Cc: caml-list

> 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-02-26 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-26  4:49 overview of bootstrapping caml light Lyn A Headley
1997-02-26  9:58 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).