[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature incompatibilities



[Paul Graham <pg@archub.org>]
> You're right that you don't have to use lists for syntax.
> However, you'd have to use lists (or something equivalent)
> to represent e.g. the arguments in a call, so you'd still
> face a problem if you couldn't have a collection of 
> arbitrary different types of objects.  Or am I missing
> something?  --pg

It's a real tradeoff, but statically typed systems can do a bit better
than you might imagine. Check, for example, MacroML:
   http://www.cs.indiana.edu/hyplan/sabry/papers/macroml.ps
built on MetaML:
   http://www.cse.ogi.edu/PacSoft/projects/Mustang/Overview.html

Template Haskell also provides a solution to this, but to solve
certain relatively common classes of problems, the programmer needs to
resort to a somewhat baroque algebraic data notation. Of course, this
is basically what Lisp macros do, but Lisp being Lisp, this is both
natural and convenient.

I've not seen an option that preserves static typing and provides the
full generality of Lisp macros, and I'm inclined to guess that it
isn't possible, but then this brings the argument back to the usual
static/dynamic issue, and proponents of static typing might argue that
reducing the generality is, in some sense, exactly the point (inasmuch
as the language is no longer general enough to express a certain class
of erroneous programs).

Matt

-- 
Matt Hellige                  matt@immute.net
http://matt.immute.net