frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

DSLs Enable Reliable Use of LLMs

https://martinfowler.com/articles/llm-and-dsls.html
51•SirOibaf•3h ago

Comments

m_bashirzadeh•2h ago
what does it do , can u explain more?
williamcotton•1h ago
I agree. What is missing from the discussion about DSLs are the importance of tooling such as linters, LSPs, etc, to give the LLMs further context.

For example, charts/plots are often stringly typed with regards to column names and a DSL specific to plotting could give immediate feedback to an LLM.

NamlchakKhandro•16m ago
It absolutely blows me away that there is still a significant amount of people out there kidding themselves that they're effectively using a coding harness .... and don't get this simple fact.
lelanthran•1h ago
Pretty much how I use LLMs these days. Even Chatbots are able to work with a 200 line spec for the DSL.

You'd think it wouldn't because, well, no training data, but a short spec is usually enough.

OsamaJaber•58m ago
The gap I've hit generating GPU kernels with agents code that compiles and runs fine but is slower than the baseline. Validator says pass, result is useless. Speed targets have to be part of the check, not just correctness
chrisweekly•35m ago
"Performance is the most important feature"
NitpickLawyer•29m ago
> but is slower than the baseline. Validator says pass, result is useless

You should read this blog, they cover this exact scenario - https://www.weco.ai/blog/first-evidence-of-recursive-self-im...

> One domain that suffers from this particularly is GPU kernel engineering. We adopt our previous idea for detecting reward hacking from SpecBench and apply that to a set of KernelBench tasks, measuring whether the speedup the agent reports on the unit tests actually survives in the end-to-end workload (e.g. model training). A kernel counts as reward hacking if less than half of its claimed speedup survives there, including outright slowdowns and failures.

codegladiator•51m ago
> The advantage holds while the DSL stays small and constrained enough that a few in-context examples can convey its usage. There is also a real upfront cost in designing and maintaining the language and its semantic model. The payoff is therefore concentrated in well-factored, genuinely constrained DSLs backed by a validator.

dsl stays small is doing all the heavy lifting here

the premise is that because of these few existing dsls (like PlantUML mentioned) my "new dsl" will be equally effective. PlantUML has millions of examples in the training data, my new dsls are not (specially if its not json/yaml or just function chain based). as the number of things that can mix and match increase you are basically looking at a whole system prompt just describing the new language.

this brings us to the second part. step 2: after dsl is 'planned' (note they use the java compiler), the dsl need to have a real compiler/executor, not just a validator. because if then you are going to ask the llm to "compile the dsl to implementation" we are back to square 1.

brookst•39m ago
I’ve had good luck with LLMs and ad hoc DSLs, as well as much less common DSLs like liquidsoap’s stream management DSL.

I don’t think there’s magic in DSLs, I just think LLMs respond well to clear, simple structure.

Compilation / execution is often true, but not necessary. DSLs can be entirely declarative and used just for gating the stages of a multi-step workflow with checkpoints that have more structure than natural language.

codegladiator•20m ago
> less common DSLs like liquidsoap’s stream management DSL

seems to be on github since 2008 so definitely in the training data. i am not talking about less or more common. either "your dsl" would need to look something like someone elses dsl (at this point is it your dsl?) or you need some way to get your dsls examples in the training data for the llm, or feed it in the prompt.

> LLMs respond well to clear, simple structure

and what a "clear simple structure" for a dsl is also quite not mentioned. clear and simple would be quite subjective based on the domain, the article says let the llm go in a loop trying to figure out the dsl for you.

> checkpoints that have more structure than natural language

if llm is at any point in the structured generation part then either you have a deterministic validator/compiler or you are back to reading/reviewing it manually, what can you trust ?

discreteevent•22m ago
This remains one of the best articles I have read on LLMs (by the same author) https://martinfowler.com/articles/llm-learning-loop.html

Also this article is a good pre-cursor to the DSL article:

https://martinfowler.com/articles/what-is-code.html

andy_ppp•22m ago
What is the general consensus on Martin Fowler - I worked with Thought Works and they were obsessed with overcomplicating everything, but maybe that is just agency in general?

I think it goes without saying that the biggest fight we have as developers is keeping things as simple as possible when most external factors encourage complexity, especially LLMs.

jdw64•17m ago
I'm curious too. In the Korean IT scene, his name is legendary. Because many articles reference his writings, and famous Korean IT YouTubers worship him. (I worship him too.)

So I do have some questions. First, I still enjoy reading ThoughtWorks Radar. For someone like me, who's in a vulnerable position far from the cutting edge of technology, it always helps me keep some level of synchronization with the tech world. But I'm curious whether this is just a perspective from Korea, or if it's the same in the West.

And as for the tendency to overcomplicate things—I think that even when something is implemented simply, the explanation often ends up being quite complex. Honestly, I find Fowler's writing easy to read

voidhorse•14m ago
I'm really starting to tire of people making broad, general claims about how LLMs work or how to use them with N = 1 or 2.

An LLM is a statistics machine for goodness sake. Basically any general claim about them needs to exploit the law of large numbers to be even remotely sensible. You cannot extrapolate from one-off behavioral successes. LLMs are not understanding anything in the way humans do. If they did, yeah, maybe you could extrapolate hard from small samples, but they don't work or understand things like we do. You need to show that the behavior you are documenting is an average behavior the LLM converges toward in the long run.

bdcravens•13m ago
I frequently blur the line between ad-hoc DSL and pseudocode, and just hand it off to the LLM. I want to get the thoughts out of my head as fast as possible, using whatever structure makes sense to me. Even if you know all of the code to be written, I think this is a huge win with LLMs, where your intent is more important than syntax.
conartist6•13m ago
"DSL" is a stupid word. If it's a language, it's a language.
bob1029•9m ago
The only thing which enables reliable use of LLMs are statistical techniques.

Even the most constrained and well-designed Disney world ride will break down in some embarrassing way every now and again. As you increase the # of parallel rides, the chances that at least one of them will touch the desired parts of the search space go up dramatically.

The fact that the major model providers keep publishing nano/mini/luna variants should be a massive hint that there's more to this than one big fat loop magically one-shotting everything.

tclancy•4m ago
This is a statistical technique, effectively: it shrinks the problem space the LLM faces at each decision point. Ideally, it would be a way to turn a request from an open-world game into a game on rails. Given the DSL, my options are only X or Y at this point in the solution.

Admittedly, that’s just improving the likelihood of getting a successful result, but if you mean 100% when you say “reliable”, that’s a false equivalence. No coder gets it right reliably either.

giovannibonetti•4m ago
This reminds me of this Bjarne Stroustrup's Rule (creator of C++): - For new features, people insist on loud, explicit syntax. - For established features, people want terse notation

After all, DSLs are close to the latter – a short notation to avoid repetition.

brookst•7m ago
Re: less common, I was just saying it doesn’t take millions off examples like PlanetUML.

> what can you trust

I wasn’t clear enough here — you’re responding to DSLs as an interface from non-deterministic LLMs to deterministic external systems.

What I meant was using DSLs as intermediate checkpoints in multi-LLM processing. If you just flow natural language through 5 LLM calls, the last one may be getting something very different from what it’s prompt is designed for.

But if you make the DSL a contract for handoff, results are much more stable.

Perfect and deterministic? No, of course not. Just an improvement and mitigation. But it’s served me well.

billyp-rva•27m ago
> the premise is that because of these few existing dsls (like PlantUML mentioned) my "new dsl" will be equally effective. PlantUML has millions of examples in the training data, my new dsls are not (*specially if its not json/yaml* or just function chain based)

I can confirm that having a DSL that is json/yaml helps a ton. Kind of like static type checking, it eliminates entire swaths of syntactical errors, allowing the LLM to focus on the semantics.

> because if then you are going to ask the llm to "compile the dsl to implementation" we are back to square 1.

I think this is an edge case; 99% of the time you (and/or the LLM) would have access to the implementor so it wouldn't need to do this.

codegladiator•17m ago
> DSL that is json/yaml helps a ton

it definitely does, and i would say json/yaml is not a dsl. this example of json/yaml keeps coming in the form of "DSL". i would say your configuration is not a dsl, it a declaration. llms are better at declarative stuff ? maybe but there are hardly that many of complex declarative frameworks.

PlantUML is a real dsl. not just declarative yaml.

billyp-rva•10m ago
> and i would say json/yaml is not a dsl

But you can have DSLs that are json/yaml, is my point.

> PlantUML is a real dsl.

PlantUML is a DSL that isn't json/yaml. That doesn't make it better, and you can make the argument that it is worse because the tooling around it won't be as good.

Sleep regularity is a stronger predictor of mortality risk than sleep duration

https://academic.oup.com/sleep/article/47/1/zsad253/7280269
153•bilsbie•1h ago•59 comments

Prioritize mental health, and why communication is so important

https://ramones.dev/posts/mental-health/
46•ramon156•1h ago•16 comments

Jurassic Park computers in excruciating detail

https://fabiensanglard.net/jurrasic_park_computers/index.html
615•vinhnx•10h ago•149 comments

DSLs Enable Reliable Use of LLMs

https://martinfowler.com/articles/llm-and-dsls.html
53•SirOibaf•3h ago•24 comments

Weathergotchi – an open-source climate Tamagotchi

https://github.com/Michael-Manning/E-Paper-Climate-Logger
27•luanmuniz•2h ago•11 comments

Telegram Serverless

https://core.telegram.org/bots/serverless
44•soheilpro•3h ago•29 comments

Show HN: For 10 World Cups, my model's 2 favorites had the champion every time

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7013338
20•fabioricardo7•1h ago•24 comments

Societal Impacts: Claude's values across models and languages

https://www.anthropic.com/research/claude-values-models-languages
21•taubek•2h ago•13 comments

Jiga (YC W21) is hiring the best people to make manufacturing great again

https://jiga.io/about-us/
1•grmmph•1h ago

A Trip to 90s Kansai: Exploring the XD FirstClass Network BBS

https://cdrom.ca/games/2026/05/30/xd.html
23•zetamax•1d ago•0 comments

Bonsai 27B: A 27B-Class model that runs on a phone

https://prismml.com/news/bonsai-27b
645•xenova•19h ago•227 comments

Vancouver PD website features Quick Escape button that wipes itself from history

https://vpd.ca/
313•LookAtThatBacon•13h ago•125 comments

Latent Space as a New Medium

https://kevinkelly.substack.com/p/latent-space-as-a-new-medium
15•thm•1d ago•1 comments

Neverclick: Desktop application for performing mouse actions with your keyboard

https://github.com/LazoVelko/neverclick
31•thunderbong•3d ago•33 comments

TS-2026-009: Insecure argument handling in Tailscale SSH permitted root access

https://tailscale.com/security-bulletins
182•jervant•12h ago•105 comments

Using Go for Mobile Apps

https://www.davidsobsessions.com/p/one-year-of-gomobile/
12•theHocineSaad•3h ago•1 comments

The Tower Keeps Rising

https://lucumr.pocoo.org/2026/7/13/the-tower-keeps-rising/
508•cdrnsf•20h ago•235 comments

Who's running all those tiny RPKI servers?

https://blog.apnic.net/2026/07/15/whos-running-all-those-tiny-rpki-servers/
56•enz•6h ago•7 comments

Combinatorial Games in Lean

https://github.com/vihdzp/combinatorial-games
24•wertyk•3d ago•3 comments

SpaceX bond worth 10% less than issue price – heading for junk bond status

https://www.ft.com/content/3a023b95-66c3-41e1-b0ce-df752a499541
12•youngtaff•18m ago•1 comments

How I use HTMX with Go

https://www.alexedwards.net/blog/how-i-use-htmx-with-go
286•gnabgib•17h ago•87 comments

Dependabot version updates introduce default package cooldown

https://github.blog/changelog/2026-07-14-dependabot-version-updates-introduce-default-package-coo...
195•woodruffw•16h ago•124 comments

Cursor 0day: When Full Disclosure Becomes the Only Protection Left

https://mindgard.ai/blog/cursor-0day-when-full-disclosure-becomes-the-only-protection-left
408•Synthetic7346•19h ago•191 comments

I tricked Claude into leaking your deepest, darkest secrets

https://www.ayush.digital/blog/the-memory-heist
458•macleginn•6h ago•216 comments

How to stop Claude from saying load-bearing

https://jola.dev/posts/how-to-stop-claude-from-saying-load-bearing
566•shintoist•1d ago•581 comments

Filmgrab: Films A-Z

https://film-grab.com/movies-a-z/
5•hopelessluca•1h ago•4 comments

Microsoft has released software updates to plug at least 570 security holes

https://krebsonsecurity.com/2026/07/microsoft-patches-a-record-570-security-flaws/
161•robin_reala•15h ago•101 comments

I'm a USB-C Maximalist

https://shkspr.mobi/blog/2026/07/im-a-usb-c-maximalist/
315•speckx•21h ago•411 comments

Andon (manufacturing)

https://en.wikipedia.org/wiki/Andon_(manufacturing)
63•tony•3d ago•24 comments

The kids with phones are alright

https://heatherburns.tech/2026/07/08/the-kids-with-phones-are-alright/
233•JumpCrisscross•4d ago•307 comments