Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Sun, 01 Feb 2004
Python vs Lisp
Thursday's posting on Lunacy provoked a decent number of comments. There was also a discussion (unrelated) of Python vs Lisp/Scheme in #joiito that day...

Now that lots of people are piling onto the Python bandwagon, it's amusing that many of them don't realize that they are using a language which has many similarities to Lisp. So as a service to both language communities, I'm posting references to a pair of pages written by Peter Norvig. The first is called Python for Lisp Programmers, and tries to help Lisp hackers map concepts they know on to Python. It also works in the reverse direction. There are also a few microbenchmarks, as well as a bunch of things that will trip up Lispers coming to Python.

The second page is called Retrospective on Paradigms of AI Programming and includes reflection on whether or not Lisp is still unique.

Those who commented on the Lunacy post left behind some other interesting tidbits. I've taken some of the links and reproduced them here. One of the things that interested me about Lunacy was the possibility of turning the decades of Lisp compiler research towards improving the performance of Python. Unfortunately, this pair of messages from Matthias Felleisen makes me a little less optimistic that this will be possible. The standard response to performance criticisms of Python is that you can always rewrite your code in C. Now, this is true, but I'd prefer not to rewrite working code if I can avoid it.

Bagley's Computer Language Shootout has some interesting micro benchmark results. Unfortunately, it hasn't been updated, so some of the numbers are out of date. If someone is looking for a worthy project to take on, reviving this would be great. It would be wonderful to keep it up as the various language communities improve their programs and implementations.

Here's Eric Raymond's account of how he discovered Python.

Lastly, there's Denys Duchier's on article continuations, which shows how to to continuations in Python by rewriting programs in continuation passing style. This is a good example for Python folks who are wondering what the big deal about continuations is.

[23:09] | [computers/programming/python] | # | TB | F | G | 7 Comments | Other blogs commenting on this post
This is a good example for Python folks who are wondering what the big deal about continuations is.

As someone who
routinely makes a <a href="http://beta4.com/seaside2>big deal</a> out of continuations, I'm not so sure.  For lots of applications, continuations only get interesting when they are first class, that is, when you can access the implicit continuations of your program rather than using closures or objects as explicit continuations.

Continuation passing style is a good way to try to wrap your head around a difficult concept, but I don't think it properly demonstrates the "wow" of call/cc.
Posted by Avi Bryant at Mon Feb 2 00:23:27 2004

Ted points out this essay intended to help Lisp dudes understand Python. "Python supports all of Lisp's essential features except macros, and..." ... so what's the point? Why are people so deeply suspicious of programing languages that provide solid tools to construct the program prior to compiling it? The language designers seem to feel that programmers shouldn't be allowed such tools. "Oh no son, you might hurt your self." The programmers fallen for this - "Right you are boss! Oh, could you shapen this stick for me, please?" For example here is an optional package in Common Lisp written so that it adds an amazingly powerful bit of functionality. It allows you to write programs where functions appear to generate a series of values. A suite of functions are provided to do things with these series such as generate, filter, compose them. This is very analagous to to the pipes of unix or similar constructs found in servers. But the important point is that this package conspires to rewrite the programs written in this functional notation into more traditional programs using loops. This rewriting is made possible because Lisp provides the tools to pick up your program at compile time chew on in and put it back down again before diving into the compiler; i.e. macros. This allows you to both to create micro-languages (or not so micro like the one above) that are problem specific. For example if you want a parser you don't need to invent a separate program like yacc to generate parsers you can do it in the native language. Syntax is not as important as ablity to revise the parse tree. It's incredibly sad watching the industry slowly but surely re-discover all the features in Lisp. One at a time usually about one a year....
Posted by
Trackback from Ascription is an anathema to any enthusiasm at Wed May 12 14:25:15 2004

You can subscribe to an RSS feed of the comments for this blog: RSS Feed for comments

Add a comment here:

You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are: <a href>, <em>, <i>, <b>, <blockquote>, <br/>, <p>, <code>, <pre>, <cite>, <sub> and <sup>.

You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk





Remember my info?

twl JPG


Ted Leung FOAF Explorer

I work at the Open Source Applications Foundation (OSAF).
The opinions expressed here are entirely my own, not those of my employer.

Creative Commons License
This work is licensed under a Creative Commons License.

Now available!
Professional XML Development with Apache Tools : Xerces, Xalan, FOP, Cocoon, Axis, Xindice
Technorati Profile
PGP Key Fingerprint
My del.icio.us Bookmarks
My Flickr Photos

RSS 2.0 xml GIF
Comments (RSS 2.0) xml GIF
Atom 0.3 feed
Feedburner'ed RSS feed

< February 2004 >
1 2 3 4 5 6 7
8 91011121314


Macintosh Tips and Tricks

Blogs nearby
geourl PNG

/ (1567)
  books/ (33)
  computers/ (62)
    hardware/ (15)
    internet/ (58)
      mail/ (11)
      microcontent/ (58)
      weblogs/ (174)
        pyblosxom/ (36)
      www/ (25)
    open_source/ (145)
      asf/ (53)
      osaf/ (32)
        chandler/ (35)
        cosmo/ (1)
    operating_systems/ (16)
      linux/ (9)
        debian/ (15)
        ubuntu/ (2)
      macosx/ (101)
        tips/ (25)
      windows_xp/ (4)
    programming/ (156)
      clr/ (1)
      dotnet/ (13)
      java/ (71)
        eclipse/ (22)
      lisp/ (34)
      python/ (86)
      smalltalk/ (4)
      xml/ (18)
    research/ (1)
    security/ (4)
    wireless/ (1)
  culture/ (10)
    film/ (8)
    music/ (6)
  education/ (13)
  family/ (17)
  gadgets/ (24)
  misc/ (47)
  people/ (18)
  photography/ (25)
    pictures/ (12)
  places/ (3)
    us/ (0)
      wa/ (2)
        bainbridge_island/ (17)
        seattle/ (13)
  skating/ (6)
  society/ (20)

[Valid RSS]

del.icio.us linkblog



Listed on BlogShares

Locations of visitors to this page
Where are visitors to this page?

pyblosxom GIF