Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] example toy compiler in OCAML?
[ 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: [Caml-list] example toy compiler in OCAML?
> Could anyone point me to code for an example toy/small compiler
> (i.e. small enough to understand easily, preferably with ocamlllex and
> ocamlyacc specifications instead of hardcoded lexing/parsing)
> implemented in OCAML?

Michel Mauny's tutorial "Functional programming using Caml Light"
( ends with a simple compiler
written in Caml Light.  An OCaml version of the code is included in
the collection of examples

Jason Hickey uses OCaml in his compiler design course at Caltech,
see  (apparently, the course
notes have been temporarily withdrawn, but I hope they'll be back
later in the academic year :-).

If you read French, there's a toy assembler and Pascal compiler in the
book "Le langage Caml", by Pierre Weis and I.  Source code is (again)
available in the collection of examples

More advanced compilation in OCaml (and in French) is described in
Didier Rémy's Polytechnique course notes,


- Xavier Leroy
Bug reports:  FAQ:
To unsubscribe, mail  Archives: