Why is Python popular, while Lisp and Scheme aren't?

Alex Martelli aleax at aleax.it
Mon Nov 11 04:45:50 EST 2002


Ian Bicking wrote:

> On Sun, 2002-11-10 at 09:27, Alex Martelli wrote:
>> Surprise, surprise: the language that's always itself, always well
>> designed, is popular; the languages that anybody can change arbitrarily
>> aren't.
> 
> I think you underestimate the ability to mess with Python.  You can make
> weird things in Python by using the magic methods, things which act in

You can, but there is generally little motivation: you cannot add a
case statement, nor a repeat/until, nor a mandatory declaration for
all variables, nor braces as block delimiters, nor just about any of
the other zillion better-done-without things that people are SO keen
and used to from other languages.  (You can't even add the few ones
that WOULD be worthwhile, such as case-insensitivity [ducks for
cover]...).

So, I'm not underestimating the _possibility_ of doing havoc with
Python -- I'm just saying that the kind of havoc you can wreck with
reasonable ease is basically not the kind that newbie crave.  Macros,
on the other hand, are tailor-made for playing exactly that kind
of havoc;-).

Hmmm, on a slightly different tack, this DOES help me articulate one
source of my slight reluctance to get really deep into Ruby: Ruby
gives the programmer just a little bit MORE dynamicity/flexibility/
power than Python, by messing with the fundamentals of built-ins and
passing "unevaluated code blocks" to methods (that's how you do
iterators in Ruby, while Python's iterators are utterly different) --
although that's still not a full-fledged macro system, I may be
subconsciously worrying that the little extra power IS just enough
to get into "newbie cravings" territory.  Maybe I'm worrying too
much, mind you; however, I hope that sharing this reflection can
help you see my overall position that more power and flexibility
need NOT be a good thing for a language's acceptance and actual
productivity-gain for production programming.  When the power is
enough to entice many users to develop their own dialects, in order
to satisfy their cravings for syntax sugar resembling their old
habits, then I definitely think it's NOT a good thing any more.


> unexpected ways.  It *is* true that these aren't syntactic additions,
> but Lisp doesn't have significant syntactic additions either -- macros
> change the semantics, but the ()'s are still there and are always parsed
> the same way.  The semantics of execution just get messed with.

If the macros are powerful enough to let you have infix notation,
then it just can't be true that there aren't significant syntactic
additions, that the parentheses are still there, etc.  Infix comes
with the concept of precedence, so that e.g. 
    a + b * c + d
parses utterly differently from
    a * b + c * d
"Precedence" IS a significant syntactic addition, and lets you AVOID
parentheses -- if you have to fully parenthesize the above cases,
you can't really claim with honesty that you have infix-notation (in
some technical way it might be true, but it's not what the infix
notation lovers MEAN;-).


> It may be true that Lisp fails to respond to users needs because macros
> are a good excuse.  Prefix notation may not be good, but many people

Actually that's the ONLY reason I'd like to have macros in Python --
fobbing off the unceasing stream of requests for silly things such
as repeat/until etc etc by showing macros for them, rather than having
to try to explain to newbies that if Python had all the silly little
extras that SOME newbie wants, it wouldn't be Python any more, but
rather a huge blob of a language bereft of architectural unity of
vision, of simplicity, of leanness.

But I guess the discipline of having to explain this over and over
is good for me, just as the hurdle of having to GET it is good for
the newbies.  So, my occasional whimsical wish for a way to "fob
off" such unappropriate requests for changes to Python is to be
taken as no more than just that, a whim;-).


Alex




More information about the Python-list mailing list