"I'd argue the right approach, is to write a DSL to handle the problem." <-- I think you've found the hook for your chapter :)