2 ms·
Yes, "compile time metaprogramming" or "static code generation" vs. "run-time metaprogramming" and "dynamic code generation" are used more often. Once you've g
by sklogic 11y ago
Yes, "compile time metaprogramming" or "static code generation" vs. "run-time metaprogramming" and "dynamic code generation" are used more often.
Once you've got proper macros, pretty much all the other language features can easily be implemented on top of them, so it makes much more sense to get the macros first instead of adding features one by one. I could never comprehend why the mainstream language designers are not doing it.
Syntax is not an obstacle for a proper macro system, as demonstrated by Template Haskell, Nemerle, Katahdin, PFront and the other meta-languages not based on S-expressions. The only thing you need is a quasiquotation for both constructing and pattern matching the ASTs, and it's possible to implement it for any syntax.
- wtetzner 11y ago> Syntax is not an obstacle for a proper macro system, as demonstrated by Template Haskell, Nemerle, Katahdin, PFront and the other meta-languages not based on S-expressions. Also see Honu[1], which effectively brings Racket's syntax-case into a curly-brace language. [1] https://www.cs.utah.edu/~rafkind/papers/honu-2012.pdf https://www.cs.utah.edu/~rafkind/papers/honu-2012.pdf
- sklogic 11y agoThanks! Did not know of this one.