A software engineer who led development of the IRS Tax Withholding Estimator shares lessons about using XML as a domain-specific language (DSL) for encoding US tax law. The project uses a declarative 'Fact Dictionary' in XML to represent tax calculations as a dependency graph, rather than imperative code. The post argues that XML's verbosity is outweighed by its benefits for DSLs: it handles arbitrary nested expressions better than JSON, supports comments and sane whitespace, and comes with a universal tooling ecosystem (XPath, shell tools) that enables powerful ad-hoc querying and debugging without touching the core implementation. The author compares XML to JSON, YAML, s-expressions, Prolog, and KDL, concluding that while alternatives may look nicer, XML's cross-platform parser availability and mature tooling make it the cheapest DSL to build on.
Sort: