Live data from Hacker News

Nanolang: A tiny experimental language designed to be targeted by coding LLMs

github.com

41–50 of 210 posts

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#41
post #5

It seems that something that does away with human friendly syntax and leans more towards a pure AST representation would be even better? Basically a Lisp but with very strict typing might do the trick. And most LLMs are probably trained on lots of Lisps already.

Generally seems a bad idea to have your LLM write languages you do not understand or write yourself

Doesn’t that apply to the OP as well?

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#42
post #13

I 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 = (/ (* iter gradient_len) max_iter)
        if (>= idx gradient_len) {
            return "@"
        } else {
            if (== idx 0) {
                return " "
            } else {
                if (== idx 1) {
                    return "."
                } else {
                    if (== idx 2) {
                        return ":"
                    } else {
                        if (== idx 3) {
                            return "-"
                        } else {
                            if (== idx 4) {
                                return "="
                            } else {
                                if (== idx 5) {
                                    return "+"
                                } else {
                                    if (== idx 6) {
                                        return "*"
                                    } else {
                                        if (== idx 7) {
                                            return "#"
                                        } else {
                                            if (== idx 8) {
                                                return "%"
                                            } else {
                                                return "@"
                                            }
                                        }

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#43

At this point, I am starting to feel like we don’t need new languages, but new ways to create specifications. I have a hypothesis that an LLM can act as a pseudocode to code translator, where the pseudocode can tolerate a mixture of code-like and natural language specification. The benefit being that it formalizes the human as the specifier (which must be done anyway) and the llm as the code writer. This also might e…

So in this case an LLM would just be a less-reliable compiler? What's the point? If you have to formally specify your program, we already have tools for that, no boiling-the-oceans required

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#44

At this point, I am starting to feel like we don’t need new languages, but new ways to create specifications. I have a hypothesis that an LLM can act as a pseudocode to code translator, where the pseudocode can tolerate a mixture of code-like and natural language specification. The benefit being that it formalizes the human as the specifier (which must be done anyway) and the llm as the code writer. This also might e…

>>new ways to create specifications.

Thats again programming languages. Real issue with LLMs now is it doesn't matter if it can generate code quickly. Some one still has to read, verify and test it.

Perhaps we need a need a terse programming language. Which can be read quickly and verified. You could call that specification.

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#45
post #42
post #13

I 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 = (/ (…

If you are planning to write so many if else statements. You might as well write Prolog.

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#46
post #13

I 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…

But are you losing horsepower of the LLM available to problem solving on a given task by doing so?

Maybe a little, but Claude has 200,000 tokens these days and GPT-5.2 has 400,000 - there's a lot of space.

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#47

Earlier quoted context omitted.

Generally seems a bad idea to have your LLM write languages you do not understand or write yourself

Doesn’t that apply to the OP as well?

Yes, I'm not going to fill my precious context with documentation for a programming language

This seems like a research dead end to me, the fundamentals are not there

Re: Nanolang: A tiny experimental language designed to be targeted by coding LLMs

#49

Isn't this essentially just WebAssembly or Lisp?

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

#50
Why NanoLang? NanoLang solves three problems:

LLM Code Generation - Unambiguous syntax reduces AI errors

Testing Discipline - Mandatory tests improve code quality

Simple & Fast - Minimal syntax, native performance

Design Philosophy:

Minimal syntax (18 keywords vs 32 in C)

One obvious way to do things

Tests are part of the language, not an afterthought

Transpile to C for maximum compatibility

ehh. i dont think the overhead of inventing a new language makes up for the lack of data around it. in fact if you're close enough to rust/c then llms are MORE likely to make up stuff from their training data and screw up your minimal language.

(pls argue against this, i want to be proven wrong)

Post reply on HN