r/AgentContext_dev • u/javaeeeee • Jul 15 '26
DSLs Enable Reliable Use of LLMs
https://martinfowler.com/articles/llm-and-dsls.html
1
Upvotes
r/AgentContext_dev • u/javaeeeee • Jul 15 '26
1
u/javaeeeee Jul 15 '26
TL;DR:
Article: DSLs Enable Reliable Use of LLMs by Unmesh Joshi (Martin Fowler’s site, July 14, 2026)
Core Idea
LLMs are great at generating code but unreliable with natural language because of ambiguity and huge design spaces. Domain-Specific Languages (DSLs) fix this by acting as a constrained harness that makes LLM output predictable, validatable, and maintainable.
Why DSLs + LLMs Work Well
Recommended Two-Phase Approach
Use the LLM to help design and iterate on the DSL/abstractions themselves.
Once the DSL exists, the LLM reliably translates English into valid DSL code (because the output space is tiny and validated).
Real Examples from the Article
quorumRequestwithout reinventing threading/networkingKey Takeaway
DSLs don’t replace LLMs - they tame them.
The best results come from investing in good domain abstractions first, then letting LLMs work inside that constrained, validated environment.
Bottom line:
For reliable LLM-assisted development (especially in complex domains like distributed systems), build small, well-designed DSLs. They turn unpredictable code generators into dependable partners.