From: Kenny Tilton
Subject: Norvig on Lisp vs Python revised
Date: 
Message-ID: <401538E1.D7C171BA@nyc.rr.com>
Am I the last one to notice this has been massively revised?:

   http://www.norvig.com/python-lisp.html

kenny

-- 

 http://www.tilton-technology.com/
 ---------------------------------------------------------------
"[If anyone really has healing powers,] I would like to call
them about my knees."
                    --  Tenzin Gyatso, the Fourteenth Dalai Lama

From: Kaz Kylheku
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <cf333042.0401261238.3a86ed90@posting.google.com>
Kenny Tilton <·······@nyc.rr.com> wrote in message news:<·················@nyc.rr.com>...
> Am I the last one to notice this has been massively revised?:
> 
>    http://www.norvig.com/python-lisp.html

You know, that row in the table which compares

 (eval '(+ 1 2)) to  eval("1 + 2")

is quite misleading; it leads the naive reader into believing that
these two concepts of eval are on par. How about an example with a
backquote expression fed to eval in the Lisp column, versus the result
of string formatting fed to eval in the Python column. :)

Also, I wouldn't put this into the category ``higher order
functions''. Treating source as an object is something other than
treating functions as objects! It's meta-programming, meta-syntactic
programming or whatever.
From: Thomas F. Burdick
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <xcvy8rufi9w.fsf@famine.OCF.Berkeley.EDU>
Kenny Tilton <·······@nyc.rr.com> writes:

> Am I the last one to notice this has been massively revised?:
> 
>    http://www.norvig.com/python-lisp.html

It looks pretty different than it did 2 years ago or whenever I last
looked at it.  ... Looking through archive.org, it looks like it was
fairly different <= October 2001.  Kind of an annoying quality in
something that gets cited for anti-advocacy uses :-)

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Brian Mastenbrook
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <260120041444015162%NOSPAMbmastenbNOSPAM@cs.indiana.edu>
In article <·················@nyc.rr.com>, Kenny Tilton
<·······@nyc.rr.com> wrote:

> Am I the last one to notice this has been massively revised?:
> 
>    http://www.norvig.com/python-lisp.html

I think this page is missing quite a bit of things that could be in
lisp's favor, and mis-states a few things. I would guess that it might
be similarly missing things for Python but not knowing the language I
am not really qualified to comment.

In any event, a couple of things off the top of my head:

* "GUI, Web, etc. libraries - Not standard" - it depends on what you
mean by standard. In Python either nothing is standard or everything is
standard because it's only one main implementation with a number of
clones. Perhaps the fairer comparison would be one implementation of
Lisp vs. one implementation of Python, or looking at what's available
in all Python dialects (including JPython). Regardless Lisp is one of
the few languages with a standardized GUI at that: CLIM, which has an
excellent free implementation.
* I am not sure why he seems to think that Lisp having other data types
in the core language is a disadvantage. The more there are in the core
language, the more people will use them, which increases
communicability of intent.
* Fails to bring up handler-case / handler-bind / restarts when talking
about exceptions.
* Macros and reader macros can collapse some of the more unwieldy
syntax quite portably.
* Does Python have MOP?

-- 
Brian Mastenbrook
http://www.cs.indiana.edu/~bmastenb/
From: André Thieme
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <bv3t2a$ge7$1@ulric.tng.de>
Brian Mastenbrook wrote:
>>   http://www.norvig.com/python-lisp.html
> 
> 
> I think this page is missing quite a bit of things that could be in
> lisp's favor, and mis-states a few things. I would guess that it might
> be similarly missing things for Python but not knowing the language I
> am not really qualified to comment.

As Peter Norvig is heavily using Lisp and one of the guys who brings 
this language to the attention of a bigger audience I think there is 
enough material from him that shows his opinion about Lisp.
I am sure his page is just a short overview for Lispers who have or want 
to work with Python to get some basic ideas.


> * Does Python have MOP?

Python has Metaclasses.
You are able to make programs that write classes at runtime and give you 
all the information about them you want. And classes in Python are first 
class objects, so you can pass classes to functions (not only instances 
but the classes themself).
From: Brian Mastenbrook
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <260120041852271575%NOSPAMbmastenbNOSPAM@cs.indiana.edu>
In article <············@ulric.tng.de>, Andr� Thieme
<······································@justmail.de> wrote:

> As Peter Norvig is heavily using Lisp and one of the guys who brings 
> this language to the attention of a bigger audience I think there is 
> enough material from him that shows his opinion about Lisp.
> I am sure his page is just a short overview for Lispers who have or want 
> to work with Python to get some basic ideas.

I'm certainly aware of what Norvig has done; I was merely remarking
that even the best of them can fall into lisp stereotypes (no extra
libraries, no GUI, et al) at times.

> Python has Metaclasses.
> You are able to make programs that write classes at runtime and give you 
> all the information about them you want. And classes in Python are first 
> class objects, so you can pass classes to functions (not only instances 
> but the classes themself).

I googled around a bit on this and it sounds a lot like Objective C's
class objects to me. MOP is more powerful than that particular model,
but a lot of its power is related to generic functions. Still, do you
have the option of doing things like changing the class inheritance
order in Python? I ask out of ignorance, not out of bias. (I reserve
that for my anti-syntax bias :-) )

-- 
Brian Mastenbrook
http://www.cs.indiana.edu/~bmastenb/
From: André Thieme
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <bv4c0j$ppk$1@ulric.tng.de>
Brian Mastenbrook wrote:

> Still, do you have the option of doing things like changing
 > the class inheritance order in Python?
 > I ask out of ignorance, not out of bias. (I reserve
> that for my anti-syntax bias :-) )

I don't know of a trivial method to do this.
Michele Simionato might know it better, however, flying over his article 
I don't find this covered:
http://www.python.org/2.3/mro.html
From: Michele Simionato
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <95aa1afa.0401262317.10d86e96@posting.google.com>
Andr� Thieme <······································@justmail.de> wrote in message news:<············@ulric.tng.de>...
> Brian Mastenbrook wrote:
> 
> > Still, do you have the option of doing things like changing
>  > the class inheritance order in Python?
>  > I ask out of ignorance, not out of bias. (I reserve
> > that for my anti-syntax bias :-) )
> 
> I don't know of a trivial method to do this.
> Michele Simionato might know it better, however, flying over his article 
> I don't find this covered:
> http://www.python.org/2.3/mro.html

That one is the paper on multiple inheritance. Here are the papers
on metaclasses:

http://www-106.ibm.com/developerworks/library/l-pymeta.html
http://www-106.ibm.com/developerworks/linux/library/l-pymeta2/

These papers are aimed to less sophisticated readers than lispers, so
they only scratch the surface of Python metaclasses. 

It is fair to say that Python metaclasses are frightening powerful 
and that they allow any kind of abuse. 

For instance, suppose I want to revert the order of inheritance
of a given hierarchy, as Brian Mastenbrook asked. 
This a trivial job for a metaclass.
Here is an example with a diamond hierarchy:

"""
No metaclass: the cpl is (C C1 C2 B)
    B
   / \
  C1 C2
   \ /
    C
"""

class B(object):
    def m(self):
        return "B.m"

class C1(B):
    def m(self):
        return super(C1,self).m()+" C1.m"

class C2(B):
    def m(self):
        return super(C2,self).m()+" C2.m"

class C(C1,C2):
    pass

print C().m() 

This prints B.m C2.m C1.m. I can revert the order of C1 and C2 as follows:

"""
metaclass changing the cpl to (C C2 C1 B)
"""

class revert_order(type):
    "Metaclass reverting the order of the bases"
    def __new__(mcl,name,bases,dic):
        rev_bases=list(bases)
        rev_bases.reverse()
        return super(revert_order,mcl).__new__(mcl,name,tuple(rev_bases),dic)

class B(object):
    def m(self):
        return "B.m"

class C1(B):
    def m(self):
        return super(C1,self).m()+" C1.m"

class C2(B):
    def m(self):
        return super(C2,self).m()+" C2.m"

class C(C1,C2):
    __metaclass__=revert_order

print C().m() 

This prints B.m C1.m C2.m. Notice that the metaclass will be inherited
and will change the order of all subclasses of C. It wouldn't be
difficult to change that, if it was undesired behavior.

Since metaclasses and "super" are new features introduced in Python 2.2
they still lack some syntactic sugar and they are kinda ugly to use, but
I do expect we will have a better notation in the near future. Anyway, the
functionality is already there.

     Michele Simionato
From: Marco Antoniotti
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <JZlRb.515$Nq.117311@typhoon.nyu.edu>
Andr� Thieme wrote:

> 
>> * Does Python have MOP?
> 
> 
> Python has Metaclasses.
> You are able to make programs that write classes at runtime and give you 
> all the information about them you want. And classes in Python are first 
> class objects, so you can pass classes to functions (not only instances 
> but the classes themself).

Hot water. Been there before.  The CLOS MOP is vintage late 80's.

Cheers
--
Marco
From: Henrik Motakef
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <x73ca2sbfb.fsf@crocket.internal.henrik-motakef.de>
Brian Mastenbrook <····················@cs.indiana.edu> writes:

> * Does Python have MOP?

Not the AMOP MOP of course, but it does have metaclasses.
From: John M. Adams
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <oqaektld31h.fsf@RAKTABIJA.stsci.edu>
Brian Mastenbrook <····················@cs.indiana.edu> writes:

> In article <·················@nyc.rr.com>, Kenny Tilton
> <·······@nyc.rr.com> wrote:
>
>> Am I the last one to notice this has been massively revised?:
>> 
>>    http://www.norvig.com/python-lisp.html
>
> I think this page is missing quite a bit of things that could be in
> lisp's favor, and mis-states a few things. I would guess that it might
> be similarly missing things for Python but not knowing the language I
> am not really qualified to comment.

Well, you are probably right.  However, it's practically impossible to
write a satisfactory language comparison except with respect to
specific goals which will not be shared by all readers.  Given the
length, I think it's very well done.

I find the following to be a good illustration of the principle.  It's
from The Design and Evolution of C++.

\begin{quotation} 
\footnotesize
Different people expect radically different things from a book on the
design and evolution of a programming language.  In particular, no two
people seem to agree on what level of detail is appropriate for a
discussion of this topic.  \emph{Every} review I received on the
various versions of the HOPL-2 paper (well over a dozen reviews) was
of the form, ``This paper is too long ... please add information on
topics X, Y, and Z.''  Worse, about a third of the reviews had
comments of the form, ``Cut the philosophical/religious nonsense and
give us proper technical details instead.''  Another third commented,
``Spare me the boring details and add information on your design
philosophy.''\cite{deocpp}

\begin{center}
---Bjarne Stroustrup
\end{center}

\normalsize
\end{quotation}

-- 
John M. Adams
From: André Thieme
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <bv3nir$csj$1@ulric.tng.de>
Kenny Tilton wrote:
> Am I the last one to notice this has been massively revised?:
> 
>    http://www.norvig.com/python-lisp.html


Could you maybe point out what has changed since your last visit? I read 
this page around six months ago and it looks exactly the same...
From: Kenny Tilton
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <401582D3.594A0B3A@nyc.rr.com>
Andr� Thieme wrote:
> 
> Kenny Tilton wrote:
> > Am I the last one to notice this has been massively revised?:
> >
> >    http://www.norvig.com/python-lisp.html
> 
> Could you maybe point out what has changed since your last visit? I read
> this page around six months ago and it looks exactly the same...

Oh, don't mind me. Last time I looked was probably eighteen months ago.
I would think I was on a different page, except the opening paragraph
was the same.

kenny

-- 

 http://www.tilton-technology.com/
 ---------------------------------------------------------------
"[If anyone really has healing powers,] I would like to call
them about my knees."
                    --  Tenzin Gyatso, the Fourteenth Dalai Lama
From: Jukka K
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <1vfRb.918$V52.802@reader1.news.jippii.net>
Andr� Thieme wrote:
> Kenny Tilton wrote:
> 
>> Am I the last one to notice this has been massively revised?:
>>
>>    http://www.norvig.com/python-lisp.html
> 
> 
> 
> Could you maybe point out what has changed since your last visit? I read 
> this page around six months ago and it looks exactly the same...
Maybe this helps ?

http://docucomp.archive.org/cgi-bin2/dc_compare.cgi?urls=http%3A%2F%2Fweb.archive.org%2Fweb%2F20021004094012%2Fhttp%3A%2F%2Fnorvig.com%2Fpython-lisp.html&urls=http%3A%2F%2Fweb.archive.org%2Fweb%2F20021202074556%2Fhttp%3A%2F%2Fwww.norvig.com%2Fpython-lisp.html

That is, http://www.archive.org/ is your friend here.

/jukka
From: jblazi
Subject: Re: Norvig on Lisp vs Python revised
Date: 
Message-ID: <pan.2004.01.26.19.50.37.703000@hotmail.com>
On Mon, 26 Jan 2004 15:54:35 +0000, Kenny Tilton wrote:

> Am I the last one to notice this has been massively revised?:
> 
>    http://www.norvig.com/python-lisp.html

Actually I *do* miss macros and Lisp's richness but I still stay with
Python: My programs are typically small, and Python offers me very good
standrad libraries, including excellent GUI toolkits (for example
wxPython). When I later decide to convert my project to C++ for obvious
reasons, I can use the very same wxWindows GUI toolkit I used in my Python
code.

jb


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
From: André Thieme
Subject: OT: wxLisp (was: Re: Norvig on Lisp vs Python revised)
Date: 
Message-ID: <bv3tad$ggf$1@ulric.tng.de>
jblazi wrote:

> Actually I *do* miss macros and Lisp's richness but I still stay with
> Python: My programs are typically small, and Python offers me very good
> standrad libraries, including excellent GUI toolkits (for example
> wxPython). When I later decide to convert my project to C++ for obvious
> reasons, I can use the very same wxWindows GUI toolkit I used in my Python
> code.

I wished more C++ hackers would join this project:
http://sourceforge.net/projects/wxlisp/

This way you could convert your python programs to Lisp and still use 
the same GUI toolkit! I hope this project will become a success (soon).
From: jblazi
Subject: Re: OT: wxLisp (was: Re: Norvig on Lisp vs Python revised)
Date: 
Message-ID: <pan.2004.01.26.20.36.56.109000@hotmail.com>
On Mon, 26 Jan 2004 21:29:46 +0100, Andr� Thieme wrote:

> jblazi wrote:
> 
> I wished more C++ hackers would join this project:
> http://sourceforge.net/projects/wxlisp/
> 
> This way you could convert your python programs to Lisp and still use 
> the same GUI toolkit! I hope this project will become a success (soon).

I visit that page periodically but I always read that it is still in the
planning phase. (But it is the best thing, you can do for Lisp!)

jb



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---