|
|
|
|
|
by d110af5ccf
1779 days ago
|
|
> Anytime macros are used for metaprogramming, it's time to reach for a more powerful language. > I'm referring to both syntax based (AST) macros ... This surprises me greatly. Various lisps are among the most powerful languages I know of and a large part of the reason is macros coupled with their ability to execute arbitrary code at compile time (which itself uses additional macros, which in turn invoke more code, and so on). What's your take on this? (Continuations are also pretty nice ...) |
|
I've seen this happen with assembler macro languages, too.
> most powerful
It's like putting a 1000 hp motor in a car. It's main use is to wreck the car and kill the driver.
BTW, D is the first language of its type (curly brace static compilation) to be able to execute arbitrary code at compile time. It started as kind of "let's see what happens if I implement this", and it spawned an explosion of creativity. It has since been adopted by other languages.