Python syntax in Lisp and Scheme

Grzegorz Chrupała grzegorz at pithekos.net
Fri Oct 3 13:59:16 EDT 2003


Alex Martelli wrote:

> Guido's generally adamant stance for simplicity has been the
> key determinant in the evolution of Python.  Guido is also on
> record as promising that the major focus in the next release
> of Python where he can introduce backwards incompatibilities
> (i.e. the next major-number-incrementing release, 3.0, perhaps,
> say, 3 years from now) will be the _elimination_ of many of
> the "more than one way to do it"s that have accumulated along
> the years mostly for reasons of keeping backwards compatibility
> (e.g., lambda, map, reduce, and filter, which Guido mildly
> regrets ever having accepted into the language).

I have some doubts about the notion of simplicity which you (or Guido) seem
to be taking for granted. I don't think it is that straightforwrd to agree
about what is simpler, even if you do agree that simpler is better. Unless
you objectivize this concept you can argue that a "for" loop is simple than
a "map" function and I can argue to the contrary and we'll be talking past
each other: much depends on what you are more familiar with and similar
random factors.

As an example of how subjective this can be, most of the features you
mention as too complex for Python to support are in fact standard in Scheme
(true lexical scope, implicit return, no expression/statement distinction)
and yet Scheme is widely regarded as one of the simplest programming
languages out there, more so than Python.

Another problem with simplicity is than introducing it in one place my
increase complexity in another place.
Specifically consider the simple (simplistic?) rule you cite that Python
uses to determine variable scope ("if the name gets bound (assigned to) in
local scope, it's a local variable"). That probably makes the implementor's
job simpler, but it at the same time makes it more complex and less
intuitive for the programmer to code something like the accumulator
generator example -- you need to use a trick of wrapping the variable in a
list.

As for Ruby, I know and quite like it. Based on what you tell me about
Python's philosophy, perhaps Ruby makes more pragmatic choices in where to
make things simple and for whom than Python. 

-- 
Grzegorz
http://pithekos.net




More information about the Python-list mailing list