merits of Lisp vs Python

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Sat Dec 9 12:24:43 EST 2006


On Sat, 09 Dec 2006 14:00:10 +0000, Timofei Shatrov wrote:

> On Sat, 09 Dec 2006 20:36:02 +1100, Steven D'Aprano
> <steve at REMOVE.THIS.cybersource.com.au> tried to confuse everyone with this
> message:
> 
>>On Fri, 08 Dec 2006 23:38:02 -0800, Wolfram Fenske wrote:
>>
>>> if Common Lisp didn't have CLOS, its object system, I could write my own
>>> as a library and it would be just as powerful and just as easy to use as
>>> the system Common Lisp already provides.  Stuff like this is impossible
>>> in other languages.
>>
>>Dude. Turing Complete. Don't you Lisp developers know anything about
>>computer science?
> 
> Here, you've basically shot yourself in the ass. Appealing to Turing
> completeness when talking about programming language features is about the
> dumbest thing you can make. In Turing sense, a program is simply a function that
> takes an argument and returns a value. It doesn't say anything about how this
> function was implemented. It could be Turing machine, lambda calculus, Markov
> chains or whatever else. All these methods produce the same set of programs, but
> that doesn't mean you could implement lambda in Turing machine for example.

What exactly are you trying to say here? Is this a comment about the
relative practicality of writing code in a Turing machine versus
high-level languages, or are you implying that lambda calculus is "bigger"
than any Turing-complete language?

If you're talking about practicality, then of course you're correct, not
all languages are equally expressive. Some languages are not expressive
enough. Some languages are too expressive. No language is optimal for all
people for all tasks.


> Is is time for someone to read his computer science books again?

Probably. Would you like to borrow mine?

Look, all snarkiness aside, it just isn't true that "stuff like this is
impossible in other languages". If Wolfram Fenske had said "stuff like
this isn't easy in many other languages" he would have been right. And if
he had said "and stuff like this carries risks as well as benefits" he
would have come across as less of a language fanatic.

One of the risks with Python is the ease with which you can modify the
built-ins. An expression like list(2, 3, 4) doesn't necessarily create a
list from 2, 3, and 4, because the built-in list could be redefined.
(In practice, that's not often a real problem, because experienced
Python developers simply learn not to needlessly or confusingly shadow
built-ins. It's not the best system, but it works well enough in
practice.) But at least the basic syntax and keywords of the language are
known to be constant. 

With Lisp macros, even that isn't guaranteed. Now, if Lispers would say
"Oh yes, macros give you great power, and with great power comes great
responsibility. Be careful." then, no doubt, we'd take you guys more
seriously. But we don't hear that -- we hear Lispers going on and on about
how great it is that they can easily redefine every corner of the
language. Do you blame people for *believing them* and imagining that
reading Lisp code is like following some ghostly will-o-the-wisp across a
swamp, where nothing is what it seems and the landscape is forever
shifting?

Now, if you want to tell me that, despite all the talk, Lisp coders don't
actually create new syntax or mini-languages all that often, that they
just use macros as functions, then the question becomes: why do you need
macros then if you are just using them as functions? Why not use functions?


-- 
Steven.




More information about the Python-list mailing list