473,750 Members | 2,515 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 28568
In article
<pa************ *************** *@REMOVE.THIS.c ybersource.com. au>,
Steven D'Aprano <st***@REMOVE.T HIS.cybersource .com.auwrote:
On Sun, 10 Dec 2006 04:03:25 +0000, Kirk Sluder wrote:
In article
<pa************ *************** @REMOVE.THIS.cy bersource.com.a u>,
Steven D'Aprano <st***@REMOVE.T HIS.cybersource .com.auwrote:
So it is good that English restricts the expressiveness and power of the
syntax and grammar. While we're talking English, we can both understand
each other, and in fact people who redefine words and ignore the common
meaning of them are often covering weaknesses in their arguments.
Ohh, can the guy who does discourse analysis for a (meager) living
respond to this?

To start with, English does not restrict the expressiveness and
power of the syntax and grammar.

Really? There are no restrictions whatsoever in English syntax and
grammar? None at all?
Of course I didn't say that: What I said was, "To start with,
English does not restrict the expressiveness and
power of the syntax and grammar. People who use the English language
in specific communities and in specific forms of discourse do. The
key to how this happens occurs on another layer of how language
works which is almost always left out of internet discussions of
language: pragmatics."

As an example of the context-specific nature of pragmatics at work,
if I was your reviewer or editor, I'd reject this manuscript. As a
participant on usenet, I'll just point out that you selectively
quoted the antithesis, and deleted my thesis to argue a straw-man.

Of course there are restrictions, *enforced by users of language in
specific communities.* But the English language is quite malleable,
and includes not only the discourse we are currently engaged in, but
the clipped jargon of internet chat and amateur radio, the
chronically passive discourse of academia, the passionate chants of
protesters, and a wide variety of poetic expression.

This is where wannabe critics of "English grammar" fail to
understand the language they claim to defend, much to the amusement
of those of us who actually do study language as it is, rather than
the mythical eternal logos we want it to be.

Languages are (with some trivial exceptions) human creations. The
laws, rules and restrictions of languages are dynamic and dependent
on community, mode, medium and context. Of course, wannabe
grammarians frequently rise up at this point and say that if such is
the case, then there is nothing to prevent <language of choicefrom
devolving into a babble of incomprehensibl e dialects. To which the
easy response is that the benefits of conformity to linguistic
communities almost always outweigh the costs of nonconformist
expression.

And if you want to bring this back around to computer languages, the
benefits of conformity to said linguistic communities tends to
outweigh the costs of doing your own thing. (Unless you can make a
convincing argument that "doing your own thing" is superior.)
So, when I say "sits cat rat" it is not only legal English, but you can
tell which animal is sitting on which?
What is "legal" in English depends on the communities in which you
are currently participating. Likely there is some community in which
such clipped discourse is understood and therefore legal. If you are
talking to me, I'd express my lack of comprehension by saying
"Pardon?" and ask you to rephrase.
But I'm belaboring the point. Of course English has restrictions in
grammar and syntax -- otherwise one could write something in Latin or
Thai or Mongolian and call it English. There are RULES of grammar and
syntax in English, which means that there are possible expressions which
break those rules -- hence there are expressions which one can't write in
legal English.
When you make an "illegal" statement in English, exactly who or what
corrects you?

Is it Zeus, the divine Logos, the flying spaghetti monster, some
platonic ideal?

As you can probably tell, this kind of silliness is a bit of a sore
spot for me. So please by all means, do some basic reading of
linguistics before you continue to engage in such silliness. Or at
least learn to properly quote an argument.
Dec 10 '06 #251
Paul Rubin <http://ph****@NOSPAM.i nvalidwrites:
"Wolfram Fenske" <in***@gmx.netw rites:
>with a couple of macros. I. e. 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.

If Common Lisp didn't have lexically scoped variables (most Lisp
dialects before Scheme didn't have them) then it would be very
difficult to add that with macros.
Alex Mizrahi already took care of that one.
Do you seriously think lexical scoping is the last word in language
features and that there's now nothing left in other languages that
can't straightforward ly be done in CL?
No. My point was more that Lisp is so flexible that it even allows
you to add something as huge as object orientation without requiring a
change to the compiler. What about Aspect-Oriented Programming, for
example? For Java, you need a new compiler/preprocessor, for Lisp, it
can be implemented as a library [1].
Hint: call-with-current-continuation (also known as call/cc).
You're right call/cc is a problem because you basically can't
implement call/cc without having call/cc. I. e. it requires pervasive
changes to the compiler/interpreter if something like it is not
already in there. Still, Scheme--also a Lisp--has call/cc and was
probably the first language to implement it.
I just don't see a non-messy way to simulate Python generators in CL.
They can be done in Scheme using call/cc though.
Scheme is also a Lisp. So?
Take a look sometime at Hughes' paper on "Why Functional Programming
Matters":

http://www.math.chalmers.se/~rjmh/Papers/whyfp.html

The examples in it are pretty easy to do in Python or Scheme, but I
think not so easy in CL.
Anything in particular? I'd be surprised if the solutions in Scheme
and CL would differ very much because apart from the Lisp-1/Lisp-2
issue and call/cc, Scheme and CL are not that different.
Footnotes:
[1] <http://common-lisp.net/project/closer/aspectl.html>

--
Wolfram Fenske

A: Yes.
>Q: Are you sure?
>>A: Because it reverses the logical flow of conversation.
>>>Q: Why is top posting frowned upon?
Dec 10 '06 #252
In article
<pa************ *************** *@REMOVE.THIS.c ybersource.com. au>,
Steven D'Aprano <st***@REMOVE.T HIS.cybersource .com.auwrote:
That depends. If somebody smart is designing a new programming language,
then no, you get a new programming language.

If somebody not-so-smart is merely hammering the round peg of Lisp into
the square hole of not-quite-Lisp-and-not-quite-anything-else, then yes,
that will be a problem. But apparently, despite the talk of using macros
to implement anything in Lisp, nobody actually does that.
Then what exactly is your argument here?

And BTW:
CL-USER(defun + (a b))
Lock on package COMMON-LISP violated when setting fdefinition of +.
[Condition of type SYMBOL-PACKAGE-LOCKED-ERROR]

While lisp doesn't prohibit such name conflicts, it does mean that
anyone trying it will generate a fair number of errors each time the
definition is compiled.
Perhaps it's because I'm a social scientist and not a programmer by
training, but I find many arguments for *technical* solutions to
*human performance* problems to be rather weak as a general
practice. In some cases, using a very restrictive language may be
the best solution for the problem.

I don't know about you, but I'm not talking about VERY restrictive
languages -- I'm using Python, which isn't very restrictive at all. But
even Lisp has some restrictions -- you can't jump to an arbitrary memory
location and treat whatever random bytes are there as executable code, can
you?
Certainly, and I've even pointed out a few that would mediate
against your claim of incompetent programmers being able to
arbitrarily shadow core functions in a way that is invisible to
anyone else.
Dec 10 '06 #253
In article <7x************ @ruckus.brouhah a.com>,
Paul Rubin <http://ph****@NOSPAM.i nvalidwrote:
Kirk Sluder <ki**@nospam.jo bsluder.netwrit es:
The pythonic way to do this would be to create a class that
implements file-like behaviors:
.....
>
Actually the Python example can lose (e.g. leak a file descriptor
temporarily) if output.write raises an exception (prevents
output.close from running). For this reason Python recently
introduced the "with" statement:

with output as fileLike.open() :
output.write("H ello world\n")

Here the file gets closed automatically (by running an exit method in
the fileLike class) when the "with" block exits, whether normally or
through an exception.
Ohhh, shiny!
Dec 10 '06 #254


Steven D'Aprano wrote:
On Sat, 09 Dec 2006 22:41:12 -0500, Ken Tilton wrote:

>>>I know that. It was more of a rhetorical question -- Lispers are either
trying to emphasis the radical nature of what you can do with macros, or
understate it and make them seem just like functions.

Yep, both. The first is rare. CLOS is one, my Cells (ported this summer
to PyCells as part of SoC 2006) is another. The latter is the norm.


If macros' advanced usage is rare,
Hunh? I have tons of them. Of coure at your level of discourse you will
want to know if those are metric tons or...

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 #255
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.
We are.

(Counting lines? Come on.)
Dec 10 '06 #256


Wolfram Fenske wrote:
Steven D'Aprano <st***@REMOVE.T HIS.cybersource .com.auschreibt :
....
>>Some languages are too expressive.


I disagree. "Too expressive"--what a thing to say.
A sad moment in Usenet discourse... a moment of silence, please.

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 #257
Steven D'Aprano wrote:
Oh my god! Lisp can echo STRINGS to the interpreter?
Indeed yes, but that's not exactly what's happening here. (And it's not
necessarily an interpreter, by the way. Some Lisp implementations
compile every expression to machine code and branch to it. Corman Lisp,
for instance, doesn't even contain an interpreter).

My point is not to showcase anything about Lisp, but simply to point
out the irony that in the same paragraph in which you are going on
about Lisp being unreadable compared to human written languages, there
appear pieces of parseable Lisp syntax.
Why didn't somebody somebody tell me that!
The answer to that would be: because your being properly informed for
these kinds of debates is your responsibility, and it is assumed.
!!! That *completely* changes my mind about the language!
If you keep up the mind changing, you can maybe trade up to one that
works in perhaps fewer than twenty transactions. (Think: Kyle
MacDonald).

Dec 10 '06 #258


George Sakkis wrote:
JS******@gmail. com wrote:

>>1. Lisp is the only industrial strength language

^^^^^^^^^^^^^^^ ^^^^
You keep using that phrase. I don't think it means what you think it
means.
To me in part it means "no one can decide to take away lambda because
they decided they should not have put it in in the first place and then
change their mind and leave it in after I already put a few people on
de-lambdifying our 100kloc system because...", and in part it means
compilation. And it /has/ to have macros. :)

Perhaps it does in some programming language theory research groups.
haha, the same old straw man, Is it not embarrassing to have to resort
to the same defeated argument again and again?
In
the real world, superiority has to do with far more than technical
merits alone, let alone obscure metaprogramming features ...
Metaprogramming by definition cannot be obscure. Metaprogramming means
programming at a higher level. A higher level means "more productive".
More productive is the essence of pragmatism. QED.
...which are
irrelevant to the vast majority of programmers.
You insult them by suggesting they cannot concieve at a higher level.
Mebbe they could if their language aupported it. Yours does not.
I don't know if other lispers
would join you in your feeble attempt to steal a bite from Ruby's
current glory...
Of course we would. You do not get it. The only thing you guys are
bleating about is greater popularity. Now someone is about to eat your
lunch popularity-wise. Live by the poll, die by the poll. And you held
first place for like a week in language geologic time, taken down merely
because...
(mostly thanks to the admirable marketing around the
overhyped Rails framework)
.... a little hype came along? Wow, your fundamental advantage must have
been about zip, and all derived from things unrelated to syntax. <gasp>

, but Ruby is much closer to Python than
either of them is to lisp. In fact, if Python suddenly disappeared,
Ruby would probably be my next stop. Both Ruby and Python are high
level dynamic languages with an emphasis on pragmatic needs, not being
the language of the God(s) (see, I can bring up stupid slogans of
languages too).
As Graham said, if some pretty good programmers are jumping up and down
about X, mebbe you should take a look at X. Even if assholes like me
piss you off. :)

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 #259
Ken Tilton wrote:
André Thieme wrote:
>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.
That is a deficiency of Python that doesn't exist in modern FPLs like OCaml,
SML, Haskell, F#...
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>
He is correct. When the boilerplate changes, you change your HOF.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/product...ex.html?usenet
Dec 10 '06 #260

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

Similar topics

14
2181
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
8839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9584
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...
1
9345
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
9257
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...
1
6811
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
6081
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();...
1
3327
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
2809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2227
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.