8 comments

[ 3.8 ms ] story [ 24.7 ms ] thread
That's kind of neat. I had an idea for a macro that would search GitHub for functions with the desired name and use their implementation, but this is probably more predicatable.
Passing the lexical information in and requiring s-expressions be returned is a good idea. Put a cache on it to remember what the llm came up with last time and you have a legitimate, if somewhat weird, language implementation.
Can't commit pseudo-code to prod like this :laugh: cause you might get different results once in a while!
After decades of research, we have finally come up with a way to make programs break in unpredictable ways on every compilation.
One could easily implement an Emacs (SLIME) plugin to "macroexpand" the (pseudo) expresion to real (concrete) Lisp code, and even to try again until the implementation satisfies you.

Then it becomes a concrete Lisp implementation and thus not unpredictable anymore.

I like it, and indeed neatly shows the power of Lisp. The JS variety (well the one that I could come up with) is far less elegant, but works [0] (well, mostly). It really shows how the different LLMs stack up; some really cannot get anything right, but something like openai/gpt-4o-mini seems to get it right mostly (8/10).

[0] https://github.com/tluyben/pseudo-js