3 ms·
I think every language (DSL or not) should support translation to/from a simple data representation for its syntax trees (whether s-expressions, JSON, XML, etc.
by chriswarbo 3y ago
I think every language (DSL or not) should support translation to/from a simple data representation for its syntax trees (whether s-expressions, JSON, XML, etc.). Not necessarily the same representation, but just something structured that existing tools can walk and transform, such that (a) we don't resort to grepping through bytes (and manually filtering out matches that are comments or strings) and (b) adding a keyword to a language won't break all existing tooling that's unable to parse it.
I wrote about this at http://www.chriswarbo.net/blog/2017-01-31-syntax_trees.html http://www.chriswarbo.net/blog/2017-01-31-syntax_trees.html