by randomdata · 8y ago · 0 comments
But, I must say, I do really like that Go makes the AST a first-class citizen and a core part of the standard library. While not strictly a Go thing, in the languages I usually find myself programming in you have to rely on third-party implementations of varying degrees of quality or, even more common from what I see in the wild, messy string building. Being able to focus on generating the tree and have the built-in printer generate the code in the format that Go users expect is a much nicer way to generate code.
Seconded. But I wish they would go one step further and make its compilation / code generation a first-class citizen too, including dynamic loading of generated code.
The .NET framework has had it for a while, but it got removed in .NET Core.