473,815 Members | 1,753 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 28841
jo************@ hotmail.com wrote:
What it isn't is some kind of miraculous invention that saves
programmers from ever making mistakes that are common in other
languages, or that reduces effort in copy-paste, as Bjoern seemed
to be claiming.
I didn't. I just stated that the Python way is less work for me.

Regards,
Björn

Xpost cll,clp

--
BOFH excuse #112:

The monitor is plugged into the serial port

Dec 14 '06 #671
Warning: absolutely off topic!

At Thursday 14/12/2006 08:02, Christophe wrote:
>Well, I spent some time on Wikipedia looking up metric systems and
things like that because of you, and I found a page that shows how to
improve the current SI system by reducing the number of fundamental
units to only two ( S for space and T for time ), and it was a great
read. It even went so far as give a theory for the disapearance of the
dinosaurs!
You can even make S = cT (c=ligth of speed in void space).
The choice of fundamental units is rather arbitrary, and can be
reduced further to only 1 fundamental unit and even NO fundamental units.
There is a nice book about this subject by L. A. Sena: Units of
physical quantities and their dimensions (or similar, I don't have it
at hand to check the title).
--
Gabriel Genellina
Softlab SRL

_______________ _______________ _______________ _____
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
Dec 15 '06 #672
Ken Tilton wrote:
Andrew Reilly wrote:
That all looks like data.

No, not reverse, the part you did not understand. I do not mean what the
code was doing, I meant that it was code.
Code is data is code - even in Python:

skills_table = [
{
"title": "Absolute Value",
"annotation s": ["Bleah bleah", "ho hum", "etc..."],
"hints": ["and so on", "etc..."],
"reverse" : (lambda x: whatever(x))
},
{
"title": "Square Root",
"annotation s": ["Bleah bleah", "ho hum", "etc..."],
"hints": ["and so on", "etc..."],
"reverse" : (lambda x: someother(x))
},
# etc...
]

Of course those lambdas are crippled in Python (and not really
necessary in this bogus example)... But that's without trying to be
clever:

class AbsoluteValue:
title="Absolute Value"
annotations=["Some list", "goes here"]
@classmethod
def reverse(cls, *args):
# I didn't understand what your code was doing
pass
defskill(Absolu teValue)

That would be a reasonable place for a "pie decorator" on a class, but
I guess that's not allowed. I doubt this second example would be
considered "Pythonic" in any case...

Couldn't you do that with a table
containing those fields, and key it off the defskill argument (or even the
title?) at startup?

Not the code. In reverse.
Why not?

Python has plenty of other flaws that I can't happily work around, and
I do think Lisp is more flexible. However, I think your example is
readable enough with a data driven algorithm in most any popular
language. All of the data is visible to the reverse(...) method.
Maybe I missed something in your example, but I think you aren't trying
hard enough. :-)

The one I liked was: http://ll1.ai.mit.edu/shriram-talk.pdf

If I ever fill in your RtL survey, I'll be citing that one as a turning
point for me.

>
Interpolation does not mean what you think it means.
I'm sure he meant "string interpolation", which is a common enough term
in scripting languages nowdays.

It would be easier to compare and
contrast with the Python equivalent if someone had posted such, but your
troops have fallen back to Fort So What? and pulled up the drawbridge.
Oh God! Is it just me out here? And I'm not even a believer.

Cheers.

Dec 15 '06 #673
Ken Tilton <ke*******@gmai l.comwrites:
Steven D'Aprano wrote:
If that's the best example of what macros can be used for, frankly I'm
unimpressed.

We're shocked.
Don't anyone tell him about LOOP.

--
This post uses 100% post consumer electrons and 100% virgin photons.

At 2.6 miles per minute, you don't really have time to get bored.
--- Pete Roehling on rec.motorcycles

I bump into a lot of veteran riders in my travels.
--- David Hough: Proficient Motorcycling
Dec 15 '06 #674
"Wolfram Fenske" <in***@gmx.netw rites:
Paul Rubin <http://ph****@NOSPAM.i nvalidwrites:
"Wolfram Fenske" <in***@gmx.netw rites:
Yes, I wrote about it in another post. It was introduced in Python
2.5. And if it hadn't been I'd still have to write code like this.
You could do something with decorators that's not too bad. You'd end
up writing:

@withConnection
def some_func():
do_whatever_stu ff ()

Yes, now I can. But I had to wait until Python 2.4 to be able to
that. What I like so much about Lisp macros is that they allow me to
make these changes myself.
Besides, who wants to write production code in a language that keeps
changing? It's enough work just keeping up with new libraries.

--
This post uses 100% post consumer electrons and 100% virgin photons.

At 2.6 miles per minute, you don't really have time to get bored.
--- Pete Roehling on rec.motorcycles

I bump into a lot of veteran riders in my travels.
--- David Hough: Proficient Motorcycling
Dec 15 '06 #675
Steven D'Aprano <st***@REMOVE.T HIS.cybersource .com.auwrites:
How am I being silly? Do you not believe that people write case blocks
with fifty tests? Okay, how about twenty? Ten? Eight?
You should check out generic functions in CLOS. Rather than writing a
ridiculously long case block, you can use EQL specialized functions.
It's a great way to do dispatch.

--
This post uses 100% post consumer electrons and 100% virgin photons.

At 2.6 miles per minute, you don't really have time to get bored.
--- Pete Roehling on rec.motorcycles

I bump into a lot of veteran riders in my travels.
--- David Hough: Proficient Motorcycling
Dec 15 '06 #676
Gabriel Genellina wrote:
You can even make S = cT (c=ligth of speed in void space).
The choice of fundamental units is rather arbitrary, and can be reduced
further to only 1 fundamental unit and even NO fundamental units.
I once heard mention of a system of units in use at
one time with the odd feature that capacitance came
out in units of length.

Picture the scene: Hobbyist walks into Dick Smith
store and says "I'd like a 5cm capacitor, please."

--
Greg
Dec 15 '06 #677
Ken Tilton wrote:
So this:
(defmethod tf-reverse (id (eql ',sub-id)) resx (drv-opnds tf drv))
,@reverser)

becomes this:

(defmethod tf-reverse ((id (eql ',sub-id)) tf drv
&aux (opnds (drv-opnds tf drv)))
(loop for resx in (results drv)
,@reverser))
I don't see why you can't just write a function that
loops over the results and calls the user's reversal
function for each one.

def reverse_multipl e(skill, resx_list, opnds):
for resx in rex_list:
skill.reverse(r esx, opnds)

There's no need to macro-expand this code into every
reversal function, when it can be done once as part of
the framework that calls the reversal functions.

--
Greg
Dec 15 '06 #678
jo************@ hotmail.com wrote:
Neil Cerutti wrote:
The parenthesis I added means I don't have
to use the new-line escape character (\), either.

Is this so unconscious that you don't recognize you are doing it, even
though you take a sentence to explain what you had to do to work around
it?
Yes, it is pretty unconscious. We all do many things
unconsciously in everyday life that would take at
least one sentence to explain to someone else if we
had to think about it.

Besides, in many cases the required brackets are
already there -- e.g. if it's a list, or a function
call with many arguments -- in which case you don't
have to add anything at all.
Adding parentheses ... all this is a
burden specific to Python.
As opposed to Lisp, where all you have to do is
use parentheses... oh, er...
By the way, you guys seem fixate on the parentheses of Lisp without
having the experience
I don't know about the other Pythonistas in this
discussion, but personally I do have experience with
Lisp, and I understand what you're saying. I have
nothing against Lisp parentheses, I just don't agree
that the Lisp way is superior to the Python way in
all respects, based on my experience with both.

--
Greg
Dec 15 '06 #679
Ken Tilton wrote:
What if it turns into an SQL lookup during refactoring?
If the macro can produce SQL code, then whatever interprets the
table can produce SQL code as well.

If you're thinking of the macro taking apart the user's reverse
function (rather than just wrapping it) and somehow translating
it into SQL, well... a macro *could* do that, but it would be
an awfully hairy thing to do, especially if the user is allowed
to write arbitrary Lisp code in the body of his function (as
it seems he is, in your example).

A better way would be to design an abstract API for the user
to use in his reverse functions. Then you can just re-implement
the functions making up the API so that they do SQL queries
instead of whatever they were doing before. No macro processing
needed then.
The last example showed the macro inserting code to magically produce a
binding inside the reverse function.
Are you sure? It looked to me like it was adding code *around*
the reverse function, not inside it. I posted a Python function
that achieves the same thing by calling the existing reverse
function.
It would be easier to compare and
contrast with the Python equivalent if someone had posted such, but your
troops have fallen back to Fort So What? and pulled up the drawbridge.
I'm still trying, but some of the code you posted is rather
impenetrable without knowing a lot more about the details of
your system. I'm doing my best to show some Python demonstrating
the gist of what could be done.

--
Greg
Dec 15 '06 #680

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

Similar topics

14
2197
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
10673
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
10408
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
10430
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,...
1
7689
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
6899
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
5712
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4360
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
2
3889
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3032
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.