November 26th, 2024

Stop Torturing Your Colleagues with DSLs

The article critiques Domain-Specific Languages (DSLs) for complicating development, suggesting well-designed libraries as more efficient alternatives that offer similar functionality without steep learning curves and maintenance issues.

Read original articleLink Icon
Stop Torturing Your Colleagues with DSLs

The article critiques the use of Domain-Specific Languages (DSLs) in programming, arguing that they often complicate rather than simplify development processes. While DSLs may seem appealing as specialized tools, they typically create significant challenges, including steep learning curves, maintenance difficulties, and communication barriers. The author emphasizes that only a few developers, those who created the DSL, can effectively navigate these languages, leaving others stranded with complex and poorly designed systems. Furthermore, the departure of DSL creators can lead to a loss of crucial knowledge, exacerbating the issues for remaining team members. Instead of creating a new DSL, the author suggests that developers should consider using well-designed libraries, which can provide similar functionality without the associated costs of learning and maintenance. Libraries built on general-purpose languages also benefit from broader community support, making them more accessible and efficient. The article concludes with a call for developers to reconsider the necessity of DSLs and to prioritize practical, straightforward solutions that do not burden their colleagues.

- Domain-Specific Languages (DSLs) often complicate development rather than simplify it.

- Only a few developers can effectively use DSLs, leading to knowledge gaps when creators leave.

- Well-designed libraries can provide similar functionality without the steep learning curve of DSLs.

- Libraries benefit from community support, making them more efficient and accessible.

- Developers should critically assess the need for DSLs before creating them.

Link Icon 5 comments
By @corinroyal - 5 months
DSLs are not a new or a bad thing. We use them everyday. SQL, HTML, CSS, JSON, Postscript, Markdown, YAML, Latex, and GNU make are all DSLs. The job of a programmer is to come up with thoughtful composable abstractions, a vocabulary of nouns and verbs, that match how experts tend to think about the problem domain. That's all I do all day. Imagine SQL as a library. Sorry, I meant don't.

Perhaps the difference is that my DSLs are hosted on Lisp, so inherit that syntax. The nouns and verbs I create extend the standard library transparently. There is nothing to learn but the vocabulary. So perhaps programmers who aren't confident about language design should avoid creating DSLs that aren't hosted on a good general purpose language. Everyone else should write DSLs on top of Lisp the way God and John McCarthy intended.

By @NikkiA - 5 months
Sorry, I couldn't read this beyond the AI slop image at the start.
By @p_l - 5 months
TL;DR if you make a DSL, do it right.

Which probably requires making them in a language that is prone to extensibility to so you can just reuse existing tooling.

Instead a lot of DSLs happen the way IBM JCL happened - it was explicitly not supposed to be in any way a programming language, was to be fully declarative, but it quickly evolved beyond that creating the monster some of us know.