What's better about Ruby than Python?
adalke at mindspring.com
Tue Aug 19 02:16:07 CEST 2003
> I don't agree at all. Yes when you are defining a macro you are in
> essence defining a new mini-language. This is perhaps one of the most
> powerful features of Lisp. Programming closer to the application
> domain, *greatly* enhances both the readability and the reusability of
For that domain. And rarely does the author of a package,
much less a macro, understand "the domain as understood by other
people" vs. personal understanding.
This topic has come up before. Laura Creighton made several
comments on macros, the most notable of which is:
] Writing your own Lisp Macro System is better than sex. I
] _know_ -- 18 year old me turned down _lots_ of opportunities
] for sex to go hack on her macro system. Thus if we introduce
] this to the language, I think that it is _inevitable_ that we will
] fragment the Python community into a plethora of mutually
] unintelligble dialects. I don't want this. Thus I don't want a
] macro facility in the language _because_ it would be so cool.
> That doesn't mean it *shouldn't* be available [in Python].
> Python is Open Source, how would someone writing a
> Macro lock you in? Just don't use the macro.
Another writing from Laura seems relevant:
My interepretation - I don't customize my apps, nor even
my .cshrc (except for one alias (alias ls 'ls -l \!* | grep ^d')
an 'unset noclobber', 'set ignoreeof', and the PATH and
LD_LIBRARY_PATH - and I wish I didn't need those)
I don't, because I don't like to think. At least not spend my
time puzzling out slight changes. I like my changes either
none or a lot, that is, use Python as-is or write a converter
(or use another language).
> Just like anything else, Macro's can be over used and abused. However
> I maintain that if you don't see the usefulness of macros, you don't
> really understand them.
That's not the argument against them. It's that they are too useful,
each person makes their own dialect, the community breaks down
as the different branches do their own thing, and one person's so-
called "Python" code looks different than another's.
I know I am nowhere near as good a language designer as Guido,
Larry Wall, Matz, and the others, though I think I'm pretty decent.
I don't have the essential hubris to say that I know better how
to tweak Python-the-language to fit my own domain.
> Essentially using Python over Machine
> language is just using one big ass macro language.
You confuse two meanings of the word 'macro' here.
Any assembly language worth its salt has "macros", which
are pre-assembled sets of code. Use the macro and it
generates the code. But you can't use those macros to
rewrite the actual language like you can with hygenic
macros. It doesn't have the proper tail-biting recursive nature.
dalke at dalkescientific.com
More information about the Python-list