Hacker News new | ask | show | jobs
by tancop 42 days ago
Metaprogramming with ASTs is the second worst way to do it after string manipulation.

Everyone should be using an IR like C# source generators. It's a lot faster to process, more stable and more intuitive because it maps closer to the language semantics instead of surface level syntax. And then you don't need a simple syntax at all.

1 comments

metaprogrammin is not only about decorating code written by hand, but a lot more, e.g. introducing DSL's that integrate with the rest of the language.

anything that transforms the source code in a lossy way is an obstacle to that.