Something I've been playing with: an interpreter for a multi-stage version of Dart.
Multi-stage programming is like programming with backquote, comma and eval in scheme except that variables occuring in quoted expression are statically bound, as in MetaML . Code is quoted with <expr>, spliced with ~expr and run with run(expr).
Multi-stage allows for the specialization of functions. For instance, in the linked example (it's an interactive demo, you can play with it), the spow
method is an annotated version of the pow
method which allows for specialization of its second argument. The scube
method specializes it for n = 3
. You can see in the output that it evaluates to (x) => x*x*x*1, and not (x) => pow(x, 3) as the cube
method (the partial application of pow
to 3) does. Imagine a program where scube
is used many times: it's a net win over cube
The language of the demo is a very small, purely functional and strict subset of Dart.
Of course the whole thing is written in Dart :)