Lambda the Ultimate

inactiveTopic One Day Compilers (Graydon Hoare)
started 8/12/2002; 2:45:19 AM - last post 8/13/2002; 12:49:17 PM
Ehud Lamm - One Day Compilers (Graydon Hoare)  blueArrow
8/12/2002; 2:45:19 AM (reads: 2271, responses: 4)
One Day Compilers (Graydon Hoare)
(via Ken Rawlings)

A tutorial on implementing DSLs, using O'caml, syntax extension, and a C backend.

The approach is based on using Camlp4 for embedding the DSL in O'caml, and producing C source code using the author's Cquot package (for C code quasiquoting).

A similar thing can be done using Scheme.


Posted to DSL by Ehud Lamm on 8/12/02; 2:46:33 AM

Michael Christopher Vanier - Re: One Day Compilers (Graydon Hoare)  blueArrow
8/12/2002; 3:59:19 PM (reads: 1125, responses: 1)
This is a really brilliant example. As an ocaml aficionado, I've wanted to learn how to use ocamlp4 (the ocaml preprocessor/pretty-printer, effectively an ocaml macro system) for a long time. This gives a very straightforward but highly nontrivial example which features ocaml code generation, ocaml abstract syntax tree generation (!) and C code generation.

I think that the combination of strong statically-typed functional languages and powerful macro systems is an incredibly powerful combination.

Karl Zilles - Re: One Day Compilers (Graydon Hoare)  blueArrow
8/13/2002; 12:04:23 PM (reads: 1051, responses: 1)
The site is not responding. Is it possible that it got LtUed? :)

Ehud Lamm - Re: One Day Compilers (Graydon Hoare)  blueArrow
8/13/2002; 12:49:17 PM (reads: 1101, responses: 0)
I am able to access the site from here.

LtU is no Slashdot just yet...

Ehud Lamm - Re: One Day Compilers (Graydon Hoare)  blueArrow
8/13/2002; 3:01:40 PM (reads: 1130, responses: 0)
I think that the combination of strong statically-typed functional languages and powerful macro systems is an incredibly powerful combination.

So you should be interested in this paper (about templating Haskell).