← Back to context

Comment by MarkSweep

5 hours ago

There is a middle ground between using XML and imperative code for representing tax forms. Robert Sesek’s ustaxlib [0] uses JavaScript to encode the forms in a way that is reasonably statically analyzable. See the visualizer [1]. My approach uses XML to represent the forms with an embedded DSL to represent most expressions tersely. See for example Form 8960 in ustaxlib [2] and my TaxStuff program [3]. The main thing that the XML format from the article has going for it is that it is easy to write a parser for. But it is a bit verbose for my taste.

[0]: https://github.com/rsesek/ustaxlib

[1]: https://github.com/rsesek/ustaxviewer

[2]: https://github.com/rsesek/ustaxlib/blob/master/src/fed2019/F...

[3]: https://github.com/AustinWise/TaxStuff/blob/master/TaxStuff/...

For what it's worth, I think that an embedded DSL to represent most expressions tersely is a worthwhile idea to explore—it's just a more expensive one. That's a cost-effective choice at a some levels of resourcing, but not every level of resourcing.