Why is Python popular, while Lisp and Scheme aren't?
Jacek Generowicz
jacek.generowicz at cern.ch
Sun Nov 10 07:04:52 EST 2002
David Garamond <davegaramond at icqmail.com> writes:
> one sentence: "syntax matters." for people in denial, make it two:
> "yes it really does."
Yes, it really does. The point that most people find difficult to
grasp is that Lisp's syntax is one of its huge strengths. (If you[*]
do not know what I mean by this, but are prepared to have your mind
expanded, then you might want to give Lisp a try. If you do not know
what I mean and are tempted to follow up with comments about the
abundance of parentheses, then don't bother; such discussions are
invariably fruitless. If you already know what I mean ... great.)
> or, rephrased: indentation and "1+1" scare people less than
> parentheses and "(add 1 1)" or something like that.
Sigh ...
jacek > clisp
[large startup message elided]
[1]> (+ 2 3)
5
Recently, I wrote a number-crunching program in Lisp. A typical
function in which look something like this:
(defun Hpp (x s z)
#i(sqrt(Vpp(x s z)-gamma)/(x^2+s^4) -
exp(sin(Tpp(x s))/(2*b1(x s)))))
(Incidentally, Lisp's _syntax_ made it possible for me to write a
macro which automatically re-structures my numerical functions in a
way which makes the program run 17 times faster.)
> but perhaps if lisp were invented thousands of years ago
Perhaps you last looked at Lisp thousands of years ago ...
> before math and the plus (+) operator...
Continuing the clisp session from above:
[2]> (/ 2 3)
2/3
[3]> (+ 1 2/3)
5/3
[4]> (sqrt -1)
#C(0 1)
Hmm ...
jacek > python2.2
Python 2.2.1 (#3, Jun 4 2002, 09:56:27)
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.sqrt(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: math domain error
>>> 2/3
0
>>> 1 + 2/3
1
... perhaps Python was invented before math and rational and complex
numbers (yes, I *do* know Python has complex numbers, just FUDding in
your style, yes I *do* know that integer division is Python is being
fixed).
Why, in my opinion, is Lisp less popular? There are a number of
reasons, but the most significant is probably that most people hear a
lot of lies about lisp, before they ever get to hear any of the truth.
Lisp is a slow, interpreted, purely-functional language, in which the
only datatype is the list, it needs specialst hardware to run on, is
solely responsible for the failure of AI, and died over a decade
ago. Right?
(Just in case anyone doesn't get it, _everything_ in the previous
paragraph is a lie.)
[*] Anyone reading this, that is.
More information about the Python-list
mailing list