Mark Tarver wrote: > How do you compare Python to Lisp? What specific advantages do you > think that one has over the other?
> Note I'm not a Python person and I have no axes to grind here. This is > just a question for my general education.
> Mark
I do not know much about Lisp. What I know is: Python is a imperative, object oriented dynamic language with duck typing, List is a declarative, functional dynamic language -> those two languages have different scopes.
"Mark Tarver" <dr.mtar...@ukonline.co.uk> writes: > How do you compare Python to Lisp? What specific advantages do you > think that one has over the other?
Paul Rubin wrote: > "Mark Tarver" <dr.mtar...@ukonline.co.uk> writes: > > How do you compare Python to Lisp? What specific advantages do you > > think that one has over the other?
seems to show that Python is a cut down (no macros) version of Lisp with a worse performance. The only substantial advantage I can see is that GUI, and Web libraries are standard. This confirms my suspicion that Lisp is losing out to newbies because of its lack of standard support for the things many people want to do.
> seems to show that Python is a cut down (no macros) version of Lisp > with a worse performance.
Performance claims are always controversial. So, Python is much slower doing array multiplication, when you hand roll it, instead of using the standard numerical packages available.
I see that the effbot has already responded the first part.
"Mark Tarver" <dr.mtar...@ukonline.co.uk> writes: > Paul Rubin wrote: > > "Mark Tarver" <dr.mtar...@ukonline.co.uk> writes: > > > How do you compare Python to Lisp? What specific advantages do you > > > think that one has over the other?
> seems to show that Python is a cut down (no macros) version of Lisp > with a worse performance. The only substantial advantage I can see is > that GUI, and Web libraries are standard. This confirms my suspicion > that Lisp is losing out to newbies because of its > lack of standard support for the things many people want to do.
> Mark
It is not just a newbie thing. Even people who are reasonably fluent in Lisp use Python for many tasks, and some make python the default with Lisp as a special case. It would probably be fair to say that the more you know about a variety of languages, the more you appreciate Python.
??>> seems to show that Python is a cut down (no macros) version of Lisp ??>> with a worse performance.
RB> Performance claims are always controversial. So, Python is much slower RB> doing array multiplication, when you hand roll it, instead of using the RB> standard numerical packages available.
heh, do you have "standard numeric packages" for everything? maybe then we'll make standard programs for everything -- that will obsolete "slow" "custom scripts" and we'll just use shell to select what program we want to run? certainly, it's possible to write code in C and use FFI to access it, but it's not suitable for rapid prototyping/fast development, when requirements may change, or you're just experimenting with different methods.
it's interesting than as of bare "interpreter overhead", python is aprox order of magnitude (10 times) slower than lisp interpreters. it's also interesting, that python, perl, php and ruby show very similar peformance, while lisp and scheme implementations show large improvements -- it makes me think that there's something "pathalogically scripting" in their specifications (maybe some obligatory use of strings for method dispatch?).
note that i've mentioned "lisp interpreters" above. as for lisp _compilers_, they run lots faster than lisp interpreters.
please check http://shootout.alioth.debian.org/ to compare Python to Lisp SBCL. lisp is faster more then 10 times in many benchmarks, and even more than 100 times faster in two benchmarks. unfortunately there's no lisp interpreters (CLISP) in the benchmark.
) (With-best-regards '(Alex Mizrahi) :aka 'killer_storm) "People who lust for the Feel of keys on their fingertips (c) Inity")
??>> seems to show that Python is a cut down (no macros) version of Lisp ??>> with a worse performance.
IA> or maybe it shows that Lisp is an obfuscated version of Python
hell no, lisp's syntax is much easier than python's since it's homogenous (and certainly lisp was invented much 30 years before Python, so that's Python uses Lisp features)
IA> with lots of parentheses,
that make logic more explicit
IA> backward logic,
??
IA> and complicated constructs that run faster.
no, there are no complicted constructs -- just it's designed with 30-year history in mind, not like "let's make another simple scripting language".
) (With-best-regards '(Alex Mizrahi) :aka 'killer_storm) "People who lust for the Feel of keys on their fingertips (c) Inity")
Mark Tarver wrote: > How do you compare Python to Lisp? What specific advantages do you > think that one has over the other?
Since the late 1950's Lisp has participated in the development of modern (present day) programming practises. It has shaped and been shaped by the minds of just not programmers, but people involved in dealing with the larger impacts and possibilities. Its been there, is here, and will continue to be there in the future. Lisp is a human construct that is a force to be reckoned with. Its construction reflects something very deep and fundamental about computing. So, it depends on what you want.
> heh, do you have "standard numeric packages" for everything? maybe then we'll make > standard programs for everything -- that will obsolete "slow" "custom scripts" and we'll > just use shell to select what program we want to run?
No, I was observing that, faced with a matrix multiplication problem, most sensible Python developers would do "apt-get install python-numeric" or equivalent. Trying to do it in pure Python would be the wrong tool for the job. If you think that's a weakness of Python compared to Lisp, then so be it.
Mathias Panzenboeck wrote: > Mark Tarver wrote: > > How do you compare Python to Lisp? What specific advantages do you > > think that one has over the other?
> > Note I'm not a Python person and I have no axes to grind here. This is > > just a question for my general education.
> > Mark
> I do not know much about Lisp. What I know is: > Python is a imperative, object oriented dynamic language with duck typing,
Yes, but Python also supports the functional style to some extent.
> List is a declarative, > functional dynamic language
Lisp is only a functional language in that it support both functional and imperative programming styles. Duck typing is almost identical to latent typing in Lisp. And, Common Lisp at least is object orientated.
> -> those two languages have different scopes.
Their scope is actually very similar. Learn about lisp and you will soon discover their similarity.
> it's also > interesting, that python, perl, php and ruby show very similar peformance, > while lisp and scheme implementations show large improvements -- it makes me > think that there's something "pathalogically scripting" in their > specifications (maybe some obligatory use of strings for method dispatch?).
"The most unusual features of the SBCL compiler (which is very similar to the original CMUCL compiler, also known as Python) is its unusually sophisticated understanding of the Common Lisp type system and its unusually conservative approach to the implementation of type declarations.
These two features reward the use of type declarations throughout development, even when high performance is not a concern. Also, as discussed in the chapter on performance (see Efficiency), the use of appropriate type declarations can be very important for performance as well."
Mark Tarver wrote: > This confirms my suspicion > that Lisp is losing out to newbies because of its > lack of standard support for the things many people want to do.
Whoa there, that's a pretty big logical jump there, don't you think?
Consumer choice can never be boiled down to one thing; there are so many factors. No one knows the whole answer. I certainly don't. (If I did, I'd be courteously turning down the Nobel Prize for Economics on account of being so rich I really didn't need the extra pocket change.)
I have no doubt that what you say is a contributing factor, but if I had to guess the main reason why Lisp is losing out to newbies, I'd say it's first impressions. When newbies see Python they say, "Ok, I can kind of follow that, it doesn't look too hard to learn." When they see Lisp they say, "WTF IS THAT???"
It's kind of sad, in a way, that a superficiality would be so crucial. (Not that I think outward appearance is all superficial--I think humans have evolved and/or learned to regard as beautiful that which minimizes effort--but it's not the whole story and not basis for a whole judgment.)
One overlooked advantage for Lisp over Python is a better development environment, for me that means Slime for Lisp. For Python I have several years of experience with IDLE and the win32 Ide, and Slime is the winner. Press a key and the function you are editing is recompiled and loaded into memory. The crossreference and the object inspector is very nice. How about fuzzy-complete, I only have to write de-me and press tab, and I get define-method-combination. Slime coupled with the paredit structured editing mode, which lets you edit Lisp code as list structure rather than characters, is a dream.
Pythons advantages are:
Faster startup-time which makes it a good scripting language.
More platforms, there is no Common Lisp on Nokia phones.
Some clever details, like using minus to index vectors from the right. (aref "hello" -1) gives an error on Lisp, but the character o on Python.
Another detail I like is that you can choose how to quote strings, in Python you can write three double-quotes to start a string that can include anything, quotes, doublequotes and newlines. You can use double-quote if you want to embed single-quotes "john's" or single-quote if you want to embed double-quotes '<id="2">'.
Talking about Lisps advantages will take me too long.
Alex Mizrahi wrote: > (message (Hello 'Istvan) > (you :wrote :on '(8 Dec 2006 06:11:20 -0800)) > (
> ??>> seems to show that Python is a cut down (no macros) version of Lisp > ??>> with a worse performance.
> IA> or maybe it shows that Lisp is an obfuscated version of Python
> hell no, lisp's syntax is much easier than python's since it's homogenous
It sure is easier... if you're a compiler rather than a human. Also a lightbulb is much easier understood as a bunch of homogeneous elemental particles.
> Some clever details, like using minus to index vectors from the right. > (aref "hello" -1) gives an error on Lisp, but the character o on Python.
It would not be difficult to add this feature to Lisp.
> Another detail I like is that you can choose how to quote strings, in > Python you can write three double-quotes to start a string that can > include anything, quotes, doublequotes and newlines. > You can use double-quote if you want to embed single-quotes "john's" or > single-quote if you want to embed double-quotes '<id="2">'.
You could add a reader macro in Lisp that allows you to do the same. At the moment I would say that one could pretty much add most Python features to Lisp. Be it slicing, list comprehension, or, if one wants, Pythons object system.
On the other hand can I see difficulties in adding macros to Python, or inventing a new object system, or adding new keywords without changing the sources of Python itself.
Bjoern Schliessmann <usenet-mail-0306.20.chr0n...@spamgourmet.com> writes: > Can you give an example? I cannot imagine how homogenity always > results in easiness.
Petter -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
"Mark Tarver" <dr.mtar...@ukonline.co.uk> writes: > How do you compare Python to Lisp? What specific advantages do you > think that one has over the other?
> Note I'm not a Python person and I have no axes to grind here. This is > just a question for my general education.
> Mark
What was the reasoning behind cross-posting this to c.l.p and c.l.l? This type of question inevitably leads to controversy.
André Thieme wrote: > On the other hand can I see difficulties in adding macros to Python, > or inventing a new object system, or adding new keywords without > changing the sources of Python itself.
Actually, an even bigger difficulty is the rejection of programmable syntax by Guido, both for the near and distant future:
"Programmable syntax is not in Python's future -- or at least it's not for Python 3000. The problem IMO is that everybody will abuse it to define their own language. And the problem with that is that it will fracture the Python community because nobody can read each other's code any more."
KS> If you'd read the docs of the tools you admire you might find the KS> answers yourself.
SBCL is a COMPILER that explains everything. it's interesting why INTERPRETER like CLISP is faster. well, it can be type declarations as well, but maybe something other too..
for example, in languages like Python, PHP and JavaScript, as i understand, by semantics of the language interpreter MUST use dict to call objects method -- at any time it can be changed, for any object instance. i'm not sure whether it has to dynamically resolve package's methods doing lookup in packages dict.
however, in Common Lisp object methods are dispatched on object types, that is a special language entity, so as long as new types are not introduced, interpreter can optimize calls how it wants to. the difference is that while it's still dynamic, dispatch over types are more controlled/optimizable than dispatch using dict. then, symbols in common-lisp package cannot be changed according to spec, thus compiler/interpreter is safe to do optimizations it wants when sees that symbols (if we want symbols with same names, we can make other package with them).
then, Common Lisp standard defines what inlining is. i bet most optimizations in dynamic languages are not possible if inlining is not enabled -- since any symbol that is not inlined can change it's meaning in any time.
) (With-best-regards '(Alex Mizrahi) :aka 'killer_storm) "People who lust for the Feel of keys on their fingertips (c) Inity")
The purpose of this page is to help those new to Lisp (aka. "newbies") gain some background before they enter the fray of comp.lang.lisp (c.l.l). This is not a complete Lisp FAQ! Once you have a sense of Lisp
and of how c.l.l operates you should have no trouble finding all the additional information you need, either by your own search efforts or by asking the community. If you have issues with any of the below please do not send me email. Rather, post on c.l.l in the weekly thread
where this is announced (heading: "*** C.L.L README/FAQ ***").