LLMs pose an interesting problem for DSL designers

gopiandcode | 199 points

The title should be "DSLs pose an interesting problem for LLM users".

It is significant that LLMs in coding are being promoted based on a set of promises (and assumptions) that are getting instantly and completely reversed the moment the technology gets an iota of social adoption in some space.

"Everyone can code now!" -> "Everyone must learn a highly specialized set of techniques to prompt, test generated code, etc."

"LLMs are smart and can effortlessly interface with pre-existing technologies" -> "You must adopt these agent protocols, now"

"LLMs are great at 0-shot learning" -> "I will not use this language/library/version of tool, because my model isn't trained on its examples"

"LLMs effortlessly understand existing code" -> "You must change your code specifically to be understood by LLMs"

This is getting rather ridiculous.

romaniv | an hour ago

Good to see more people talking about this. I wrote about this about 6 months ago, when I first noticed how LLM usage is pushing a lot of people back towards older programming languages, older frameworks, and more basic designs: https://nathanpeck.com/how-llms-of-today-are-secretly-shapin...

To be honest I don't think this is necessarily a bad thing, but it does mean that there is a stifling effect on fresh new DSL's and frameworks. It isn't an unsolvable problem, particularly now that all the most popular coding agents have MCP support that allows you to bring in custom documentation context. However, there will always be a strong force in LLM's pushing users towards the runtimes and frameworks that have the most training data in the LLM.

NathanKP | 19 hours ago

I notice I am confused.

> Suddenly the opportunity cost for a DSL has just doubled: in the land of LLMs, a DSL requires not only the investment of build and design the language and tooling itself, but the end users will have to sacrifice the use of LLMs to generate any code for your DSL.

I don't think they will. Provide a concise description + examples for your DSL and the LLM will excel at writing within your DSL. Agents even moreso if you can provide errors. I mean, I guess the article kinda goes in that direction.

But also authoring DSLs is something LLMs can assist with better than most programming tasks. LLMs are pretty great at producing code that's largely just a data pipeline.

furyofantares | 18 hours ago

Good. I'll chalk that up as one of the positive effects LLMs have on the software development environment (god knows there are few enough).

DSL proliferation is a problem. I know this is not something many people care to hear, and I symphasize with that. Smart people are drawn to complexity and elegance, smart people like building solutions, and DSLs are complex and elegant solutions. I get it.

Problem is: Too many solutions create complexity, and complexity is the eternal enemy of [Grug][1]

Not every other problem domain needs its own language, and existing languages are designed to be adapted for many different problem domains. If LLMs help to stifle the wild growth of at least some DSLs that would otherwise be, then I am reasonably okay with that.

[1]: https://grugbrain.dev

usrbinbash | 4 hours ago

I am not a fan of DSLs. Perhaps there are use cases where they are the best tool, but in general they impose a significant learning burden on those who join a project that uses a DSL. I’ve seen several DSL projects wither and die because no one wanted to learn the DSL because the knowledge and time investment did not transfer forward to anything else they would do in the future. My personal opinion is that DSLs are vanity projects; one can usually come very close to DSL clarity and simplicity by adding appropriate methods or functions. You just don’t get fancy syntactic sugar.

Maybe DSLs are “write-only” languages for humans.

I don’t wish ill or sadness on anyone but it doesn’t bother me at all if LLMs drive DSLs into extinction.

efitz | an hour ago

I, too, wrote a rambling take on the potential for LLM-induced stack ossification about 6 months ago: https://paritybits.me/stack-ossification/

At the time, I had given in to Claude 3.5's preference for python when spinning up my first substantive vibe-coded app. I'd never written a line of python before or since, but I just let the waves carry me. Claude and I vibed ourselves into a corner, and given my ignorance, I gave up on fixing things and declared the software done as-is. I'm now the proud owner of a tiny monstrosity that I completely depend on - my own local whisper dictation app with a system tray.

I've continued to think about stack ossification since. Still feels possible, given my recent frustration trying to use animejs v4 via an LLMs. There's a substantial api change between animejs v3 and v4, and no amount of direction or documentation placed in context could stop models from writing against the v3 api.

I see two ways out of the ossification attractor.

The obvious, passive, way out: frontier models cross a chasm with respect to 'putting aside' internalized knowledge (from the training data) in favor of in-context directions or some documentation-RAG solutions. I'm not terribly optimistic here - these models are hip-shooters by nature, and it feels to me that as they get smarter, this reflex feels stronger rather than weaker. Though: Sonnet 4 is generally a better instruction-follower than 3.7, so maybe.

The less obvious way out, which I hope someone is working on, is something like massive model-merging based on many cached micro fine-tunes against specific dependency versions, so that each workspace context can call out to modestly customized LLMs (LoRA style) where usage of incorrect versions of your dependencies has specifically been fine-tuned out.

NiloCK | 14 hours ago

I recently had to work with the robot framework DSL. Not a fan. I hardly think it's any more readable to a business user than imperative code either. Every DSL is another API to learn and usually full of gotchas. Intuitiveness is in the eye of the beholder . The approach I would take is transpiling from imperative code to a natural language explanation of what is being tested, with configuration around aliases and the like.

darepublic | 20 hours ago

I've been thinking about the impact on visual programming. I've believed for a long time that any visual programming environment should have flawless round-tripping with a human readable/writable text representation (for many reasons - version control, automation, leveraging decades of tooling around text files, the fact that some tasks are just easier with text)

LLMs just add another reason to this list.

andybak | 5 hours ago

People often use the analogy of LLMs being to high-level languages what compilers were for assembly languages, and despite being a terrible analogy there's no guarantee it won't eventually be largely true in practice. And if it does come true, consider how the advent of the compiler completely eliminated any incentive to improve the ergonomics or usability of assembly code, which has been and continues to be absolute crap, because who cares? That could be the grim future for high-level languages; this may be the end of the line.

kibwen | 18 hours ago

In the LLM era, building a brand-new DSL feels unnecessary. DSLs used to make sense because they gave you a compact, domain-specific syntax that simple parsers could handle. But modern language models can already read, write, and explain mainstream languages effortlessly, and the tooling around those languages—REPLs, compilers, debuggers, libraries—is miles ahead of anything you’d roll on your own. So rather than inventing yet another mini-language, just leverage a well-established one and let the LLM (plus its mature ecosystem) do the heavy lifting.

jo32 | 12 hours ago

So many unsuccessful (for some definition of the word) pet projects are on GitHub. The code techniques employed there are valid, working software, that aren't found in CRM, CRUD, middleware or data entry software that makes up most of the world's portfolio to date and that makes them the most valuable addition to LLM training data. Arguing against making such projects is insanity.

loa_in_ | 2 hours ago

> Language Design Direction 1: Teaching LLMs about DSLs (through Python?)

This is what I've been focused on last few years with a bit of Direction 3 via

  python -> smt2 -> z3 -> verified rust
Perhaps a diffusion model for programming can be thought of as:

requirements -> design -> design by contract -> subset of python -> gc capable language (a fork of golang with ML features?) -> low level compiled language (rust, zig or C++)

As you go from left to right, there is an increasing level of detail the programmer has to worry about. The trick is to pick the right level of detail for a task.

Previous writing: https://adsharma.github.io/agentic-transpilers/

adsharma | 14 hours ago

Me thinking, is it time for a new 'programming' language for LLM to use instead of tools API calls? Something high level with loose grammar, in between natural language and strict programming. Then the backend, may be another smaller model, translates it in API calls. With this approach backend can be improved and updated much faster and cheaper then LLM model.

MoonGhost | 19 hours ago

We're making a prompting DSL (BAML https://github.com/BoundaryML/baml) and what we've found is that all the syntax rules can easily be encoded into a Cursor Rules file, which we find LLMs can follow nicely. DSLs are simple by nature so there's not too many rules to define.

Here's the cursor rules file we give folks: gist.github.com/aaronvg/b4f590f59b13dcfd79721239128ec208

aaronvg | 16 hours ago

Coincidentally, I released a DSL last week called Hypershell [1], a Rust-based domain-specific language for shell scripting at the type level. While writing the blog post, I found myself wondering: will this kind of DSL be easier for LLMs to use than for humans?

In an initial experiment, I found that LLMs could translate familiar shell scripting concepts into Hypershell syntax reasonably well. More interestingly, they were able to fix common issues like type mismatches, especially when given light guidance or examples. That’s a big deal, because, like many embedded DSLs, Hypershell produces verbose and noisy compiler errors. Surprisingly, the LLM could often identify the underlying cause hidden in that mess and make the right correction.

This opens up a compelling possibility: LLMs could help bridge the usability gap that often prevents embedded DSLs from being more widely adopted. Debuggability is often the Achilles' heel of such languages, and LLMs seem capable of mitigating that, at least in simple cases.

More broadly, I think DSLs are poised to play a much larger role in AI-assisted development. They can be designed to sit closer to natural language while retaining strong domain-specific semantics. And LLMs appear to pick them up quickly, as long as they're given the right examples or docs to work with.

[1] https://contextgeneric.dev/blog/hypershell-release/

maybevoid | 18 hours ago

I've been working on a programming language for about a year which aims to replace Bash for scripting but is far closer to Python. It's something I hope to see used by many other people in the future, but a very common objection I hear from people I pitch it to is "yeah but an LLM could just generate me a Python script to do this, sure it might be uglier, twice as long, and not work quite as well, but it saved me from learning a new language and is probably fine", to which I have lots of counters on why that's a flawed argument, but it still demonstrates what I think is an increase in people's skepticism towards new languages which will contribute to the stagnation the author is talking about. If you're writing a new language, it's demotivating to see people's receptiveness to something new diminish.

I don't blame anyone in the picture, I don't disagree that time saved with LLMs can be well worth it, but it still is a topic I think we in the PL community need to wrestle more with.

amterp | 18 hours ago

I've been drafting a blog post on this as well. My take is that programming langauges largely evolve around "human" ergonomics and solve for "humans writing the code", but that can result in code that is too abstract and non-performant. I think where LLMs will succeed (more) is in writing _very dumb verbose code_ that can be easily optimized by the compiler.

What humans look at and what an AI looks at right now are similar only by circumstance, and what I sort of expect is that you start seeing something more like a "structure editor" that expresses underlying "dumb" code in a more abstract way such that humans can refactor it effectively, but what the human sees/edits isn't literally what the code "is".

IDK it's not written yet but when it is it will be here: https://kylekukshtel.com/llms-programming-language-design

kkukshtel | 18 hours ago

> Let's start with what I see as the biggest problem that the introduction of LLMs is presenting to language design: everything is easier in Python.

This is so true.

A couple months ago I was trying to use LLMs to come up with code to parse some semi-structured textual data based on a brief description from the user.

I didn't want to just ask the LLM to extract the information in a structured format as this would make it extremely slow when there's a lot data to parse.

My idea was, why not ask the LLM to come with a script that does the job. Kind of "compiling" what the user asks into a deterministic piece of code that will also be efficient. The LLM just has to figure out the structure and write some code to exploit it.

I also had the bright idea to define a DSL for parsing, instead of asking the LLM to write a python script. A simple DSL for a very specific task should be better than using something like Python in terms of generating correct scripts.

I defined the DSL, created the grammar and an interpreter and I started feeding the grammar definition to the LLM when I was prompting it to do the work I needed.

The result was underwhelming and also hilarious at some times. When I decided to build a loop and feed the model with the errors and ask to correct the script, I ended up sometimes having the model returning back python scripts, ignoring completely the instructions.

As the author said, everything is easier in Python, especially if you are a large language model!

cpard | 12 hours ago

On the one hand, this sucks. On the other hand, we're already vacillating along the Pareto frontier of how much we can stuff into code; in fact, most of the criticisms of DSLs are indirectly stating just that.

So with LLMs making it easier to project back and forth between how programmer sees the task at hand, and the underlying dumb/straightforward code they ain't gonna read anyway, maybe we'll finally get to the point of addressing the actual problem of programming language design, which is that you cannot optimize for every task and cross-cutting concern at the same time and expect improvement across the board - we're already at the limit, we're just changing which time of day/part of the project will be more frustrating.

TeMPOraL | 19 hours ago

Unfortunately, English-as-a-programming-language * is now a thing and there will be a lot of bad/dangerous/untested code being used in real situations going forward.

* Not just English, substitute any other human language into the above

boznz | 19 hours ago

Programming languages researchers and designers labor under the mistaken assumption that programming practitioners--people who are writing programs to solve problems--actually want "a language with a syntax and semantics tailored for a specific domain", or any really fancy language features at all.

I say this from the perspective of someone who nearly became a PL researcher myself. I could easily have decided to study programming languages for my PhD. Back then I was delighted by learning about cool new languages and language features.

But I did didn't study PL but rather ML, and then I went into industry and became a programming practitioner, rather than a PL researcher. I don't want a custom-designed ML programming language. I want a simple general-purpose language with good libraries that lets me quickly build the things I need to build. (coughPythoncoughcough)

Now that I have reached an age where I am aware of the finiteness of my time left in this universe, my reaction when I encounter cool new languages and language features now my is to wonder if they will be worth learning. Will the promised productivity gains allow me to recoup the cost of the time spent learning. My usual assessment is "probably not" (although now and then something worthwhile does come along).

I think that there is a very real chance that the idea of specialized programming languages will indeed disappear in the LLM era, as well as the need for various "ergonomic" features of general purpose languages that exist only to make it possible to express complex things in fewer lines of code. Will any of that be needed if the LLM can just write the code with what it has?

jp57 | 19 hours ago

Using an LLM to generate code is not an easily traceable and explainable process. Using a DSL to same ends is. PL research has yet to meet explainability in AI head on.

oleks | 19 hours ago

Why care what others are doing? Just do what makes sense for your domain and don't worry about what is hot. Who cares?

If something is useful people will use it. Just because it seems like llms are everywhere, not everyone cares. I wouldn't want vibe coders to be my target audience anyway.

noobermin | 15 hours ago

Python is an acceptable though not perfect substrate for developing embedded DSLs. It's dynamic enough that you can do a lot of things. Besides operator overloading which is commonly used in C++ for eDSLs, you can even write decorators that take the AST, completely regenerate new code via LLVM or something similar. This is the approach used by numba for JIT for example.

In the end I think mentioning Python is a red herring. You can produce an eDSL in Python that's not in LLM training data so difficult for LLMs to grok, and yet still perfectly valid Python. The deeper issue here is that even if you use Python, LLMs are restricting people to use a small subset of what Python is even capable of.

kccqzy | 18 hours ago

It's it just me or does the graph of LLM language performance versus training set size show the opposite of what they are saying? To me it looks flat, implying training set size has little influence on LLM performance in the language. For instance some niche languages appear to out-perform better known languages (with more variance in the niche language performance).

chr15m | 15 hours ago

Depending on the size of a DSL all the more recent LLMs can be employed to work with them. LoRA/Finetuning are a heavier option, followed by RAG, and just setting them up as a big system prompt and caching. And once a model is able to work with a DSL tokens used in valuable code creation can dramatically drop.

outofpaper | 17 hours ago

I think designers will end up needing to work with an existing LLM or even provide their own LLM to get developers to adopt a new language/library/feature. The market has been heading in that direction for a while now, with developers expecting official docs and tutorials.

wolpoli | 16 hours ago

For LLMs, programming languages are basically additional languages that we speak. So how it handles low-resource programming languages is same as how it handles speaking languages with less contribution in training data?

DSL's would be even harder for LLM's to get right in that case compared to the low-resource language itself

prats226 | 19 hours ago

Python is just a beautiful, well-designed language - in an era where LLM's generate code, it is kind of reassuring that they mostly generate beautiful code and Python has risen to the top. If you look at the graph, Julia and Lua also do incredibly well, despite being a minuscule fraction of the training data.

But Python/Julia/Lua are by no means the most natural languages - what is natural is what people write before the LLM, the stuff that the LLM translates into Python. And it is hard to get a good look at these "raw prompts" as the LLM companies are keeping these datasets closely guarded, but from HumanEval and MBPP+ and YouTube videos of people vibe coding and such, it is clear that it is mostly English prose, with occasional formulas and code snippets thrown in, and also it is not "ugly" text but generally pre-processed through an LLM. So from my perspective the next step is to switch from Python as the source language to prompts as the source language - integrating LLM's into the compilation pipeline is a logical step. But, currently, they are too expensive to use consistently, so this is blocked by hardware development economics.

Mathnerd314 | 19 hours ago

In the same way LLVM is used to forward port low level optimizations to new languages, I wonder if LLMs can interpret new DSLs through the LLVM (or similar) lens and provide value.

I suppose this could be done now for all the existing languages that target LLVM and unify the training set across languages.

jayd16 | 20 hours ago

Replace “DSL” with “languages” in general - the same issues apply. I’m not sure that in a hypothetical timeline where Rust was released today, it would have gotten any traction.

nxobject | 15 hours ago

I guess if you love writing DSLs this is an unfortunate development, but for me it's more of a glass half full: I can have the AI spit out boilerplate I need to solve a problem instead of spending a week building a one-off DSL compiler.

jbellis | 19 hours ago

personally i think DSLs could be helpful if they are really good at: 1. explaining the syntax clearly 2. providing a fast checker that provides good error messages 3. prevents errors

LLMs seem pretty good at figuring out these things when given a good feedback loop, and if the DSL truly makes complex programs easier to express, then LLMs could benefit from it too. Fewer lines of code can mean less context to write the program and understand it. But it has to be a good DSL and I wouldn't be surprised if many are just not worth it.

dack | 19 hours ago

Since I work on a language professionally, I think about this all the time.

As someone who loves a wide diversity of actively evolving programming languages, it makes me sad to think those days of innovation may be ending. But I hope that's not going to happen.

It has always been the case that anyone designing a new language or adding features to an existing one is acutely mindful of what programming language knowledge is already in the heads of their users. The reason so many languages, say, use `;` for statement terminators is not because that syntax is particularly beautiful. It's just familiar.

At the same time, designers assume that giving users a better way to express something may be worth the cost of asking them to learn and adapt to the new way.

In theory, that should be true of LLMs as well. Yes, a new language feature may be hard to get the LLM to auto-complete. But if human users find that feature makes their code easier to read and maintain, they still want to use it. They will, and eventually it will percolate out into the ecosystem to get picked up the next time the LLMs are trained, in the same way that human users learn new language features by stumbling onto it in code in the wild.

So I'd like to believe that we'll continue to be able to push languages forward even in a world where a large fraction of code is written by machines. I also hope that LLM training cost goes down and frequency goes up, so that the lag behind what's out there in the world and what the LLMs know gets smaller over time.

But it's definitely possible that instead of that, we'll get a feedback loop where human users don't know a language feature even exists because the LLMs never generate code using it, and the LLMs never learn the feature exists because humans aren't writing it.

I have this same fear about, well, basically everything with LLMs: an endless feedback loop where humans get their "information" from LLMs and churn out content which the LLMs train on and the whole world wanders off into a hallucinatory bubble no longer grounded in reality. I don't know how to get people and/or the LLMs to touch grass to avoid that.

I do hope I get to work on making languages great for humans first, and for LLMs second. I'm way more excited to go to work making something that actual living breathing people use than as input data for a giant soulless matrix of floats.

munificent | 19 hours ago

Sooner or later languages are going to become 3d diagram to code IDEs where you just zoom in to get to lower levels of detail.

rramon | 19 hours ago
[deleted]
| 19 hours ago

One of my big concerns (a little tangential) is that LLMs will have the effect of fixing programming language design and the current language landscape into stone. This could occur in proportion to their use by programmers. The languages that LLMs do the best and have in their training data will be the languages programmers use, and getting any new language into LLM data sets will be very hard.

api | 19 hours ago

I wonder if this will be temporary?

As AI systems improve, and especially as they add more 'self-play' in training, they might become really good at working in any language you can throw at some.

(To expand on the self-play aspect: when training you might want to create extra training data by randomly creating new 'fake' programming languages and letting it solve problems in them. It's just another way to add more training data.)

In any case, if you use an embedded DSL, like is already commonly done in Haskell, the LLMs should still give you good performance. In some sense, an 'embedded DSL' is just fancy name for a library in a specific style.

eru | 14 hours ago

> a DSL requires not only the investment of build and design the language and tooling itself

Not necessarily true. There are two kinds of DSLs: external and internal.

An external DSL has its own tooling, parser, etc. The nix language, for example.

An internal DSL is like a small parasite that lives inside an existing language, reusing some of its syntax and tools. It's almost like intentional pareidolia. Like jQuery, for example.

Internal DSLs reduce the cognitive load, and in my opinion, they're the best kind of DSL.

alganet | 8 hours ago

Articles in the era of LLMs: assume endless torrent of LLM code generation forever, insert how will this affect X now that we have our foregone conclusion.

keybored | 18 hours ago

FWIW, the core assertion here isn't even LLM-specific. DSL design leans heavily on the idea of an expert author who understands the underlying data model well already. That is no less true in the meatspace world than it is for an AI.

DSLs look great if they let you write the code you already know how to write faster. DSLs look like noise to everyone else, including Gemini and Claude.

I used to be a big DSL booster in my youth. No longer. Once you need to stop what you're doing and figure out your ninth or eleventh oddball syntax, you realize that (as per the article) Everything is Easier in Python.

ajross | 20 hours ago

I do not use LLM and I continue to work in the older way.

Also, domain-specific stuff can still be useful sometimes, and other stuff involved with designing a programming language.

zzo38computer | 19 hours ago

[dead]

tonetheman | 16 hours ago

I think academic programming language research is reeks of fraud and uselessness. Prove me wrong.

diimdeep | 19 hours ago

Python increase in Tiobe index is scary: https://www.tiobe.com/tiobe-index/

averkepasa | 20 hours ago