run is now over (I'm wasn't a participant; just an
observer). Bruce, andreas and
igor wrote some utterly amazing code. The
big suprise, though, was Gabor Greif, who magically produced
an optimizing compiler for the input language. These guys
are absolutely incredible.
(This is a big rant; you may want to skip it unless you're a
General purpose programming languages are great. You aren't
limited to any one problem domain, and you can build big,
modular software without too much trouble.
Special purpose languages are also great, but at a price.
Consider MatLab. You can write all sorts of signal
processing code without breaking a sweat, but you'll quickly
run out of gas if you stray outside the problem domain.
(Same goes for Perl 4 and text processing.)
Common LISP tries to balance these two extremes. It's a
general purpose programming language, but it also includes
extensive customization toolkit. You can define new control
constructs for your problem domain, and
bundle them into a library. In essence, you can
embed your special-purpose language inside of an
existing general-purpose language.
LISP has always been popular in the AI community, because
every new theory requires a new programming language. But
for a completely trivial example of meta-programming, you
might want to look at this Dylan
snippet for locking a POSIX mutex.
My Favorite Toy Language
I'm designing Yet Another Programming Language. This may
take a few years to get right. :-) For the sake of
discussion, I'll call it MFTL.
MFTL has three design goals, not all of which are entirely
- Scripting. MFTL should be a convenient,
easy-to-learn scripting language, on par with Python or
C/Unix/Java naming conventions, and should be implemented as
an embedable C library.
- Compilation. It should be realtively easy to
write very-high-performance code in MFTL, and compile it
(probably to C). Ideally, I'd like to match the performance
of C for number-cruching, but even 0.75C would be a big win.
(I've published some Dylan benchmarks
which might be of interest; you can find code
in the Gwydion CVS server.)
- Meta-Programming. Many popular scripting
languages are specific to a single problem domain. But these
specialized languages also tend to be whimpy and annoy
serious programmers. I think that meta-programming might
strike a nice balance here.
Dylan succeeds on points (2) and (3), but does a somewhat
poor job on point (1). I think it's possible to do a
really excellent job in all three categories.