caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Will Benton <willb@cs.wisc.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] example toy compiler in OCAML?
Date: Mon, 10 Sep 2001 17:53:25 +0200	[thread overview]
Message-ID: <20010910175325.A13536@pauillac.inria.fr> (raw)
In-Reply-To: <3B9BABBD.A522AF44@cs.wisc.edu>; from willb@cs.wisc.edu on Sun, Sep 09, 2001 at 12:49:49PM -0500

> 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


      parent reply	other threads:[~2001-09-10 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-09 17:49 Will Benton
2001-09-09 18:13 ` Basile STARYNKEVITCH
2001-09-09 18:47 ` John Max Skaller
2001-09-10 15:53 ` Xavier Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010910175325.A13536@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=willb@cs.wisc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).