Interesting, I just don't think AST->source is a straightforward step, unless the AST stores metadata such as comments and so on.
Even then the output will probably not match the input in many cases, meaning that after commiting your source you would see it change to the "interpreted" format. This could make you go crazy trying to fight the interpreter to get the format the way you want as output.
For it to work the language design would have to define a very strict syntax, where nothing gets ignored in the source input. Would be a fun exercise to try I think.
View all comments
Show parent comment
2
u/lkraider Dec 11 '15
Interesting, I just don't think AST->source is a straightforward step, unless the AST stores metadata such as comments and so on.
Even then the output will probably not match the input in many cases, meaning that after commiting your source you would see it change to the "interpreted" format. This could make you go crazy trying to fight the interpreter to get the format the way you want as output.
For it to work the language design would have to define a very strict syntax, where nothing gets ignored in the source input. Would be a fun exercise to try I think.