3 ms·
I love lisp, but I don't think the syntax is ideal for LLMs because they generate left to right, and lisp is deeply nested by design. Functional languages that
by CuriouslyC 2mo ago
I love lisp, but I don't think the syntax is ideal for LLMs because they generate left to right, and lisp is deeply nested by design. Functional languages that have pipe operators and other features to keep code reading left to right, and strong type systems seem like the sweet spot.
- perrygeo 2mo agoThe counterweight is that Lisp syntax is tiny and regular, the language is concise, and it encourages the composition of small pure functions. There's very little context to get confused about; the code can be reasoned about locally. Then verified in the live REPL, which gives the agent much tighter feedback loops. So in practice, Lisp uses tokens very efficiently and tends to get things right, fast. The syntax just is not an issue one has to worry about (and your harness should be checking your model on this btw) I suspect that Clojure which adds a little more syntax - vectors [] and maps {} - is slightly better than other Lisp dialects since the data structure literals provide a stronger signal than parens.
- drob518 2mo agoThe models generate Clojure just fine, with the exception of mismatching parens/brackets/braces pretty frequently. There is a tool which can correct that after every edit.
- 4xel 2mo agoThis really frustrates me, because it shouldn't be much harder to train a generative transformer models to be aware not just of previous tokens but also programming context, that is the current pile of open parens and their associated verb. Lisp is obviously the best place to experiment this idea, but other programming languages are full of braces which need closing too.