Python vs. Io

Erik Max Francis max at alcyone.com
Fri Jan 30 03:24:40 CET 2004


Daniel Ehrenberg wrote:

> Neither the each function nor the map function were built in (Io has
> other mechanisms for that kind of thing, but they are less efficient).
> Can anyone show me how to so much as alias "for" to "each" in Python
> or allow block syntax at all without hacking the C source code?

No, you cannot introduce new special forms (i.e., statement syntax) in
Python without modifying the Python interpreter itself.

There are two major camps in language design.  One says that you should
be able to modify the language itself to your will, and the other says
that this gets rapidly confusing and you shouldn't.  They're simply
different camps, and the two camps won't agree.  Furthermore, the
ability to convert a language from the second camp to the first is not
without difficulty; such things usually have to be designed into the
language from the scratch, or you end up with a very complicated process
of creating hygienic macros.

This is a situation where Io is in the first camp and Python is in the
second.  They simply don't have equivalent goals; Python emphasizes
transparency and readability more than customizability and flexibility,
whereas Io does the opposite.

> Io doesn't use __methods_with_this_annoying_syntax__ because nothing
> is supposed to be for internal use only and there are only about three
> functions that would cause a problem if overridden.
> 
> For embedding, Io doesn't have to use Py_ALL_CAPS, instead it just
> uses IoCamelCase, which looks much better. Interfaces to C are much
> more object oriented.

These are really stylistic objections, as are the other objections you
list below.  That's completely fine, of course; you should choose a
language that jives with your personal sense of language style.  But
language designers need to make decisions, and those decisions are
necessarily going to eliminate some styles of programming, while
emphasizing others.

You're in a situation where it sounds like Io jives with your sense of
style more than Python.  That's perfectly fine, and I know from my own
research that Io is a neat little language (though I haven't really used
it for anything substantial yet).  But you can't expect other languages
to bend to your personal will and personal sense of style, particularly
when it means necessarily violating someone else's corresponding senses.

Io and Python have quite different fundamental approaches to language
design, and so it's not surprising that there are going to be
irreconcilable differences.

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
\__/ The only completely consistent people are the dead.
    -- Aldous Huxley



More information about the Python-list mailing list