[bitc-dev] Macro removal rationale
Michael Weber
michaelw at foldr.org
Thu Jul 20 12:17:57 EDT 2006
* "Jonathan S. Shapiro" <shap at eros-os.org> [2006-07-20T12:04-0400]:
> In the end, there were three factors:
>
> 1. My conclusion that building a "clean" macro system (one that does not
> capture the wrong identifiers) is extremely tricky and the result tends
> to be hard to use.
This is a little surprising. The Scheme community spent quite some on
this, and one would have thought that there is a suitable compromise.
> 2. My observation that there were few good motivating cases for macros
> in a language that supports inlining properly.
Macros for inlining is abuse, I would say. Proper use of macros
includes creating new syntactic abstractions, basically to make a
language extensible.
Canonical example: how long did Java have to wait for support for
simplified iterators? (Schemers/Lispers would just write a macro for
that, no vendor intervention needed)
> 3. Mark Miller's observation that macros obscure readability by making
> it harder to understand what the code in front of you actually does.
Macros also ensure that, e.g., resources are properly freed, leaving
no room there for errors. Examples: WITH-OPEN-FILE and friends.
Cheers,
Michael
More information about the bitc-dev
mailing list