From: Andrew Cooke
Subject: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <8a7np7$3of$1@nnrp1.deja.com>
Hi,

Saw this on www.elj.com/elj-daily.cgi yesterday:
http://www.norvig.com/python-lisp.html
and thought people here might be interested (Norvig's
considering rewriting examples in the textbook - Norvig & Russel, not
the Case Studies book - in a language other than Lisp and feels Python's
pretty similar, but not as fast).

Must say I felt the same coming in the other direction - liked Python
and felt Lisp was "a better version".  But Python isn't really
implemented for speed as a functional language - no tail recursion
optimisation for example (at least for C based Python, haven't used
JPython).  Maybe more surprising, why is he looking at changing the
examples (and why not Scheme if he has to be trendy) - seems to be
driven my pro-Java "market forces"?

Andrew

PS Thought this was interesting, not trying to imply the D wrod - OK?
:-)


Sent via Deja.com http://www.deja.com/
Before you buy.

From: Reini Urban
Subject: Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <38c82789.42320333@judy>
Andrew Cooke wrote:
>But Python isn't really
>implemented for speed as a functional language - no tail recursion
>optimisation for example (at least for C based Python, haven't used
>JPython).

Originally I wanted to say this:
"java or jpython cannot be made properly tail-recursive together with
portability. see the kawa talk by per bothner talking about limitations
of the java vm. 
http://sourceware.cygnus.com/kawa/papers/KawaLisp98-html/x881.html

=> Implementing general tail-calls and continuations require being able
to manipulate the procedure call stack. Many environments,
including the Java VM, do not allow direct manipulation of stack frames.
You have the same problem if you want to translate to portable C,
without assembly language kludges. Hence, you cannot use the C or Java
stack for the call stack, but instead have to explicitly manage the call
graph and return addresses. ..."

But then I found this message of per:
  "Kawa tail-call-elimination patches checked in"
  http://sourceware.cygnus.com/ml/kawa/1999/msg00051.html

But I still think that per's first statement holds true. This patch
probably just implemented the proposed CPS workaround.
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
From: Rainer Joswig
Subject: Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <rainer.joswig-914D55.10240509032000@news.is-europe.net>
In article <············@nnrp1.deja.com>, Andrew Cooke 
<······@andrewcooke.free-online.co.uk> wrote:

> Hi,
> 
> Saw this on www.elj.com/elj-daily.cgi yesterday:
> http://www.norvig.com/python-lisp.html
> and thought people here might be interested (Norvig's
> considering rewriting examples in the textbook - Norvig & Russel, not
> the Case Studies book - in a language other than Lisp and feels Python's
> pretty similar, but not as fast).

There are no Lisp examples in the book. The book contains
pseudo-code. On the book's website (http://www.cs.berkeley.edu/~russell/aima.html)
you can get Lisp implementations (and Prolog and Java and C++).

Rainer Joswig, ISION Internet AG, Harburger Schlossstra�e 1, 
21079 Hamburg, Germany, Tel: +49 40 77175 226
Email: ·············@ision.de , WWW: http://www.ision.de/
From: Andrew Cooke
Subject: Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <8a7tkj$7f3$1@nnrp1.deja.com>
In article <···································@news.is-europe.net>,
  Rainer Joswig <·············@ision.de> wrote:
> > Saw this on www.elj.com/elj-daily.cgi yesterday:
> > http://www.norvig.com/python-lisp.html
> > and thought people here might be interested (Norvig's
> > considering rewriting examples in the textbook - Norvig & Russel,
not
> > the Case Studies book - in a language other than Lisp and feels
Python's
> > pretty similar, but not as fast).
>
> There are no Lisp examples in the book. The book contains
> pseudo-code. On the book's website
(http://www.cs.berkeley.edu/~russell/aima.html)
> you can get Lisp implementations (and Prolog and Java and C++).

Ah - that makes more sense.  Thanks (I only have the Case Studies book).

Andrew


Sent via Deja.com http://www.deja.com/
Before you buy.
From: Steve Austin
Subject: Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <slrn8ch4lq.bs6.saustin@gaffercat.kickham.com>
On Thu, 09 Mar 2000 Rainer Joswig <·············@ision.de> wrote:

>There are no Lisp examples in the book. The book contains
>pseudo-code. On the book's website (http://www.cs.berkeley.edu/~russell/aima.html)
>you can get Lisp implementations (and Prolog and Java and C++).

This is by no means a criticism, but I think it's worth pointing out that not
all the pseudocode has been implemented in Lisp (although there may be some
versions for other languages). For example, there are no Lisp implementations
for the pseudocode in part IV (Planning), and only Markov decision processes are
implemented for part V.

Steve 
From: Christopher R. Barry
Subject: Read the page more carefully. Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <8766uwt4zd.fsf@2xtreme.net>
Andrew Cooke <······@andrewcooke.free-online.co.uk> writes:

> Hi,
> 
> Saw this on www.elj.com/elj-daily.cgi yesterday:
> http://www.norvig.com/python-lisp.html
> and thought people here might be interested (Norvig's
> considering rewriting examples in the textbook - Norvig & Russel, not
> the Case Studies book - in a language other than Lisp and feels Python's
> pretty similar

[...]

> Maybe more surprising, why is he looking at changing the examples
> (and why not Scheme if he has to be trendy) - seems to be driven my
> pro-Java "market forces"?

Why don't you just carefully read what Peter actually wrote???

    "I looked into Python because I was considering translating the
    code for the Russell & Norvig AI textbook from Lisp to Java so
    that I could have (1) portable GUI demos, (2) portable
    http/ftp/html libraries, and (3) a syntax for students and
    professors who are afraid to learn Lisp. But writing all that Java
    seemed much too daunting, ..."

There are many very good reasons for not using Lisp for a lot of
projects. Because "LISP is interpreted", "LISP is dying", etc. are not
good reasons. I think he gave good reasons. (Well, (3) could be
debated to no end here. You just have to respect that different people 
have different tastes, needs, and backgrounds.)

Christopher
From: Andrew Cooke
Subject: Re: Read the page more carefully. Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <8a96sl$6qn$1@nnrp1.deja.com>
In article <··············@2xtreme.net>,
  ······@2xtreme.net (Christopher R. Barry) wrote:
> Andrew Cooke <······@andrewcooke.free-online.co.uk> writes:
> > Saw this on www.elj.com/elj-daily.cgi yesterday:
> > http://www.norvig.com/python-lisp.html
> > and thought people here might be interested (Norvig's
> > considering rewriting examples in the textbook - Norvig & Russel,
not
> > the Case Studies book - in a language other than Lisp and feels
Python's
> > pretty similar
>
> [...]
>
> > Maybe more surprising, why is he looking at changing the examples
> > (and why not Scheme if he has to be trendy) - seems to be driven my
> > pro-Java "market forces"?
>
> Why don't you just carefully read what Peter actually wrote???

Hang on hang on.  I know that I post before thinking too often, but you
are underestimating me here.  I read the article, and my comments above
refer to why he needed to add GUI or help people who don't like
parentheses - I was speculating that *that* was driven by marketing
pressure.

What I *did* get wrong (I think you could argue it isn't obvious from
the article, although it is in hindsight), is that the code is separate
from the book, which contains pseudo-code.

Cheers,
Andrew


Sent via Deja.com http://www.deja.com/
Before you buy.
From: Robert Monfera
Subject: Re: Read the page more carefully. Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <38C8AAA7.844F9AFB@fisec.com>
"Christopher R. Barry" wrote:

> Why don't you just carefully read what Peter actually wrote???

[...]

> There are many very good reasons for not using Lisp for a lot of
> projects. Because "LISP is interpreted", "LISP is dying", etc. are not
> good reasons.

How can you tell if you've indeed read it carefully from top to bottom?

"In the following blurb from Python.org,
everything remains true when you substitute "lisp" for "Python", with a
very few exceptions: Lisp has packages but not modules; some think Lisp
syntax is not readable to a novice; Lisp has free versions, but not one
standard free version; Lisp is missing standardized libraries for newer
things like web protocols.

	Python is an interpreted [...] programming language [...]"

:-)

Robert
From: Peter Norvig
Subject: Re: Read the page more carefully. Re: Norvig: Python for LispProgrammers
Date: 
Message-ID: <38C848B0.A341745C@shell14.ba.best.com>
Good point, Robert, I missed that one.  In a sense, "Lisp is an
interpreted language" is true for some implementations, but so is "Lisp
is a compiled language".  A better statement is that Lisp and Python are
interactive languages.

-Peter

Robert Monfera wrote:
> 
> "In the following blurb from Python.org,
> everything remains true when you substitute "lisp" for "Python", with a
> very few exceptions: Lisp has packages but not modules; some think Lisp
> syntax is not readable to a novice; Lisp has free versions, but not one
> standard free version; Lisp is missing standardized libraries for newer
> things like web protocols.
> 
>         Python is an interpreted [...] programming language [...]"
> 
> :-)
> 
> Robert
From: Peter Norvig
Subject: Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <38C7F672.3A6ECF82@shell14.ba.best.com>
As Rainer pointed out, the book uses pseudo-code, but the web site
provides Lisp.  We've had requests for other languages (Java, C, C++,
Prolog), and I wanted to add a language (not replace Lisp, but add an
alternative), particularly a language that has free implementations
across all platforms, that supports web protocols and GUIs with standard
packages, and that is "trendy" enough to be a good choice for a wide
audience, enough to make the investment worthwhile.  Python and Java are
candidates, and perhaps others.  If anyone wants to volunteer to help
out, let me know.

-Peter Norvig
From: Michael Schuerig
Subject: Re: Norvig: Python for Lisp Programmers
Date: 
Message-ID: <1e7a0u7.ndc40i1cvrnnkN%schuerig@acm.org>
Peter Norvig <······@shell14.ba.best.com> wrote:

> As Rainer pointed out, the book [AIMA] uses pseudo-code, [snip]

The news section on the book's web site is a bit outdated. I'm curious
when the 2nd edition will be published.

Michael

-- 
Michael Schuerig
···············@acm.org
http://www.schuerig.de/michael/