What are AST Macros?
Don
nospam at nospam.com
Tue Jul 13 00:58:50 PDT 2010
Rainer Deyke wrote:
> On 7/13/2010 01:03, Nick Sabalausky wrote:
>> "Rainer Deyke" <rainerd at eldwood.com> wrote in message
>> news:i1gs16$1oj3$1 at digitalmars.com...
>>> The great strength of string mixins is that you can use them to add the
>>> AST macros to D. The great weakness of string mixins is that doing so
>>> requires a full (and extendable) CTFE D parser, and that no such parser
>>> is provided by Phobos.
>> Seems to me that would lead to unnecessary decreases in compilation
>> performance. Such as superfluous re-parsing. And depending how exactly DMD
>> does CTFE, a CTFE D parser could be slower than just simply having DMD do
>> the parsing directly.
>
> True. I tend to ignore compile-time costs. The performance of computers
> is increasing exponentially. The length of the average computer program
> is more or less stable. Therefore this particular problem will
> eventually solve itself.
>
> Of course, this is just my perspective as a developer who uses a
> compiler maybe twenty times a day. If I was writing my own compiler
> which was going to be used thousands of times a day by thousands of
> different developers, I'd have a different attitude.
>
>
CTFE isn't intrinsically slow. The reason it's so slow in DMD right now
is that the treatment of CTFE variables is done in an absurdly
inefficient way.
More information about the Digitalmars-d
mailing list