473,775 Members | 2,625 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
Mathias Panzenboeck <e0******@stude nt.tuwien.ac.at writes:
I currently visit a course about functional programming at the
university of technology vienna: python implements only a small
subset of things needed to be called a functional language (list
comprehension). but yes, for a imperativ oop language python is
very close to functional.
List comprehensions are just fairly trivial syntax sugar. The essence
of functional programming is being able to construct new functions on
the fly, and Python does that. See Hughes' paper "Why functional
programming matters" and imagine doing the examples in Python vs. doing
them in Java.
Dec 9 '06 #201
Paul Rubin <http://ph****@NOSPAM.i nvalidwrites:
Bill Atkins <at****@rpi.edu writes:
>Lest anyone interpret that list as exhaustive: http://www.cl-user.net/

What have you got for concurrency? How would you write a
multi-threaded web server in Lisp?
Multithreading is not a standard part of ANSI CL, but in practice all
Lisps (with the major exception of the CLISP implementation) support
threading.

Hunchentoot is, in fact, a multi-threaded web server written in Lisp.
:) There are also others, like AllegroServe and Araneida.

There are compatibility layers that smooth over some of these
implementation-dependent areas of Common Lisp. Bordeaux-threads is
the package that provides a common interface to the different
threading implementations :

http://trac.common-lisp.net/bordeaux...iDocumentation
Dec 9 '06 #202
On Sat, 09 Dec 2006 22:29:45 +0100, John Thingstad wrote:
>Maybe so. But I've only ever appreciated its functional aspects. I
wouldn't choose Lisp or its derivatives for OO related tasks even if
I'm high.

You are just being silly.
Lisp's OO environment CLOS is vastly superior to Python classes.
Both in terms of expressive power and flexibility.
Oh, well, with evidence like that, I'm convinced!

Python is fine if you approach programming as Lego, simply gluing
together libraries.
But if you want to do some serious algorithmic's you may find that it is
just to slow.
Nobody ever said that Python was idea for serious number crunching
(although see numpy -- use the right tool for the job). If I knew what
sort of "serious algorithmics" you meant, I could comment.
--
Steven.

Dec 9 '06 #203
On Sat, 09 Dec 2006 13:50:24 -0800, Kaz Kylheku wrote:
Steven D'Aprano wrote:
>But Lisp's syntax is so unlike most written natural languages that that it
is a whole different story.

Bahaha!
>Yes, the human brain is amazingly flexible,
and people can learn extremely complex syntax and grammars (especially if
they start young enough) so I'm not surprised that there are thousands,
maybe tens or even hundreds of thousands of Lisp developers who find the
language perfectly readable.

1'(especially if they start young enough)
(ESPECIALLY IF THEY START YOUNG ENOUGH)
2(sixth *)
ENOUGH

... said!

Yeah, so /unlike/ written natural languages!

What a fucking moron.

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.

--
Steven.

Dec 9 '06 #204
Ken Tilton schrieb:
The last time we went thru this a Pythonista finally said, Oh, I get it.
These five lines of code I have to write all the time (two setup, one
func call, two cleanup) can be collapsed into one or two. The thread
will be hard to miss in Google groups (two years back?) and the epiphany
appears right at the end of the thread. <hint>
Functional programming is the solution here, not Lisp.

You could make that with a new function (in Python), that takes a
function (and its args, don't remember the correct syntax).

def foo(function, args):
setup(1)
setup(2)
function(args)
cleanup(1)
cleanup(2)
The nice thing in Lisp would now be to save a lambda with the macro.
In Python one would fill the name space with throw away functions that
get called only one time.
André
--
Dec 10 '06 #205
In article <7x************ @ruckus.brouhah a.com>,
Paul Rubin <http://ph****@NOSPAM.i nvalidwrote:
>
I think an editing program that balances parens automatically is near
indispensibl e for writing Lisp code. I can't stand writing Lisp
without Emacs.
And that is why I will never write Lisp. I loathe Emacs.
--
Aahz (aa**@pythoncra ft.com) <* http://www.pythoncraft.com/

Member of the Groucho Marx Fan Club
Dec 10 '06 #206
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.

Dec 10 '06 #207


André Thieme wrote:
Ken Tilton schrieb:
>The last time we went thru this a Pythonista finally said, Oh, I get
it. These five lines of code I have to write all the time (two setup,
one func call, two cleanup) can be collapsed into one or two. The
thread will be hard to miss in Google groups (two years back?) and the
epiphany appears right at the end of the thread. <hint>


Functional programming is the solution here, not Lisp.
No, you do not understand. The Pythonista figured it out: a function
would not do.
>
You could make that with a new function (in Python), that takes a
function (and its args, don't remember the correct syntax).

def foo(function, args):
setup(1)
setup(2)
function(args)
cleanup(1)
cleanup(2)
The nice thing in Lisp would now be to save a lambda with the macro.
In Python one would fill the name space with throw away functions that
get called only one time.
Omigod. Is that what you meant? You think macros are unnecessary because
one could hard-code their expansions as separate functions? And that
would constitute hiding the boilerplate? What happens when the
boilerplate changes? <game over>

ken

--
Algebra: http://www.tilton-technology.com/LispNycAlgebra1.htm

"Well, I've wrestled with reality for thirty-five
years, Doctor, and I'm happy to state I finally
won out over it." -- Elwood P. Dowd

"I'll say I'm losing my grip, and it feels terrific."
-- Smiling husband to scowling wife, New Yorker cartoon
Dec 10 '06 #208
Ken Tilton schrieb:
>

André Thieme wrote:
>Ken Tilton schrieb:
>>The last time we went thru this a Pythonista finally said, Oh, I get
it. These five lines of code I have to write all the time (two setup,
one func call, two cleanup) can be collapsed into one or two. The
thread will be hard to miss in Google groups (two years back?) and
the epiphany appears right at the end of the thread. <hint>


Functional programming is the solution here, not Lisp.

No, you do not understand. The Pythonista figured it out: a function
would not do.
What do you mean?
>You could make that with a new function (in Python), that takes a
function (and its args, don't remember the correct syntax).

def foo(function, args):
setup(1)
setup(2)
function(args)
cleanup(1)
cleanup(2)
The nice thing in Lisp would now be to save a lambda with the macro.
In Python one would fill the name space with throw away functions that
get called only one time.

Omigod. Is that what you meant? You think macros are unnecessary because
one could hard-code their expansions as separate functions? And that
would constitute hiding the boilerplate? What happens when the
boilerplate changes? <game over>
Well, macros are unnecessary from a mathematical point of view: 0 and
1 are enough. But of course they have the potential to be a real time
saver. What I want to say is: the situation you gave as an example is
not the place where macros shine, because 1st class functions can take
over.

You could maybe give another example: how would one realize something
like (memoize function) in Python?
Or (defmethod name :after ..)?
André
--
Dec 10 '06 #209


André Thieme wrote:
Ken Tilton schrieb:
>>

André Thieme wrote:
>>Ken Tilton schrieb:

The last time we went thru this a Pythonista finally said, Oh, I get
it. These five lines of code I have to write all the time (two
setup, one func call, two cleanup) can be collapsed into one or two.
The thread will be hard to miss in Google groups (two years back?)
and the epiphany appears right at the end of the thread. <hint>

Functional programming is the solution here, not Lisp.


No, you do not understand. The Pythonista figured it out: a function
would not do.


What do you mean?
I am saying use Google groups to find the thread and find out the use
case contributed by a Pythonista in the midddle of a similar thread that
conveyed to his satisfaction the value of macros.

ken

--
Algebra: http://www.tilton-technology.com/LispNycAlgebra1.htm

"Well, I've wrestled with reality for thirty-five
years, Doctor, and I'm happy to state I finally
won out over it." -- Elwood P. Dowd

"I'll say I'm losing my grip, and it feels terrific."
-- Smiling husband to scowling wife, New Yorker cartoon
Dec 10 '06 #210

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
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...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.