Developed by Jordan Hubbard of NVIDIA (and FreeBSD). My understanding/experience is that LLM performance in a language scales with how well the language is represented in the training data. From that assumption, we might expect LLMs to actually do better with an existing language for which more training code is available, even if that language is more complex and seems like it should be “harder” to understand.
Nanolang: A tiny experimental language designed to be targeted by coding LLMs
111–120 of 210 posts
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#112Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#113Developed by Jordan Hubbard of NVIDIA (and FreeBSD). My understanding/experience is that LLM performance in a language scales with how well the language is represented in the training data. From that assumption, we might expect LLMs to actually do better with an existing language for which more training code is available, even if that language is more complex and seems like it should be “harder” to understand.
Not my experience, honestly. With a good code base for it to explore and good tooling, and a really good prompt I've had excellent results with frankly quite obscure things, including homegrown languages. As others said, the key is feedback and prompting. In a model with long context, it'll figure it out.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#114Earlier quoted context omitted.
I think this confuses two different things: - LLMs can act as pseudocode to code translators (they are excellent at this) - LLMs still create bugs and make errors, and a reasonable hypothesis is at a rate in direct proportion to the "complexity" or "buggedness" of the underlying language. In other words, give an AI a footgun and it will happily use it unawares. That doesn't mean however it can't rapidly turn your pse…
Say you have this new language, with only a tiny amount of examples of there. How do the SOTA labs train on you're language? With sufficient examples, it can generate code which gets compiled and then run and that gets fed into a feedback loop to improve upon, but how do you get there? How do you bootstrap that ? Nevermind the dollar cost, how does it offer something above having an LLM generate code in python or Jav…
Or, maybe my lanng just had LLM-easy syntax - which would be good - but I think this is more just par for the course for LLMs, bud.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#115Earlier quoted context omitted.
> scream for a case/switch-statement Maybe I’m missing some context, but all that actually should be needed in the top-level else block is ‘gradient[idx]’. Pretty much anything else is going to be longer, harder to read, and less efficient.
True, with early return - there's no need to actually nest with else. Logically this still would be a case/switch though...
There's no need for any conditional construct here whatsoever.
You'll note it has already constructed a string in the right order to do that, but then copped out with the if-else.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#116Earlier quoted context omitted.
It looks like a Frankenstein's abomination that has c-like function signatures and structs with Sexpr function bodies and this will anger some homomorphism nerds. I love it.
I mean WAT (WebAssembly Text Format) is essentially like that
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#117Earlier quoted context omitted.
Go read the DeepSeek R1 paper
Why would I do that? If you know something then quote the relevant passage & equation that says you can train code generators w/ RL on a novel language w/ little to no code to train on. More generally, don't ask random people on the internet to do work for you for free.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#118Earlier quoted context omitted.
Not my experience, honestly. With a good code base for it to explore and good tooling, and a really good prompt I've had excellent results with frankly quite obscure things, including homegrown languages. As others said, the key is feedback and prompting. In a model with long context, it'll figure it out.
Yeah, I've had Claude work on my buggy, incomplete Ruby compiler written (mostly) in Ruby, which uses an s-expression like syntax with a custom "mini language" to implement low-level features that can't be done (or is impractical to do) in pure Ruby, and it only had minor problems with the s-expression language that was mostly fixed with a handful of lines in CLAUDE.md (and were, frankly, mostly my fault for making t…
That's when I smelled that things were getting a little crazy.
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#119I went looking for a single Markdown file I could dump into an LLM to "teach" it the language and found this one: https://github.com/jordanhubbard/nanolang/blob/main/MEMORY.m... Optimistically I dumped the whole thing into Claude Opus 4.5 as a system prompt to see if it could generate a one-shot program from it: llm -m claude-opus-4.5 \ -s https://raw.githubusercontent.com/jordanhubbard/nanolang/refs/heads/main/MEMOR…
Oh, wow. I thought the control flow from the readme was a little annoying with the prefix -notation for bigger/smaller than; # Control flow if (> x 0) { (println "positive") } else { (println "negative or zero") } But that's nothing compared to the scream for a case/switch-statement in the Mandelbrot example... # Gradient: " .:-=+*#%@" let gradient: string = " .:-=+*#%@" let gradient_len: int = 10 let idx: int = (/ (…
Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs
#120Earlier quoted context omitted.
What we need is a programming language that defines the diff to be applied upon the existing codebase to the same degree of unambiguity as the codebase itself. That is, in the same way that event sourcing materializes a state from a series of change events, this language needs to materialize a codebase from a series of "modification instructions". Different models may materialize a different codebase using the same s…
I am working on that https://github.com/gritzko/librdx Conflictless merge and overlay branches (ie freely attachable/detachable by a click). That was the pie-in-the-sky of the CRDT community for maybe 15 years. My current approach is RDX tree CRDT effectively mapping to the AST tree of the program. Like CRDT DOM for the AST, because line based diffs are too clumsy for that. Back in the day, JetBrains tried revision-c…