From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA13709; Mon, 10 Sep 2001 17:53:29 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA13720 for ; Mon, 10 Sep 2001 17:53:28 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8AFrP128741; Mon, 10 Sep 2001 17:53:25 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA12612; Mon, 10 Sep 2001 17:53:25 +0200 (MET DST) Date: Mon, 10 Sep 2001 17:53:25 +0200 From: Xavier Leroy To: Will Benton Cc: caml-list@inria.fr Subject: Re: [Caml-list] example toy compiler in OCAML? Message-ID: <20010910175325.A13536@pauillac.inria.fr> References: <3B9BABBD.A522AF44@cs.wisc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: <3B9BABBD.A522AF44@cs.wisc.edu>; from willb@cs.wisc.edu on Sun, Sep 09, 2001 at 12:49:49PM -0500 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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" (http://caml.inria.fr/tutorial/index.html) ends with a simple compiler written in Caml Light. An OCaml version of the code is included in the collection of examples http://caml.inria.fr/Examples/oc.tar.gz. Jason Hickey uses OCaml in his compiler design course at Caltech, see http://www.cs.caltech.edu/cs134/cs134b/ (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 http://caml.inria.fr/Examples/oc.tar.gz. More advanced compilation in OCaml (and in French) is described in Didier Rémy's Polytechnique course notes, http://pauillac.inria.fr/~remy/poly/compil/ Enjoy, - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr