Skip to content

Comment on Ask HN: Suggestions for Building a Code Generation

Comments

Usually you would want to use a CST for this task as opposed to an AST to preserve white space. comments, and structure during the generation. There's not a ton of tools that are designed to handle that for polyglot tools, tree-sitter is one (but it's a parser generator and not a code generator).

I think it would be easier to write for one language rather than N at first.

yes, I'd go with one language first, but I wasn't sure if it's best to go with AST/CST or with a templating language first

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.