Hacker News new | ask | show | jobs
by rswail 550 days ago
Store ASTs in git instead of text, "reconstruct" the text when displaying to the developer and roundtrip.

Add some execution context and annotations to the AST and you could even do "git blame" in your debugger.

1 comments

code can be thought of as serialized ast, and you need to serialize ast somehow anyways for storage
Yes and no, code comes with affordances like whitespace and comment layouts that are for humans that are unnecessary excess for ASTs.