do...until wisdom needed...

Douglas Alan nessus at mit.edu
Mon Apr 16 19:53:18 EDT 2001


"Alex Martelli" <aleaxit at yahoo.com> writes:

> "Douglas Alan" <nessus at mit.edu> wrote in message

> > "Alex Martelli" <aleaxit at yahoo.com> writes:

> > > Exact syntax sugar could be endlessly (and fruitlessly) debated, but
> > > the general idea might be:

> > Python should have procedural macros like Lisp.  Then whenever anyone
> > asks a question about why Python doesn't have syntactic feature xyzzy,
> > the answer can always be, "You can already do what you want by loading
> > the following macro...."

> Yes, 'hygienic macros' WOULD help cut these discussions short.  Pity
> this benefit (basically restricted to c.l.p) would be balanced by
> the productivity loss engendered by the actual existence of such
> macros in the language -- a language which may have ANY 'syntactic
> feature' ensures any given program is impossible to understand
> unless you first study the exact set of macros used by its
> author:-).

What happened to giving programmers enough rope to hang themselves?
What happened to the desire for flexibility and expressive power?

Sure, macros are a long rope, but some tasks require a long rope.
Take a look at Guy Steele's maxim that a large language is impossible
to design well, but a small language is doomed to die.  A language
needs to be able to grow over time.  Procedural macros in Lisp allowed
Lisp to continue to evolve over time, so that even though it was
invented in the '50's, it remains today one of the most modern of
languages.  It was able to do this, in part, by allowing every user to
experiment with adding language features, not just the language
Illuminati.

And macros don't ensure that *any* given program is impossible to
understand -- it only helps nutty programmers make programs that are
impossible to understand.  Conversely, macros can help wise
programmers in making programs that are shorter, easier to understand,
easier to code, and easier to maintain.

|>oug



More information about the Python-list mailing list