Why is Python popular, while Lisp and Scheme aren't?
Alex Martelli
aleax at aleax.it
Thu Nov 21 12:53:45 EST 2002
Kenny Tilton wrote:
> Alex Martelli wrote:
>> Macros let you design a different language on top of whatever language
>> you have (that supports full-power macros). That's my major beef with
>> them,...
>
> different bad, additional good. :) ie, don't use macros to come up with
I disagree that the ability to make a language bigger is generally good.
It may be in the hands of a highly skilled language designer. But far
too many people who aren't fancy themselves to be. I'm happier to work
in a language where I don't have to struggle with THAT.
> a better keyword than IF, use it to add something new to the language.
>
> My Cells project does sick things with CLOS, and all with a couple of
> macros. Instead of DEFCLASS I have DEFMODEL which does a ton of stuff
> with which the user /really/ need not be concerned. But without macros I
> either have to buy a Lisp vendor and change the language, or cut and
> paste huge wadges of internal wiring to make a new class, carefully
> working through it changing all FOOs to BARs.
>
> Well, tell you what, if I manage to port Cells to Python we'll be able
> to compare. Possibly some cool Python feature will offset the loss of
> macros. Metaclasses?
It depends on what all you're doing in your defmodel macro. There
_are_ language additions, as well as modifications, that macros can
do and OO mechanisms can't, exactly because OO mechanisms don't let
you change the language -- not even metaclasses, of course.
I'm hard put to think of something I'd *want* to do, apart from
syntax sugar and control structures, that would fall under that
classification, but there must be SOME thing or other, of course:
no language is perfect, so the temptation to change it "for the
better of course" would always be there if I had macros.
That's why I'm happier not to have them.
Alex
More information about the Python-list
mailing list