reflection based on my experience so far on compile-time meta-programming in D as a novice user: the problems

mw mingwu at gmail.com
Mon Sep 14 07:32:39 UTC 2020


On Monday, 14 September 2020 at 07:15:14 UTC, Dominikus Dittes 
Scherkl wrote:
> Yes, and each has its limitations and the compiler checks that 
> everything is syntactically correct.

Well, the mechanism is so hard to use that I cannot even write 
compile-able code, guess this also saving the compiler's trouble 
to check it.


> ... where you can put everything including destroying the 
> language, and the compiler never sees it and so can't check for 
> any kind of correctness.

This is not true, the generated code will be eventually compiled 
and checked by the compiler on the 2nd pass.

> I'm really happy to not have to deal with write-only macros 
> anymore.

I know what you are talking about: all the code generation & 
compilation in one pass, and you can't read the intermediate 
generated code.

But my usage here is to generate the code, and read for easy 
debug.



More information about the Digitalmars-d mailing list