On 11/13/2013 5:56 PM, deadalnix wrote:
I think the whole point of macro is to NOT add too much feature to the language.

See for instance the example I gave before to create generator. This can be
added with extra language support (C# async/await is an example). But with
macro, the feature can be implemented as a library.

It is NOT achievable with expression templates.

I can say with certainty that the async/await mechanism is heavily used in some
codebases and with great benefit. It is being added to all languages one after
another.

I agree that async/await has to eventually be added to D. I'm not convinced it can or should be done with AST macros.


The idea behind macros is that instead of adding new feature to the language,
the language should propose a toolkit to build these features as library.

I do understand this. I've not only extensively used macro systems, I've designed two successful ones and implemented other peoples' designs.

I've also seen the sheer awfulness of what happens with these systems over the long term. The fascinating thing about this awfulness is people are well aware of it in everyone's macro libraries but their own.


I don't think the time has come for macros in D. As discussed before, it seems
like filling the gap in existing feature is more important than adding new ones.
This should however be considered very seriously when the gaps has been filled.

Reply via email to