Phil Windley's DSL adventures

Phil Windley has has a new startup, and he is documenting some of aspects of their design process (business and technical) on his blog. For us the nice part is that he is building a DSL. Here is an explanation why building a DSL makes sense (not that we need one, over here, but still a nice analysis). And here is a discussion of high order perl and parsing.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

A useful tip

One thing Phil did, which is pretty straightforward, but is a useful technique that is worth mentioning is to test case the parser by using a pretty printer. If the result of a round trip through the parser and pretty printer matches the original program (modulo whitespace) the test is successful.

Left inverse

Why not removing this "modulo" clause, and just check that parsing the result of pretty printer is the same AST? As an added bonus, all correct ASTs are easier to generate than all correct texts of programs (unless you cheat and use pretty printer).
The only thing you don't test in this case is treatment of whitespace, of course :)