HeadlinesBriefing favicon HeadlinesBriefing.com

XML as a Cheap DSL in IRS Tax Estimator

Hacker News •
×

The IRS's new Tax Withholding Estimator (TWE) project, built using XML, reveals XML's unexpected utility as a declarative specification language. This open-source tool, free for taxpayers, calculates withholding amounts based on income and deductions. At its core lies the Fact Graph, a logic engine processing XML configurations defining tax rules.

A sample XML fact for calculating total owed taxes shows the structure: it subtracts total payments from total tax. While verbose, the nesting is clear. The system contrasts with JavaScript's imperative approach, which loses intermediate steps.

The author argues XML's declarative nature, despite verbosity, is crucial for complex, cross-platform tax logic where clarity and state preservation matter more than brevity.