What's better about Ruby than Python?

Doug Tolton dtolton at yahoo.com
Mon Aug 18 19:08:04 EDT 2003


On Mon, 18 Aug 2003 15:17:03 -0700, Erik Max Francis <max at alcyone.com>
wrote:

>My view of this is that if you really want to do this, you're better off
>inventing a separate language -- however similar to Python -- and using
>a processor to turn that language into real Python, which can then be
>interpreted.  In an interpreted language, especially one as dynamic as
>Python, translation often strikes me as superior to incorporating
>macros.

That's IMO the only real issue that would preclude Macro's from being
in Python.  I wonder how slow they would really be though, the way
they are implemented in Lisp makes them pretty dang fast though, even
when interpreted.

Although if speed were your main issue, you really wouldn't be
programming in Python in general at this point.  Python is
significantly slower than natively compiled Java, C.

Clearly the reason people use Python isn't for ultra-high performance.
So even though Macros are a performance hit, they probably wouldn't
impact performance as much as people think, and even if they did
affect performance for some things, they typically wouldn't be speed
critical sections of code anyway (ie, don't use them in speed critical
sections)

Allowing Macros makes it very easy to write an interpreter yes,
however I don't think that is the only or even necessarily the primary
reason for Macro's.  Macro's allow you to embody common high level
idioms into a similarly clean statement or expression.

Using Python at all we are trading cpu cycles for higher level
abstractions and better programmer productivity.  Why not add Macro's
allowing those of us who know how to use them and like them to use
them.  If you hate macros, or you think they are too slow, just don't
use them.  They don't change the underlying language, they just add a
more useful abstaction capability into the language.


Doug Tolton
(format t "~a@~a~a.~a" "dtolton" "ya" "hoo" "com")




More information about the Python-list mailing list