It seems like the idea of the macro, and more generally of expressing code succinctly, is the closest to obsolete in my memory?
The other half of the Lisp sales pitch (image based development, constantly inspect state, hot swap code, REPL, etc) seems like what has retained currency in the LLM age.
That seems true in a world where we completely stop looking at code. Right now my reality is giant verbose PRs written by agents in Java, and it sucks to review.
So I guess the idea is tastemaker humans spend all their time coming up with sweet macros and telling agents to refactor the ever shrinking code base.
But even still I think the main argument for S-Expressions (it’s easiest for humans to create DSLs by working on serialized AST) has become weaker. If DSLs are the best way to make a code base readable, you can now have your agent create one with whatever syntax you like!
I think these things are going to be true:
- For a specific well-defined coding task, an LLM coding agent will be able to execute it quicker than humans, regardless of how it does it.
- Codebases which are well organised will be easier for an LLM to manipulate than codebases which are obscure and surprising.
I mean.. I think it's plausible that something like "lisp makes DSLs easy, DSLs are a great way to arrange code" is especially true with LLMs; but I'd also think you'd need to know when to use (& when to not use) DSLs to get effective results from this.
Whereas, say, you could have the LLM come up with a DSL in a way which is high friction for the LLM to do it ... but, you'd get the result a bit slower, & maybe worse.
I’ve been experimenting with stuff like “this project is a Kahn process network, every change is strict conformer to that model, add features only by adding nodes”. As a bonus if you’re strict then porting the specific implementation to a new language should be easy.
To me stuff like this feels like the future of programming.. details don’t matter but design language does. not leet code of fancy data structures from scratch but at least a basic familiarity with LOTS of them, a working knowledge of vast zoos of expressive patterns and automata, etc.
I don’t really have faith that I could write macros of such incredible brilliance that it would outweigh the models’ facility with Python.
Look at what happened with TOON. They came up with a format meant to replace JSON for agents, but despite being way more succinct, its novelty meant that LLMs spent just as many tokens correcting mistakes while using it.
TBF, that was several months ago, an eternity in LLM time. Someone should rerun those language studies, it's possible the SOTA has changed.
The compiler becomes a library in the host language. As you can use the syntax of the host language for the compiled language, you can create host-side defining forms like (define-compiled-function [NAME PARAMS & BODY]) which parse the body of the compiled function into an AST and bind the resulting data structure into a namespaced variable of the host language. This way you can rely on the host's namespacing mechanisms and probably reuse even its packaging and code distribution model for your low level language.
Another interesting feature which just "falls out" is compiler macros: you can use ordinary functions of the host language as macros (code transformers) in the compiled language.
Then you can write a lowering function which takes one of these AST vars, walks its call graph, resolves references and lowers the whole thing into your target language, be it Python, Go, LLVM IR, assembly, whatever.
If you pass a context to your lowering function which binds settings dynamically like target arch, word size, C calling convention, etc. then the code generators can emit the corresponding lowerings and you get portability using the dispatch/polymorphism facilities of the host language.
This way you can push most of the complexity of the language to the LISP side. Basically you get a programmable compiler for your low level language.
I expect to see a lot more examples of this pattern in the coming years.
From a quick glance over your example, it looks like a hodgepodge of Scheme, Clojure, and Common Lisp with some Rust-y constructs in it. If you don't mind elaborating, why not take some existing "embedded" dialect like Pre-Scheme and compile that? Because currently this looks a lot more like Rust-with-parenthesis rather than a Lisp. Of course if that's the goal then that's fine, but I'd like to hear some elaboration on that.
Compiler pass control seems like the interesting part, but why does that imply ALGOL-family languages will be obsolete in 3-5 years? Lisp has had 60+ years to take over. What changes now?
My guess is, within the next 3-5 years, most ALGOL descendant languages will become obsolete, and S-exp based Lisp dialects will take over. Objectively superior.
Behold a native kernel, no inline asm or linker scripts, of any kind. The full compiler pipeline is controllable through the compiler (you can arbitrarily target, devise, or enable/disable various optimization passes, for instance you can enable LICM at will). Also has a hard 1:1 correspondence to C/C++/Rust/adding more languages soon.