473,775 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

merits of Lisp vs Python

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

Dec 8 '06
852 28723

Paul Rubin wrote:
"mystilleef " <my********@gma il.comwrites:
Slow for users who aren't familiar with Psyco, Pyrex and C extensions,
sure.


Anyway it's pretty lousy advocacy for a language to say "well if the
language is too slow, don't use it, use another langauge like C instead".
Python can be used as a glue language. It is not solely a glue
language.
A lot of people find using Python to script libraries written in other
languages
a way to get things done. Ask the scipy guys or the biopython guys.
The Python community actively encourages groups writing useful
libraries
to maintain a Python port, or Python users might wrap libraries
themselves.

You don't always wrap a module in Python for reasons of speed of
execution.
Software testing may well be easier to do in Python than in the
native language of the wrapped library. The library itself may be
better
used in the dynamic environment of Pythons command line; or used
together
with other libraries already wrapped for/accessible from Python.

- Paddy.

Dec 10 '06 #211
mystilleef wrote:
John Thingstad wrote:
>You are just being silly.
Lisp's OO environment CLOS is vastly superior to Python classes.
Both in terms of expressive power and flexibility.
You might even find out if you ever learnt how to use it.

Donkeys have wings.
And thus you think you can fly?
>In the windows world the best way to access system libraries are
via .NET. Thus each language inventing it's own libraries is quickly
becoming

You're only proving my point. Why do you think most windows developers
use .NET?
I didn't realize .NET is a *language*.
>Python is fine if you approach programming as Lego, simply gluing together
libraries.

You mean it's fine for what 90% of programmers do?
>But if you want to do some serious algorithmic's you may find that it is
just to slow.

Slow for users who aren't familiar with Psyco, Pyrex and C extensions,
sure.
Dec 10 '06 #212
On Sun, 10 Dec 2006 01:29:43 +0100, Steven D'Aprano
<st***@REMOVE.T HIS.cybersource .com.auwrote:
>

Oh my god! Lisp can echo STRINGS to the interpreter???? Why didn't
somebody somebody tell me that!!!! That *completely* changes my mind
about
the language!

I'm especially impressed that it knew I wanted them printed in uppercase
without being told.
Except it is not a string. It is a list of symbols. Hence the upcase.
"This is how you write a string in Lisp"
and that does preserve case.
(If you want symbols to be case sensitive and default case to be lower
then most
Lisp's allow that, but the ANSI spec dosn't give a standard way.)

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Dec 10 '06 #213
Paul Rubin <http://ph****@NOSPAM.i nvalidwrites:
"Kaz Kylheku" <kk******@gmail .comwrites:
Lisp just seems hopelessly old-fashioned to me these days. A
modernized version would be cool, but I think the more serious
Lisp-like language designers have moved on to newer ideas.
What are some of their names, and what ideas are they working on?

http://caml.inria.fr
http://www.haskell.org
Aren't these "old-fashioned" and boring as well?

/Jon

--
'j' - a n t h o n y at romeo/charley/november com
Dec 10 '06 #214
On Sat, 09 Dec 2006 21:55:19 +0000, Kirk Sluder wrote:
The question I have is why do critics
single out macros and not other forms of abstraction such as
objects, packages, libraries, and functions?
Who says they do? All forms of abstraction have been criticized. Sometimes
the criticism is valid. Sometimes it warns against abuses of the
abstraction. Just because a feature is useful sometimes doesn't
necessarily mean the benefit outweighs the cost.

just as an example:
from foolib import *
bar.bar("somefi le")

What does this program do? I have no idea. Its functionality is
hidden behind multiple layers of abstraction (function, object,
library.)
Sure.

But at least you know that foolib is a module or package. You know what
from and import do, and that can't change. And you know that bar is an
object with a method also called bar, it is being called, and the
argument is a string "somefile". Those things can't change. Imagine a
hypothetical language where those two lines could mean *anything*.

Rightly or wrongly, people fear that Lisp's macros push Lisp closer to
that hypothetical anything-goes language than is healthy. Maybe that's a
problem of perception rather than a problem of fact, but you have to ask,
why do people perceive Lisp that way?

Could it be because of people like J Shrager who writes things like this?

"Can't you just expand the language via macros to create whatever facility
of this sort [major new features with new syntax] you need..."

(This thread, dated 8 Dec 2006 16:14:44 -0800)

Or Wolfram Fenske:

"All the interesting features that haven't originated from Lisp (e. g. OO
from Smalltalk) could in turn easily be implemented in Lisp with a couple
of macros."

(This thread, dated 8 Dec 2006 23:38:02 -0800)

To someone outside of Lisp, that looks like "I can make Lisp look like any
language I like in just a few lines." And that implies that to read a Lisp
program, one might need to be able to read code that looks like Lisp, or
Smalltalk, or Prolog, or Fortran, or all of those, or whatever bizarre
syntax the developer wanted it to look like.

My point isn't whether or not their claims are correct (a "couple" of
macros? really?) but that things like this feed the perception that Lisp
is close to that hypothetical language where anything could be anything.
If anything could be anything, do you really know what (+ 1 2) means
without reading every line of code?

And it isn't really that much comfort to be told that good Lisp
developers know not to do stupid things with macros. Sure. But in the real
world of programming, most developers aren't good developers, they are
merely average -- in fact fifty percent of them are below average. And
the bottom 30% can't be trusted with facilities like Lisp's macros,
because they WILL do stupid things with them and turn your code base into
a morass of shifting syntax, buggy DSLs and other maintenance nightmares.
The damage they can do with operator overloading is minor by comparison.

Even something simple like file I/O can be abused. Example: I've seen
*real* code where somebody needed a dict with ten million keys. (Well, he
thought he needed that dict, I never worked out exactly why. Maybe he
thought he was pre-allocating memory as an optimization.) So he started
off with something like this:

def make_dict():
mydict = {}
mydict[0] = 0
mydict[1] = 0
mydict[2] = 0

and realised that it would take him forever to write that much code. So
he wrote a C program to create the make_dict function for him! Translated
into Python:

def make_dict_facto ry():
code = open('makedict. py', 'w')
code.write("def make_dict():\n" )
code.write(" mydict = {}\n")
for i in range(10000000) :
code.write(" mydict[%d] = 0\n" % i)
code.write(" return mydict\n")
code.close()
from makedict import make_dict
return make_dict

(This is an interesting demonstration that any language that allows file
I/O and importing of external program files can always treat functions
as data, even if the language doesn't directly support it. An alternative
would be to keep the strings in memory instead of writing to a module,
then use exec on them instead of importing the module.)

Honest to god, the code really was like that! Maybe I've got the precise
details wrong, it was a long time ago, but if it wasn't just as I've got
it, the consequences were the same: he built a single function that was so
large that loading it caused his machine to thrash for twenty minutes
trying to free enough memory.

Is that an argument against factory functions? Damn straight it is:
they are a powerful tool, and in the hands of morons, they can be
dangerous. Does that mean that languages shouldn't permit higher-order
functions? Not necessarily: all programming tools can be misused, but some
can be misused more easily than others. Power and risk is often a
trade-off, and language designers can't eliminate all risk of stupid
behaviour, but they can design the language to allow whatever level of
risk they believe is acceptable. (E.g. there is no doubt that C's raw
pointers are powerful, but many languages deliberately don't use them.)

The risk of stupid factory functions is small compared to the benefit, but
maybe there is some domain somewhere where the ideal solution is a
language that DOESN'T treat functions as first class objects, deliberately
weakening the language so that a particular class of errors (or stupid
behaviour) just cannot happen. But that language isn't Python.

When it comes to Lisp's macros, the perception is that the power is
correspondingly greater, and the risk of abuse even more so. The safe
examples of what macros can be used for don't seem to provide any
over-whelming advantage (that's not to say they provide NO advantage,
merely that if you use macros safely, the advantage seems small, but if
you use them to their full potential, the risk of abuse is too high).
That's the perspective of many people, and maybe it is wrong. Maybe you
really need to be immersed in Lisp for a while to see the advantages of
macros.

Or maybe it is only an advantage while Lisp programmers are a
self-selected group of above-average skill. Wait until fifty million VB
code monkeys start writing Lisp macros and maybe, just maybe, you'll wish
they were using a less powerful and more restrictive language.

--
Steven.

Dec 10 '06 #215
"tac-tics" <ta*******@gmai l.comwrites:
I think the lesson here is that LISP is the language you use when you
want mathematical elegance and perfection and Python is the language
you use if you want to actually program stuff.
That's really a misperception. Lisp is extremely pragmatic in
addition to traditionally having more mathematically oriented
developers and users. There is a saying that Lisp is a ball of mud;
you can throw whatever you want into it and it's still Lisp. Python's
current implementations and the supposedly fancy Python applications
that I've heard of are toys compared to what's been done in Lisp even
on the much smaller machines of decades gone by.

What I'd say is that the most interesting period of Lisp development
was probably the 1970's and 1980's, trailing off into the beginning of
the 1990's. Since then Lisp has gotten kind of stultified, although
one of the cll posters claims there's now a revival going on (maybe
true). It seems to me that many Lisp users and developers moved on to
the ML family in the 1990's and maybe have been moving from ML to
Haskell in more recent times.
Dec 10 '06 #216
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
NOBODY expects the Lispers Inquisition!
Our chief weapon is age... age and macros...
....macros and age.
Our two weapons are age and macros....
And mathematical rigour...
Our THREE weapons are age, macros, and mathematical rigour...
....And an almost fanatical belief in Lisps superiority.
Our *four* ...no.
AMONGST our weapons...
Amongst our weaponry...
....Are such elements as fear, surprise.... I'll come in again.

Python is fun to use.
Easy to read.
Simple and powerful.
Easy to test.
Easy to maintain.
Fast. Very fast!

- Paddy.
..

Dec 10 '06 #217
"Paddy" <pa*******@nets cape.netwrites:
Python can be used as a glue language. It is not solely a glue
language.
A lot of people find using Python to script libraries written in other
languages
a way to get things done. Ask the scipy guys or the biopython guys.
Sure, connecting together programs and libraries that were written in other
languages is what a glue language is.
You don't always wrap a module in Python for reasons of speed of
execution.

Software testing may well be easier to do in Python than in the
native language of the wrapped library. ...
That's the thing, those modules are written in languages other than
Python because Python is not attractive for coding those functions
directly in Python. That is a real weakness of Python and glossing
over it by saying to write the functions in other languages and then
wrap them in the C API is not a very impressive answer. For example,
Lisp is routinely used for writing scientific and numerical code
directly with performance comparable to C or whatever. There is no
need to mess with wrapping modules written in other languages, an
operation which should not be trivialized.
Dec 10 '06 #218
jayessay <no****@foo.com writes:
http://caml.inria.fr
http://www.haskell.org

Aren't these "old-fashioned" and boring as well?
Maybe not bleeding edge, but more modern than CL in my opinion.
Dec 10 '06 #219
Bill Atkins wrote:
And mistakes in nesting show up as mistakes in
indenting.
Er, hang on a moment... how do you *know* when you've
got a mistake in indending? You must be visually
verifying the indentation... rather like one does
with Python code...

--
Greg
Dec 10 '06 #220

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2188
by: Paddy3118 | last post by:
This month there was/is a 1000+ long thread called: "merits of Lisp vs Python" In comp.lang.lisp. If you followed even parts of the thread, AND previously used only one of the languages AND (and this is the crucial bit), were persuaded to have a more positive view of the other language; (deep breath, this is a long, as well as grammatically incorrect sentence), THEN WHY NOT POST ON WHAT ARGUMENTS PERSUADED YOU.
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10268
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10107
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10048
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.