caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] example toy compiler in OCAML?
@ 2001-09-09 17:49 Will Benton
  2001-09-09 18:13 ` Basile STARYNKEVITCH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Will Benton @ 2001-09-09 17:49 UTC (permalink / raw)
  To: caml-list


I am interested in implementing a compiler (for a toy language of my own
design) in ML, mostly to get more comfortable with ML, but also because
I want a faster compiler than the one I have, which is written in Java. 

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?




Thanks,
wb
-------------------
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


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

* [Caml-list] example toy compiler in OCAML?
  2001-09-09 17:49 [Caml-list] example toy compiler in OCAML? Will Benton
@ 2001-09-09 18:13 ` Basile STARYNKEVITCH
  2001-09-09 18:47 ` John Max Skaller
  2001-09-10 15:53 ` Xavier Leroy
  2 siblings, 0 replies; 4+ messages in thread
From: Basile STARYNKEVITCH @ 2001-09-09 18:13 UTC (permalink / raw)
  To: Will Benton; +Cc: caml-list

>>>>> "Will" == Will Benton <willb@cs.wisc.edu> writes:

    Will> I am interested in implementing a compiler (for a toy
    Will> language of my own design) in ML

I suggest looking into QuickC-- on www.cminusminus.org which is
literately programmed in Ocaml.
-- 

Basile STARYNKEVITCH -- http://perso.wanadoo.fr/starynkevitch/basile/
email: basile dot starynkevitch at wanadoo dot fr (France)
alias: basile at tunes dot org       host: http://lesours.dyndns.org/
8, rue de la Faïencerie, 92340 Bourg La Reine, France
-------------------
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


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

* Re: [Caml-list] example toy compiler in OCAML?
  2001-09-09 17:49 [Caml-list] example toy compiler in OCAML? Will Benton
  2001-09-09 18:13 ` Basile STARYNKEVITCH
@ 2001-09-09 18:47 ` John Max Skaller
  2001-09-10 15:53 ` Xavier Leroy
  2 siblings, 0 replies; 4+ messages in thread
From: John Max Skaller @ 2001-09-09 18:47 UTC (permalink / raw)
  To: Will Benton; +Cc: caml-list

Will Benton wrote:

> 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?


	http://felix.sourceforge.net

is a Felix -> C++ translator written in Ocaml: I make no
claim as to the quality of the code. However, it isn't
a 'toy'.

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au 
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
New generation programming language Felix  http://felix.sourceforge.net
Literate Programming tool Interscript     
http://Interscript.sourceforge.net
-------------------
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


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

* Re: [Caml-list] example toy compiler in OCAML?
  2001-09-09 17:49 [Caml-list] example toy compiler in OCAML? Will Benton
  2001-09-09 18:13 ` Basile STARYNKEVITCH
  2001-09-09 18:47 ` John Max Skaller
@ 2001-09-10 15:53 ` Xavier Leroy
  2 siblings, 0 replies; 4+ messages in thread
From: Xavier Leroy @ 2001-09-10 15:53 UTC (permalink / raw)
  To: Will Benton; +Cc: caml-list

> 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


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

end of thread, other threads:[~2001-09-10 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-09 17:49 [Caml-list] example toy compiler in OCAML? 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 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).