Building TexLab and IRWorks, we kept running into the same thing: the same sample's same test data needs to be emitted as reports across multiple national standards — ISO, AATCC, ASTM, GB, JIS.

We started with the naivest approach: one Word template per standard, with field mappings maintained by hand. It broke quickly — past about 10 standards, any field change detonated a combinatorial explosion of edits across a dozen templates.

The second pass split templates into three layers. A data layer for raw instrument output. A methods layer for the calculation differences each standard imposes on the same metric. A layout layer for the human-readable Word / PDF output. Each layer evolves independently, glued together by a lightweight DSL.

The DSL itself is nothing fancy — its value lies in being just expressive enough. Too weak and you end up writing code around it; too strong and it becomes another programming language. Our current version has about 30 keywords and covers 90% of report scenarios.

The deeper lesson: for compliance software, choosing the right level of abstraction matters more than the length of the feature list. Adding a new standard should take hours, not days.