DIP 50 - AST macros
Jacob Carlborg
doob at me.com
Thu Nov 14 11:18:54 PST 2013
On 2013-11-14 19:23, Andrei Alexandrescu wrote:
> FWIW Walter talked me back around 2005-2006 into abandoning my own ideas
> about languages with configurable syntax.
>
> There are quite a few failings about comparing programming languages
> against natural languages, but here's one that I think does have value:
> fixed syntax is ingrained into people's notion of language, and swapping
> syntax within an otherwise identical linguistic context is extremely
> taxing on the brain. Anyone who's read with a C or C++ codebase full of
> macros and #if-driven code can attest how unbelievably difficult
> juxtapositions of the normal syntax with preprocessor syntax can quickly
> become. That's part of why "static if" has been so successful in D - it
> drives new semantics but within the same syntax.
AST macros cannot change the syntax or introduce new syntax. C
preprocessor macros and AST macros are not the same. I'm starting to
regret that I called it "macros".
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list