Lambda the Ultimate

inactiveTopic MetaOcaml
started 5/16/2002; 9:27:55 AM - last post 5/17/2002; 9:08:27 AM
Bryn Keller - MetaOcaml  blueArrow
5/16/2002; 9:27:55 AM (reads: 2395, responses: 3)
This is a variant of Ocaml supporting staged typing, which is a bit like macros, but with type checking. It's based on MetaML, which (surprisingly) we don't seem to have discussed here either.

The site recommends the first three chapters of this thesis as an introduction to and motivation for multi-stage programming. There are several other related papers available from this page.

Here's the blurb:
In addition to having the usual constructs of a general-purpose language, multi-stage languages internalize the notions of runtime program generation and execution. Thus, multi-stage languages provide the programmer with the essence of partial evaluation and program specialization techniques, both of which have been shown to lead to dramatic resource-utilization gains in a wide range of applications, starting from implementations of domain-specific compilers, to high-performance operating systems. Multi-stage languages make it possible to write generic and highly-parameterized programs that do not pay unnecessary runtime overheads.
Posted to functional by Bryn Keller on 5/16/02; 9:30:32 AM

Bryn Keller - Re: MetaOcaml  blueArrow
5/16/2002; 9:49:50 AM (reads: 702, responses: 0)
I also periodically hear about MetaHaskell (it's mentioned here for instance, and sometimes it shows up in mailing lists, but I've never found a page describing the current status of the effort. Does anyone know more about this?

Ehud Lamm - Re: MetaOcaml  blueArrow
5/16/2002; 10:03:56 PM (reads: 682, responses: 1)
Multi-stage programming is a cool way to think about macros. But since it is used mainly in order to get flexible evaluation order, wouldn't a lazy language be a better solution?

This is, of course, another spin on the "best language for embedding DSLs" debate.

Notice that compared to Lisp/Scheme MetaOcaml's main advantage is static typing (Scheme macros in general preserve scoping, so this is aless of an issue). Obviously Haskell embeddings are statically typed (the embedded language is represented as an ADT).

andrew cooke - Re: MetaOcaml  blueArrow
5/17/2002; 9:08:27 AM (reads: 704, responses: 0)
OK, this answers part of my previous question!