Robert Thau writes:
> Ease of implementation is kind of a moot point to people who aren't
> planning to write a new one (and most people aren't).
I strongly disagree!
Languages that are almost impossible to implement (e.g. Perl) will have
only one viable implementation at a time. It will be buggy and slow.
It will also be very compatible with itself, because it *is* itself.
Languages that are trivial to implement (e.g. Forth and Scheme -- well,
I shouldn't say that because I haven't yet been able to implement
either one :)) will have myriads of implementations. Every person
familiar with these languages will eventually write their own
implementation, probably spending a few days on it. All of the
implementations will be more or less incompatible. Some will be more
popular than others.
It is likely that some implementations (reportedly PolyForth, MzScheme,
etc.) will be far better than the single implementation of
difficult-to-implement languages will be, and it is also likely that
some implementations will be better suited to particular purposes.
Forth newbies are quite likely to pick up a lousy Forth implementation
first, simply because there are so many lousy Forth implementations and
so few good ones, even though the best of them are much better (in some
sense) than the best implementations of many other languages.
So ease of implementation is a *major* factor in language choice.
Both extremes have some disadvantages.
> there are probably as many people out there who have trouble with
> Scheme's syntax as with Perl's.
The foreword to SICP [a book by two MIT CS professors who teach an
introductory class with Scheme] claims that the students almost never
have any trouble with the syntax of Scheme after a single introductory
lecture. This is not surprising, because the syntax of Scheme is
something like this:
s-expression ::= "(" whitespace* (s-expression whitespace*)* ")" | atom-char*
. . . well, it's a *little* more complicated than that, but not much.
On the other hand, I have a colleague who has been using C for ten
years or so, and he periodically asks me questions about C syntax.
Perl is far more complex and less consistent than C.
This isn't really fair, though, because Perl expresses a lot of things
syntactically that Scheme handles at higher levels in the language.
There are surely as many people who have trouble passing the arguments
to the standard Scheme macros and procedures as who have trouble with
Perl syntax.
> Eugene Leitl writes:
> > As Forth, Scheme is a
> > steep-hierarchy language, letting you define application languages and
> > writing the application.
>
> And as Perl. Sigh...
Not to push the point too much, but Scheme and Forth pretty much
require that you do this. Perl goes to the opposite extreme; I have
written hundreds of Perl scripts that contained no definitions at all,
just a list of commands and a loop or two, defining no subroutines,
classes, and sometimes even no variables.
I think Scheme and Forth are actually better than Perl at the
application-language-defining thing; Jeff Bone's list of things you can
do in a page or two of Scheme (some of which are things you can do in
twenty lines or less of Forth, and some of which aren't) is one
example. Writing the applicative-order Y-combinator in terms of
anonymous Perl subs is what opened my eyes.
It's mostly a matter of syntax, though; most of the nice stuff in
Scheme (lexical scoping, closures, dynamically generated anonymous
subs, gc, higher-order functions -- although no call/cc) is in Perl,
it's just clumsier to use and/or more poorly implemented. The
difference between Perl and Scheme is far smaller than the difference
between C and Scheme or between C and Perl.
Jeff Bone writes:
> Abelson and Sussman is a bit broader book, and may well be the best
> general programming book in existance.
I think I agree. I'll have to check out Essentials of Programming
Languages. :)
-- <kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/> According to my medieval text in the seventh century a finalizer raised a dead object named Gorth who infected every computer in Cappidocia ending Roman rule in the region. -- Charles Fiterman on gclist@iecc.com