merits of Lisp vs Python

B

Bjoern Schliessmann

Alex said:
hell no, lisp's syntax is much easier than python's since it's
homogenous

Can you give an example? I cannot imagine how homogenity always
results in easiness.
(and certainly lisp was invented much 30 years before
Python, so that's Python uses Lisp features)

I think you acknowledged that the syntax is different and not
borrowed?

[many parentheses]
that make logic more explicit

Can you give an example?

Regards,


Björn

Xpost cll,clp
 
G

George Sakkis

Alex said:
(message (Hello 'Istvan)
(you :wrote :eek:n '(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.

George
 
?

=?ISO-8859-15?Q?Andr=E9_Thieme?=

hankhero said:
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.


André
--
 
B

Bill Atkins

Bjoern Schliessmann said:
I think you acknowledged that the syntax is different and not
borrowed?

Um, so does that mean that Python couldn't have borrowed other
features?
 
B

Bill Atkins

Mark Tarver said:
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.
 
G

George Sakkis

André Thieme said:
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."

http://mail.python.org/pipermail/python-3000/2006-April/000286.html.


George
 
A

Alex Mizrahi

(message (Hello 'Kay)
(you :wrote :eek:n '(8 Dec 2006 08:03:18 -0800))
(

KS> http://www.sbcl.org/manual/Handling-of-Types.html#Handling-of-Types

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")
 
J

JShrager

Sounds like it's time for:

A Beginners' Meta FAQ for comp.lang.lisp:

http://nostoc.stanford.edu/jeff/llisp/cllfaq.html

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 ***").
 
A

Alex Mizrahi

(message (Hello 'Bjoern)
(you :wrote :eek:n '(Fri, 08 Dec 2006 17:31:08 +0100))
(

??>> hell no, lisp's syntax is much easier than python's since it's
??>> homogenous

BS> Can you give an example? I cannot imagine how homogenity always
BS> results in easiness.

homogenity means that i can cut any expression and paste in any other
expression, and as long as lexical variables are ok, i'll get correct
results -- i don't have to reindent it or whatever.
this is aproximately what programmer does -- he paste pieces of code from
his mind into the program.

BS> [many parentheses]
??>> that make logic more explicit
BS> Can you give an example?

also, there's no need for operator precendence to be taken in accound --
order is explicitly defined. expressions are homogenous, they do not depend
on other expressions near them (except lexical variables and side effects).

the other example of homogenous syntax is XML, that is very popular
nowadays, and it's very similar to lisp's s-expressions.

certainly, it's a matter of taste what syntax to prefer -- i prefer lisp
syntax, others might prefer Python, ML or Haskell syntax.
but homogenous syntax is very important for true macros.

??>> (and certainly lisp was invented much 30 years before
??>> Python, so that's Python uses Lisp features)

BS> I think you acknowledged that the syntax is different and not
BS> borrowed?

certainly

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"People who lust for the Feel of keys on their fingertips (c) Inity")
 
M

Mark Tarver

Bill said:
What was the reasoning behind cross-posting this to c.l.p and c.l.l?
This type of question inevitably leads to controversy.

I don't mind controversy - as long as there is intelligent argument.
And since it involves Python and Lisp, well it should be posted to both
groups. The Lispers will tend to say that Lisp is better for sure -
so it gives the Python people a chance to defend this creation.

I'm looking at Python and I see that the syntax would appeal to a
newbie. Its clearer than ML which is a mess syntactically. But I
don't see where the action is in Python. Not yet anyway. Lisp syntax
is easy to learn. And giving up an order of magnitude is a high price
to pay for using it over Lisp.

Mark
 
R

Rob Thorpe

Alex said:
(message (Hello 'Kay)
(you :wrote :eek:n '(8 Dec 2006 08:03:18 -0800))
(

KS> http://www.sbcl.org/manual/Handling-of-Types.html#Handling-of-Types

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..

I agree with your other points. Python allows the programmer to
override absolutely anything, including things like addition. This
entails extra work.

It's also worth mentioning that Clisp is an hugely optimized
interpreter. A much work has been put in to making it's bytecode
interpreting inner loops as fast as possible.
 
K

Kaz Kylheku

Mark said:
I don't mind controversy - as long as there is intelligent argument.
And since it involves Python and Lisp, well it should be posted to both
groups. The Lispers will tend to say that Lisp is better for sure -
so it gives the Python people a chance to defend this creation.

And that would be our confirmation that this is another trolling
asshole.
 
J

Jan Dries

Alex said:
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?

I think you're missing the point. You must know your language's
strengths and weaknesses, and use the approach/function/library that's
right for the job in the given language.

For instance, on my machine the following Python-code:

some_string = ""
while len(some_string) < 100000:
some_string += "*"

outperforms the following C-code:

strcpy(some_string,"");
while(strlen(some_string) < 100000)
strcat(some_string,"*");

by roughly *factor 15*!

The point of course is you shouldn't be using strlen/strcat this way,
nor use this piece of code as a reference for benchmarking C versus
Python performance.
And for the same reason: in the presence of excellent optimized Python
libraries for matrix multiplication, you probably shouldn't be doing
that in pure Python if performance matters, nor use that as a reference
case in benchmarking Python.

Regards,
Jan
 
M

Mark Tarver

Kaz said:
And that would be our confirmation that this is another trolling
asshole.

This would be a confirmation that you are ignorant in your manners and
don't know how to address a straight question.

Mark
 
P

Petter Gustad

Bjoern Schliessmann said:
Can you give an example? I cannot imagine how homogenity always
results in easiness.

CL-USER> (+ 1 2 3 4 5 6 7 8 9 10)
55

CL-USER> (< 1 2 3 4 5 6 7 8 9 10)
T
CL-USER> (< 1 2 3 4 5 6 7 8 9 10 9)
NIL


Petter
 
B

Bjoern Schliessmann

Bill said:
Um, so does that mean that Python couldn't have borrowed other
features?

No, but he used this point in direct conjunction with the syntax. At
least by my understanding.

Regards,


Björn

Xpost cll,clp
 
P

Pillsy

hankhero wrote:
[...]
Pythons advantages are:
Faster startup-time which makes it a good scripting language.

I agree with the others (especially the cleverness of Python's string
quoting), but on my machine, SBCL starts up and runs a "Hello World"
program a bit faster than Python, and CLisp really blows its doors off.

Cheers, Pillsy
 
B

Bjoern Schliessmann

Alex said:
(message (Hello 'Bjoern)
homogenity means that i can cut any expression and paste in any
other expression, and as long as lexical variables are ok, i'll
get correct results -- i don't have to reindent it or whatever.

Ah, so *that's* what you meant ... but I don't really understand the
ease of it.
also, there's no need for operator precendence to be taken in
accound -- order is explicitly defined. expressions are
homogenous, they do not depend on other expressions near them
(except lexical variables and side effects).

Sorry, I don't get it ;) Where does Python have things like
nonexplicit defined operator order?
the other example of homogenous syntax is XML, that is very
popular nowadays, and it's very similar to lisp's s-expressions.

Spoken freely, I don't like XML because it's hardly readable. Is
it "easy"? If yes, what's your definition of "easy"?

Regards,


Björn

Xpost cll,clp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,657
Members
45,417
Latest member
BonitaNile
Top