DISCLAIMER: I am not a zealot. I like a lot of languages, Python and Ruby among
them.

That said, there seem to me to be a number of people on this newsgroup who are
comparing Ruby against outdated versions of Python. This can be amusing, but is
not very helpful. Python's been going through a growth spurt recently and has
rectified (or begun rectifying) its most serious shortcomings. Here's a list of
some of the things people have mentioned:

1. Scoping/closure/etc. Python is infamous for its lack of nested scoping. Used
to be, that is. Proper nested scoping is optional in 2.1 and required in 2.2.

2. The type/class dichotomy. Under Python, some of the built-in types (lists,
dictionaries, etc.) are not made of the same stuff as user-defined classes, and
cannot be subclassed. This is being addressed now, however, it's not waiting for
Python3000. Python 2.2 takes significant steps toward healing this rift - you can
now subclass builtin types, and builtin types behave mostly like classes. It's
not perfect, but they're not done yet either.

3. Metaclasses. Python has had real metaclasses since at least 1.52, but they're
not widely publicized. They are available though, and do work, both in Python and
Jython.

4. Everything that's intrinsic to a class is defined in the class. Don't be
confused by builtin functions like len(), they're just shorthand for
someobject.__len__(), which can be overridden as desired. Python has always
worked this way.

5. While Python does *not* enforce  a messaging paradigm on objects (you can get
and set raw variables on objects), it's always an option to make your objects
this way (though it requires slightly more work), and 2.2 provides the getset()
method modifier to help with this sort of thing. 2.2 also provides static (i.e.,
class) methods, which many folks have been wanting for a while now.

6. Ruby iterators don't provide much that lambdas or function closures don't.
What they do provide is also covered in Python 2.2, which supports iterators and
generators.

My two cents on the advantages Ruby should be pushing if it wants to make
converts:

1. C API. This is much cleaner and simpler than Python's, I think.
2. Despite 5, above, Ruby does enforce a messaging-only access to objects, which
is cleaner, IMHO.
3. Some people will always hate Python's syntax (personally I think it's sublime,
but then I think Haskell is cool, too).

I'm not trying to provoke anyone, just to point out that Ruby's
technical/cleanliness 'lead' on Python is a lot shorter than most people here
seem to think. I hope this can lead to honest understanding, rather than
straw-man arguments.

Hope this helps,

Bryn

Mark Nenadov wrote:

> Hello. I have toyed with the idea of trying Ruby out for some time now.
> However, I have not found any major feature that puts it enough above Python.
> Most of the differences I have come across (in "comparison with other
> languages") seem to be pretty insignificant (minor differences) in terms of
> selecting a language to use for major projects.
>
> Is there any sort of effort to port Ruby to the Palm's? Does the Ruby
> community have any sort of mechanism for Enhancement Proposals (such as
> PEP for Python)?
>
> The "comparison with other languages" states that "Ruby is "often faster
> than Python". Is this documented anywhere? Could someone provide me with
> some specific examples where Ruby would be faster than Python? If Ruby
> was drastically faster than Python, that may be a good "selling point" in
> my eyes.
>
> In the interview with the Programming Ruby authors, they say "Ruby will
> overtake Python within four years". On what basis do you supose they make
> this claim? What is the most obvious driving force that they feel will
> cause this change?
>
> Anyways,  I look forward to getting some mor information on these matters.
>
> --
> ~Mark Nenadov (author/editor for http://www.coffeecode.com)