SudoLang: a programming language designed to collaborate with AI language models
github.com
github.com
As far as I can tell, it's really just a large prompt template for ChatGPT + a very minimal TextMate grammar.
The talk about constraint-solving and stuff all sounds great (in theory), but if you're just prompting an LLM to follow those constraints it will fail a lot.
That seems a rather ... grandiose claim, does it not?
And even if it follows a constraint while using it, there is no guarantee it did while it was being trained/populated
At least it has a specification and beginnings of a testing suite? And I do like any new ways of reducing tokens without losing signal. Tho personally I haven't had many positive experience of having LLMs faithfully follow programming delimiters and punctuation like curlies and whitespace. LLMs like prose itself, as that's the bulk of their corpuses (corpii?), right?
If this can deliver idempotence across various domains, and the LLM isn't "distracted" or "jailbroken" by the interface's innards, then yeh, AWESOME. But it still feels fundamentally awkward and scrappy? .. Like trying to hammer a nail into a wall with frozen butter. It probably works, sometimes. Reliably tho? No. I don't know how happy I'd be to use it in production. I'd rather work to develop precise prompting tailored to my domain + splitting the domain into multiple atomic pieces instead of a monolithic prompt) + implementing appropriate I/O checks and filters.
https://www.devtools.fm/episode/68 if anyone is interested in the ep
The demos are impressive. I'm excited to give it a try, as I have a lot of ideas for personal software tools where I'm the only customer, but not enough time or skill to build them myself.
A more useful construct might be as a commenting format
# description: ai prompt and human description
# expected: what this block is supposed to do
# some begin marker
... code ...
# some end marker
And then if say, an API changes in the future or other incompatibility happens, then the "test" fails and the AI is given the old code, output, expected output, and description and asked to spruce it up to the modern times and then it gets somehow put inline with a rollback option and some audit log.You can also have some semvar extension "version x.y.z (ai mutation syntax signature)" to allow others to replicate behavior.
This construct also allows people to run it with or without AI, even after mutation, so there is no forced change on the executer and the code has a consistent repeatable comparable ground truth so that diagnostics and expectations can be preserved.
You can even extend existing document formatters to support 'AI-ifying' since in a well formatted documented codebase you're actually most of the way there.
Heck, maybe you can even sloppily inference it to well documented code already
It doesn't. ChatGPT's architecture is non-deterministic.
How this might then work is that I first choose a traditional language I'm familiar with e.g. C#. An intelligent compiler generates underlying traditional code for each of those natural language functions by figuring out what context is necessary and supplying that to an LLM for code generation.
This could be done by parsing just the top-level function names (could use simple markdown headings for this) and supplying the current function details to an LLM, then asking what additional context is required. This would be repeated until the LLM is satisfied with the input.
For stability, once a generated function is accepted by the developer, it is cached and not regenerated unless the description changes. For additional stability there could also be some accompanying tests in the function definition, also generating code via the same process.
If the LLM generates code that fails to compile, it could be provided with additional context until the issue is resolved, transparently.
If you find a bug, you update the function description to exclude the bug scenario, the compiler sees you've changed that part of the input and and re-runs the LLM to do codegen.
Once LLMs are sufficiently advanced, you might not even need to review the traditional underlying code any more.
Have you heard of any other language like this? Or had success using SudoLang?
Now, if the system has some form of common sense (what we, humans call common sense), then it will be able to follow your instructions without doing unexpected things most of the time but it will still fail, just as natural intelligences do.
Instead of programming the "thing", what you can do is make the thing generate a program that you can test and review and run that. But that's definitely more work than giving a set of instructions to the LLM. But, for common tasks, it may acquire enough common sense so that the surprises will be rare enough.
Humans are "intelligent", yet also "programmable" - why would you think an artificial "intelligence" (which, by definition was programmed to start with) would not be programmable?
Sure, you can program a human to do menial tasks and they can do it with acceptable accuracy but even that may require a lot of trial and error. ("Oh, but you said I should do this and that and never mentioned that in this special case I should do that other thing." Or, probably more relevant: "yes, you told me to do this and that but this situation looked different, so I solved it in another way I thought was better.")
Apparently you have never met a human
Or heard of "brainwashing", "indoctrination", "education", etc
Humans are programmed all the time. All over the world. For all kinds of purposes.
I usually write pseudocode when I'm thinking about a problem to solve, so in a way I'm "thinking with pseudocode" instead of plain language. Pseudocode is probably more accurate than plain language, and it's something I'd use when explaining to other humans what I want them to code (along with diagrams, which seems ChatGPT would understand now). So, to me, speccing this pseudocode to something the LLMs find easier to understand sounds reasonable. It's like understanding how a fellow programmer prefers to get his requirements.
Isn't that kind of what Pavlov proved with his dog? It happens to people all the time too. We are easily conditioned (on the aggregate) to give desired results.
Yes, you could say that repetition is part of the transfer, but that wouldn't be too useful, it would just conflate teaching/training with programming.
SudoLang: A Powerful Pseudocode Programming Language for LLMs - https://news.ycombinator.com/item?id=35424835 - April 2023 (27 comments)
I am pretty sure that is one of the biggest unsolvable problems in computer science. Halting problem.
[0] https://en.wikipedia.org/wiki/Total_functional_programming
- runtime checks for all loops
- specify required upper bounds for all loops
should be enough for a massive class of useful AI-generated subroutines. the goal is not to allow all-code, but to have predictable resource limits
and btw, unlike people, AI won't be too lazy to specify those