Why Target Common Lisp for Code Generation?

(funcall.blogspot.com)

149 points | by oumua_don17 1 day ago

34 comments

  • varoun 1 day ago
    I spent the last year writing substantial Common Lisp, including a FoundationDB client and distributed systems primitives layered on top of that, an observability and operability library for CL systems, and a large scale log, metrics and tracing platform that leverages these - in about 200K lines of code and tests. My take on this, apart from one of familiarity and personal preference/taste in choosing a programming language, in the age of LLMs are - 1. From a “functional requirements” perspective, any language will do. You can build substantial systems in something low level like C or higher level like Python or Common Lisp for example. 2. From a security perspective, if you are using LLM assisted code generation, whether you use C or Rust or Common Lisp does not really matter I think - current models are capable, and future models perhaps more so, in producing secure code.

    My understanding is that LLM are deflationary, resulting in code being priced as a commodity (cost plus). If this bears out, then lower token costs and higher performance (esp in my case, where good performance results in lower infra costs to host the service) will start to matter more and more. Common Lisp code bases are famously dense (in the good sense), resulting in perhaps lower token costs when an LLM needs to review and make a change (smaller code bases also help humans / small teams). Common Lisp can achieve performance that’s close to that of an equivalent implementation in C or C++.

    Taken together, they make for one case for using CL and other similar languages, although one that’s grounded largely in economics.

    • davemp 1 day ago
      I couldn’t help but notice the parent commenter’s post history. Account from literally before this was called HN, one comment 6 years later, then 13 years later this comment.

      The pro lisp/s expression comments check out.

    • massysett 1 day ago
      But will an LLM write dense Common Lisp? A lot of that density comes from well-designed domain-specific macros. An LLM will have no incentive to write these on its own, though it could if a human prods it sufficiently.
      • calgoo 23 hours ago
        The only issue have faced with generating Lisp/scheme code, especially on small models, is that it always misses some closing parenthesis. However, because the small core language, you can use structured output in the LLMs that support it and it works quite well.
        • regularfry 22 hours ago
          I found that explicit instructions to keep nesting depth below a limit helps limit the damage. That limit was 5 in my case, which can be inconveniently tight in some situations.
          • drob518 18 hours ago
            In the Clojure world, there is a small utility that is pretty popular called clj_paren_repair (part of clojure-mcp-light: https://github.com/bhauman/clojure-mcp-light/blob/main/src/c...) that uses parinfer’s indentation algorithm to help repair out of whack Lisp parens (and brackets and braces for Clojure). It’s easy to expose this as a skill or tool. I had Pi create me a tool in 60 seconds. I have to say that before I discovered it, I had no time for parinfer (paredit all the way, baby), but this really does the trick as often the model gets the indentation correct (from being trained on so much Python??).
      • samus 23 hours ago
        Yes, human direction will still be required for the foreseeable future (whatever that means in this fast-paced field) to recognize where introducing a DSL or a macro makes sense.
      • jgalt212 20 hours ago
        They don't write dense Python. I'll tell you that. The individual functions might look good, but there's just so much repeated or nearly repeated code.
        • drob518 18 hours ago
          Yea, this seems to be a consistent issue. The models don’t know when to think strategically and often make local edits that keep growing individual functions with more and more conditional logic.
    • lll-o-lll 21 hours ago
      > an observability and operability library for CL systems, and a large scale log, metrics and tracing platform that leverages these - in about 200K lines of code and tests.

      This sounds really really interesting. I don’t suppose you can share more about this?

      • varoun 19 hours ago
        I’m ok to release the first three (the observability/operability layer, the FoundationDB client, and the distributed systems primitives library) on Github, under the MIT license. I would like to do this properly, the code currently does not have any developer or end user docs, along with a few other nice to haves, so it will probably take a week or so. My Github username is the same as my HN username, and I’ll try and post here again when the release happens. Happy to chat more then.
    • traes 1 day ago
      Do you really think current LLMs can implement a large application in C as securely as they can in e.g. Go? I will freely admit that I have not tried to do so but I have a hard time imagining it. Perhaps my biases are outdated...
      • brabel 1 day ago
        Danluu had an article circulating on HN a few days ago that apparently shows that yes, they can. He implemented Zstd and most models did it almost perfectly in most languages. Pandoc was a challenge they still cold not one shot though, which seems correct to me as the LLM would need proper guidance still for such a large enterprise.
        • WJW 20 hours ago
          Zstd is decidedly not a "large C application" though, more like a smallish library at best. The C reference implementation is also open source and thus likely part of the training set for coding LLMs. Any model re-implementing Zstd would probably be "remembering" how it was done originally, instead of implementing it from scratch.
          • brabel 20 hours ago
            By your argument it should have been able to just remember Pandoc existing implementation then? But it didn’t, you think they can only “remember” small code based well enough? I doubt that. Especially since after using LLMs quite a bit I am confident I could write my own specifications for something and LLMs would be able to do it properly, despite definitively not having seen it before.
      • renox 1 day ago
        > Do you really think current LLMs can implement a large application in C as securely as they can in e.g. Go?

        That's not my experience: I've seen an LLM generate a C++ use-after-free (1.5 month ago).

      • guenthert 1 day ago
        Why not? The vulnerabilities you read about are due to oversights, not inherently lacking capabilities of the language. For every program exhibiting any given of such, you'll find thousands which don't make the same mistake at the same place. After all, most reported vulnerabilities are just a short patch away from being fixed.

        Now human programmers might find it more difficult to get certain things right than others, but to a LLM only quantity of examples matters, no?

        • traes 23 hours ago
          Out of curiosity, what is the largest C program you have written pre-LLM, and did you ever try to run it through valgrind*? The "oversights" in C tend to be extremely subtle and dangerous, and of a type that would be impossible to make in Go (or Rust or Common Lisp or whatever.) I do not have confidence in LLMs not falling victim to these subtleties at least once in a large application. I could be totally wrong! Perhaps they can all be found with a sufficient adversarial loops or something. I just have a really hard time imagining no problems of this sort occuring.

          *(Memory leaks can probably be found by just having the LLM run valgrind itself and chase them down, but this gives you a good feel for the difficulties of writing safe C. Again, never tried any of this with LLMs myself, and I haven't written a nontrivial C program in years.)

        • regularfry 23 hours ago
          It's more opportunities for a screw-up to lead to a vulnerability in ways the tooling won't catch by default, in a system where P(screw-up) > 0.
  • fab13n 22 hours ago
    My gut feeling is, this post is 180° wrong. LLMs are the exact opposite of "elite coders", they're perfect StackOverflow users:

    * they memorize adapt and write back small-scale patterns very efficiently; * they know widespread libraries inside out, and can learn others in minutes, even if their doc sucks; * they often produce good results, because most of the time we write unoriginal code, which paraphrases something it already has dozens of versions of in their training corpus; * but they're bad at seeing meaningful, non-obvious, simplifying abstractions, we really have to spoon-feed those to them; * they _love_ verbosity, that's literally how they "think"; * they also love repetition: the other term for "repetition" is "patterns", and they're basically excellent pattern matchers.

    So, Lisp is enjoyable for your typical LLM-complementary hacker, but not for LLMs. LLMs typically replace the kind of "non-elite" developers who hated Lisp, for remarkably similar reasons.

    What I'd love would be an LLM trained to faithfully rephrase a "normal" program into Lisp-ish pseudo-code, that would make reviews faster, more reliable, more enjoyable. But hand-written code is going the way of hand-written machine code; let LLMs have what suits them best, and higher level tools for the more abstract jobs where we're still relevant, and that would be various forms of code reviews.

    As for calling "elite" the kind of developer won't understand that development is a team sports, and that the proper tool is the one that fits the team, not their own peculiar quirks, I'm not going to address that, it isn't the keystone of his argument; but a lot could and should be said about that too.

    • amboo7 21 hours ago
      "180° wrong" as "0° right"? Just that bit, not that I disagree.
      • mort96 21 hours ago
        Presumably "180° wrong" as in "180° away from the right direction"? I found the sentiment of the comment pretty clear
  • tigermelville 1 day ago
    Wrote my first Lisp program in high school 1974; during a teacher's strike some of us geeks bussed it down to the University of Toronto computing centre. It was cafeteria system with a room full of keypunch machines. You typed up your program and got in line with your card deck. The line started with some silos of job cards. You could write fortran, lisp, pl/1, watbol, snobol, etc and run it on an IBM 360 mainframe.

    You placed your deck on top of the card hopper when your turn came up. Most programs were 1/2 inch of cards so there were lots of jobs in a hopper that would take two feet of cards.

    The line continued until a 1442 line printer at the end where your resulting printout came reeling out at alarming speeds. Operators handed you your printout and you returned to the keypunch room to review your results and make the necessary changes to your card deck.

    The cool thing was we were obviously 15 years old and definitely not attending U of T. And our jobs were plainly not for a class because our card decks were 1 1/2 inches thick with long printouts of gameboard configurations.

    But nobody ever batted an eye. We went every day for months.

    Eventually I went to Uni during the era of the lisp machines. I worked for a professor who got me an office in the cpsc building. He paid me slave wages but the Lisp Machine lab was across from my office so they gave me a key to let people in who didn't have theirs. Bunch of Symbolics 36xx machines running chaosnet. A loud but life altering experience spending time in there. I spent enough time that I had a cot in my office.

    That was mid 1980s, and I've carried on writing Lisp to this day. I still like to run that emulated Symbolics environment that's out there. To this day it's a very effective Lisp environment. The design of the REPL alone is blow-your-mind.

    Am I elite? No, but my beard is grey. And on the subject of code generation, the last thing Symbolics did was port their code to the DEC Alpha, the first 64 bit chip. The port compiled their code into lisp macros that expanded to DEC Alpha instructions. The plan was to use different macros for different chips, which was done when the Power PC chip came along.

    Then somebody at MIT wrote a little C backend that pretended to be a DEC alpha, and used macros that expanded into calls to the little C backend. That's what allows us to run a mid 1990s Symbolics 3600 image on any of today's 64 bit machines.

    • drob518 18 hours ago
      Unfortunately, I missed the Lisp machine era by a whisker. AI winter was just hitting as I graduated college (1989), and I got hired working on RISC systems, which were pretty much the opposite of Lisp machines at the hardware level. I have yet to get the emulated Genera environment running, but the repl does look wild.

      Fun fact: symbolics.com was the first-ever domain name registered by IANA.

  • TurboHaskal 23 hours ago
    Yeah no thanks. Common Lisp is the only language that still brings me joy in a post LLM world and I'd like to keep it that way.
    • NoGravitas 18 hours ago
      It's too bad that SBCL has accepted LLM code.
  • abbefaria27 1 day ago
    I spent quite a while trying to learn Common Lisp and I really wanted to like it, but I’m not sure I’d recommend it. The first problem is finding good learning materials, as most are out of print. On the language side people complain about the parens, which turns out is no big deal. There’s a lot of other weird or needlessly tricky stuff though. The function names are convoluted (e.g. there’s map, but also mapc, mapcan, mapl, maplist). Image based development was interesting, but you might waste an hour debugging because your image diverged from the actual code. Building an actual executable is more complicated than you’d expect, and there’s a lot of magic with packages. There’s some elegance there if you squint, but other lisps are probably better.
    • GeorgeTirebiter 1 day ago
      I suggest Practical Common Lisp by Seibel https://gigamonkeys.com/book/

      I now generate ALL of my hobby projects in CL (SBCL on windows). I tell the LLM to 'over-comment' the code, so I get to learn as I read the output. It has been glorious. I generally use the web browser on an unused port on localhost for user IO (beautiful pages), and the app just hooks to Hunchentoot to serve.

      Any 'real' programming language (meaning, one that is truly general purpose: numeric stacks, Web front and back ends, system code, utilities, etc) will always have some cruft. In CL, at least you can understand why some cruft exists. And you get used to it, because it's not like e.g. C where there are some very dark corners indeed. Check out Peter's book!

      CL lets you build real apps, for real. No toys. This has value.

      • Capricorn2481 16 hours ago
        > CL lets you build real apps, for real. No toys. This has value.

        As opposed to other languages where you don't build real apps? I don't think anyone was arguing you can't make real apps in CL

        • herewulf 4 hours ago
          Neither was he. Clearly pointing out that CL is also a language that can build real apps, not just academic exercises.
    • nobleach 17 hours ago
      CL was recommended to me here. I had only played with Scheme over the years (SICP and Little Schemer - which, I used to recommend to every engineer that answered to me). I quickly bought Practical Common Lisp in hardcover (used). The language has a LOT to love. But it's caused me to go back and revisit Scheme(s). I put down my CL book to look at The Scheme Programming language and Chez Scheme. Going through all of this without an LLM has restored some joy. But I can understand reluctance to use this unless I could assemble a team with a ton of knowledge. Prompting for Lisp sounds like fun. But not having the deep understanding means I'd be blindly accepting its suggestions. I can't say what Lisp would be better. Clojure maybe?
    • samus 23 hours ago
      Common Lisp is unfortunately a merge of multiple competing Lisps from the time period, much like Unix (SysV and BSD stuff). It was probably reasoned that a messy, imperfect standard is better than no standard or a restricted standard that is useless without proprietary extensions and requires constant revisions by a standing committee. There are good reasons to deviate from it and come up with a cleaner Lisp, but people better learn all the lessons Common Lisp has to offer before they do so.
  • kukkeliskuu 18 hours ago
    In many of my LLM projects, I have been using DSLs for all kinds of purposes. As many of these projects, data is kind of central, I use Django. So for these DSLs, hy (lisp combined with python) has been working quite well. I have not had trouble with Claude Code writing hy code.
  • kodoman 1 day ago
    I have been using cl for a project recently, as it had many features I wanted and actually made sense to use despite not being familiar with it (though used elisp and a tiny bit of scheme). I found it mixed some things where fantastic some things remain pain points, SBCL is a fantastic project and compiler and once you get used to the debugging it's a very nice experience with slime. It is true to say that it's flexibility is fantastic and CLOS object system once you get used to it is very nice. On AI assisted coding I found it mixed and though Claude now seems quite good at it, local models can be quite poor and lots of things are a lot less well documented and the fact that there is less code out there. One thing to look out for with local models (and probably even the frontier models but with there larger size negates the issue entirely from my usage) is that '(' or ')' might be part of a token such that '))' is a discrete token and '(*' might be as well, all that is to say that when it writes code terminating and start blocks can be an issue so your parens will be off, this was when using omnicoder 9B and that was the main issue. not sure how more recent local models function as switched to claude for part of it and tended to prefer to take my time and write the code myself.
  • shric 1 day ago
    I’m fascinated that some people in our field choose to self describe themselves as “elite”.

    Are there any programming/computer science greats that self aggrandize like this? Is it a cultural thing somewhere that I’m not aware of?

    • mrkeen 1 day ago
      Let's look at what TFA actually says:

        Let’s be honest: Lisp is a language designed by and for elite hackers, not for the masses.
      
      What do other people say about other languages?

        Python is best for novice coders, machine learning, and versatility.  [https://www.boot.dev/blog/python/c-sharp-vs-python]
      
        Golang: Simpler and minimalistic language with fewer features, making it easier for beginners and experienced developers to learn and use effectively.  [https://charleswan111.medium.com/java-vs-golang-a-comparative-insight-into-usage-performance-and-industry-preferences-533a24013230]
      
        JavaScript is also considered to be more user-friendly and easier to learn than C++.  [https://www.c-sharpcorner.com/blogs/cpp-vs-javascript-programming]
      
      If one is allowed to compare apples and oranges, then surely one is allowed to compare oranges and apples.
      • TurboHaskal 1 day ago
        I was really put off by the description of "elite" but if there are indeed languages that claim to be optimized for the experience of newcomers, there are also languages that take the opposite side and optimize for the ergonomics of people who spend a lot of time with it. Perl, C++ and Common Lisp definitely come to mind.
      • aidenn0 13 hours ago
        JavaScript has many (most?) of the language features that were cited as making Lisp "for the elite" when I was first learning programming. It also has a few that would have been considered esoteric (prototypal inheritence and async come to mind)
    • kodoman 1 day ago
      Most well known Dijkstra, who it can safely be said, is one of the greats. Though this blog post is a little much with the whole elite thing there is a little much, I think a rather terrible attitude that is antithetical to it is that of 'Democratization' which seeks to strip skill and need to learn from building and interacting with technology often at the expense of many positive attributes. It hates any thing that requires skill or simply prior learning to use well despite often these things meaning the system overall can better serve the user better and one the prior work has been done is more effective.

      Further this 'Democritisation' can be seen as trying to deskill something that taking away many positives and having contempt for skill. I believe This is often simply to devalue software developers and I assume you are one so I believe we should both be cautious of this devaluation.

      I think a more interesting question would be why should we not have elite's and I don't know if I am unusual but false humility always rubs me the wrong way?

      • aidenn0 13 hours ago
        Some thoughts in no particular order:

        1. FWIW, the older I get the larger a fraction of EWDs I disagree with.

        2. If you take something wrong and reverse it you are usually left with something wrong.

        3. Many of the language features that were cited as making lisp "elite" when I was a kid exist in Javascript. Lexical closures were treated like some mysterious thing that you need to study on a mountaintop and become enlightened to get are now used daily by workady front-end programmers.

        4. Democratization isn't necessarily about deskilling, it's about making skills accessible to more people.

        5. Having and celebrating those who are elite is good. "X is only for elites" is bad.

        6. Literally nobody in my 3rd grade class had any issue programming in a dialect of lisp in the computer lab. Certainly some were better than others, but I wouldn't call something that even half the population can do as "for elites only"

    • 0xpgm 18 hours ago
      Hey, are people not allowed to self select as smug Lisp weenies anymore? Even on HN?

      What Lisp enthusiasts lost in terms of actual status in the programming world they make up for themselves in their niche corners and everyone is happy at the end.

      • shric 8 hours ago
        Oh, they can do whatever they want, I just find it strange. With very few exceptions, people who are “elite” at anything don’t need to blog about their eliteness, their work speaks for itself.

        Imagine for example Fabrice Bellard (too many amazing accomplishments to list here) posting that he’s an elite developer. That’s right, he doesn’t need to, everyone knows it already.

      • drob518 18 hours ago
        I self-identify as a Smug Lisp Weenie.
    • jpcom 1 day ago
      Roughly just over one-thousand people, precisely 1,337 people self-describe as elite in the field.
      • pfdietz 1 day ago
        And 420 people can describe themselves as baked.
        • nehal3m 1 day ago
          69 people are not in a position to speak of themselves.
        • monocasa 1 day ago
          We got two extras once we figured out that 422 is 420 too.
        • esseph 1 day ago
          High minded
    • chris_armstrong 1 day ago
      I interpreted this as being a little tongue-in-cheek - reflecting the obscurity of CL and the way the expressiveness of a lisp can make you feel powerful that others will struggle to understand
    • aidenn0 1 day ago
      I've been programming in Common Lisp for a quarter century and that list item made me cringe.
      • kazinator 1 day ago
        I'm into Lisp because Lisp languages are easy to work in. I advocate the family as being good for nonprogrammers.

        Small children should learn some kind of Lisp, and easily can.

        Richard Stallman famously shared an anecdote in the article "My Lisp Experiences and the Development of GNU Emacs" (https://www.gnu.org/gnu/rms-lisp.en.html) about the secretaries:

        > The editor itself was written entirely in Lisp. Multics Emacs proved to be a great success—programming new editing commands was so convenient that even the secretaries in his office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program.

        People, whether inside or outside of Lisp, who spread myths that that it is some scary, esoteric elite family of languages, have been pretty harmful.

        • 4xel 13 hours ago
          Wholheartedly agree! Even as someone who loves a challenge, has a high opinion of themselves, and knew would love LISP, I postponed diving into it longer than I wish I had, on the mistaken assumption it would be pretty hard.

          Still, I don't think it's wrong to say LISP is for the elite. It is harmful when it's implied it's only for the elite, but being for the elite is not exclusive with being easy to learn, or being good for newcommers.

          Heck, lisp minimal syntax is probably what bridges the two, and it (s expression, and lack of m expressions) was explicitly petitioned for by early lispers, for reasons which likely make them a similar elite than present day lisp enjoyers.

          Likewise, appeal to the masses does not equate ease of learning, or even anti-elitism. It certainly is a common marketing point, but familiarity is what really matters. Emacs has never been so good, Microsoft Office is a good decade or two deep in enshittification, and guess what modern day secretaries use?

          • herewulf 3 hours ago
            They use the software that is pre-installed on their computer.
        • deterministic 1 day ago
          Game designers in the games industry use Lua (and other script languages) all the time without being programmers. That doesn't mean that those languages are more "elite" than others.

          Also, I taught myself machine code programming when I was 11. Just using a book (no help, no internet). So don't underestimate what kids can learn.

          • anonzzzies 1 day ago
            > Also, I taught myself machine code programming when I was 11.

            Yep, and I didn't know assembly/assemblers were a thing (as they were not in magazines), so I typed and still type (for fun) everything in HEX. data 3E,0A,etc.

          • wk_end 1 day ago
            I think the comment that you're replying to is saying exactly the opposite - a language that anyone including non-programmers can use, if you consider the strict definition of the word, isn't "elite".
    • kazinator 1 day ago
      "Für Elite" by Letrec Var Bughaven
    • drob518 18 hours ago
      As far as Lisp programmers go, Joe is quite elite, though I suspect he’s got a twinkle in his eye when he says this, applying a bit of sarcasm. He’s been a Lisp programmer longer than most programmers have been alive.
    • BigTTYGothGF 1 day ago
      Describing oneself as "elite" (or sometimes "l33t") is something people in this field have been doing for a long long time.
    • okamiueru 1 day ago
      They do start out by self identify as a "vibe coder". Which is equally embarrassing. What follows is an enumerated list, which I assume they didn't write the contents of, and I don't care to figure out. I had a hiatus from HN for a little while due to these kinds of posts taking over, but the whole front page is just LLM kool aid stuff now.
    • esjeon 1 day ago
      Lisp is a highly expressive language with little constraint, so there’s plenty of room for individuals to become strongly opinionated. That leads to a bit of elite mindset.
    • aag 1 day ago
      I've known Joe for decades. I've never heard him describe himself this way, but I can confirm that it is true. He is amazing.
      • deterministic 1 day ago
        I know a lot of amazing developers, but they never claim to be “elite” or make similar nonsense claims. They let their work speak for itself.
        • aag 1 day ago
          First, read the blog post more carefully. Then read the book Hackers, by Steven Levy. Common Lisp was designed by amazing hackers for amazing hackers. Joe was making a comparison with languages like Java, which has some nice characteristics, but whose designers have repeatedly stated that their goal was pragmatic utility for working developers rather than extreme language power. I'd rather use a language that gives me extreme power, and take the risks.
          • deterministic 7 hours ago
            Amazing hackers are everywhere. Not just in the (tiny) Lisp community.

            Unless you think that the inventors of C, C++, Unix, Linux etc. were not amazing hackers?

        • ragall 16 hours ago
          This is the Nordic self-effacement which is so ingrained in American culture due to the high number of German and Scandinavian immigrants of the past. Let's just say that not everyone thinks highly of it.
    • stackghost 1 day ago
      I don't get the impression the author is attributing eliteness to themselves. Wanting to use tools designed by and for "the elite", whomever that is, doesn't mean one necessarily considers themselves to be elite.

      When it comes to writing software, I don't consider myself elite, but neither do I want to use a language designed by some mid-level engineer. Do you?

    • nineteen999 21 hours ago
      It's a Lisp programmer thing.
    • boxed 1 day ago
      It reads as cringe to me as a Swede where we follow the Law of Jante, but why would Americans think this is cringe?
      • ragall 16 hours ago
        Jantelagen is also deeply ingrained in American culture due to the large amount of cultural influence from German, Dutch and Scandinavian immigrants.
        • boxed 13 hours ago
          Not so deep lol. I've talked to Americans.
          • ragall 13 hours ago
            It's not ingrained in the Wst Coast people, but very much in the Midwest and a bit lesser on the East Coast. Basically proportional to the Nordic heritage of those regions.
    • dreamcompiler 1 day ago
      https://paulgraham.com/avg.html

      Once you've toiled on the learning curve of Lisp long enough to really grok it you might begin to think you've discovered the foundational bedrock of the universe. From that perspective it's kind of hard not to be a little condescending toward fans of other languages.

      It doesn't help that younger programmers today who complain about "too many parentheses" are largely unaware that Lisp was the original language of AI because the guy who invented AI also invented Lisp to help him do AI. I for one am just a tiny bit chuffed about that because I'm certain that more and better progress on LLMs (and beyond) would have happened had Lisp been used instead of Python as the primary vehicle for AI exploration.

      So yeah, I damn well consider myself elite and I won't apologize for it.

      • _jackdk_ 1 day ago
        I haven't seen a https://wiki.c2.com/?SmugLispWeenie in the wild for a very long time. I thought they'd all gone extinct!
        • p_l 22 hours ago
          There's dozens of us! Dozens! /s

          (and all self-aware)

      • bogdanoff_2 1 day ago
        > Once you've toiled on the learning curve of Lisp long enough to really grok it you might begin to think you've discovered the foundational bedrock of the universe.

        Could it be a form of self-selection bias? That the kind of person that is likely to have such thoughts about a (family of) programming language is also more likely to start and preservere with Lisp?

        • brabel 1 day ago
          That quote is referring to Lisp’s foundations being essentially a mathematical model that is equivalent to the lambda calculus, which can be shown to be capable of expressing any computation possible. It’s a parallel to the Turing machine, see the Church-Turing Thesis. This makes the language, like mathematics, feel less invented by a human and more like discovered, as if it was some law of the universe.
      • grayclhn 1 day ago
        > I for one am just a tiny bit chuffed about that because I'm certain that more and better progress on LLMs (and beyond) would have happened had Lisp been used instead of Python as the primary vehicle for AI exploration.

        Yeah… clearly “not using lisp enough” was the major bottleneck in AI development over the last 40 years. /s

        (While we’re patting ourselves on the backs for no reason, I’m certain that modern AI is as big of an argument for worse is better as C and Unix ever were.)

      • deterministic 1 day ago
        > Lisp was the original language of AI

        Ahhh so that's why the AI winter happened? Wrong programming language? /s

        • brabel 1 day ago
          I am pretty sure that if they had GPUs capable of doing billions of computations in parallel in the 80’s, Lisp generation would have invented LLMs first.
          • zephen 14 hours ago
            Yes, because lisp language and thinking maps so well to GPUs. /s
        • p_l 22 hours ago
          Politics.

          Just like with the previous AI Winter.

    • deterministic 1 day ago
      It seems to happen a lot with Lisp enthusiasts for some reason, usually without any evidence to back it up.

      It always makes me laugh because the real world runs on C/C++, not Lisp. So perhaps by “elite” they mean something other than being successful in the real world? Maybe they think they “get it” while everyone else doesn’t, which somehow makes them “elite”? A bit like conspiracy theorists who think they’re among the few smart enough to know the “truth.” Not sure.

    • drekipus 1 day ago
      Too noob to get it
    • huffhuffhuff 1 day ago
      Elite programmers are people that have excelled at their field for decades. I know I excelled because I have patents, publications, successful products used by millions (if not billions) and a bank account to prove it. Elite coders reading this will just nod, but noobs will make a noise like “huff huff huff” while frantically typing angry responses.
      • leoooodias 1 day ago
        I made a billion successful apps. Each used by trillions.
        • dextrous 20 hours ago
          I am a dynamic figure, often seen scaling walls and crushing ice…
  • Athanase000 19 hours ago
    I guess a weakness of the common benchmarks (artificial intelligence, gertlabs, and others) is that, from my understanding, they don't really cater to each language's specificity. If a language such as CL or Clojure boasts a superior REPL experience, that's entirely ignored by benchmarks, because they just look at the result of generic prompting. So maybe instead of writing countless blog posts on the superiority of such and such language, we should work on improving the benchmarking methodology. Then we would get more useful results.
  • PrimalPower 1 day ago
    I don't know if anything has changed, but last time I tried codegen for Common Lisp, the LLM would routinely mix up LISP dialects and language specific features.

    Less so with Clojure.

    • wild_egg 1 day ago
      I've been using LLMs for Common Lisp since Sonnet 3.7 and have never experienced that. Did you have a mixture of other lisps nearby to confuse it? Seems like an odd failure mode.
      • rhet0rica 1 day ago
        This is an inevitable result of small dataset size. As recently as the start of this year, flagship models struggled with Objective-C unless the target was Apple's latest API. (This is per GNUstep lead dev Gregory Casamento, who has every reason to be an expert in these things.)
    • varjag 23 hours ago
      It used to happen last year but really isn't a thing anymore (assuming you use frontier models).
  • xdavidliu 1 day ago
    > You are not writing dead text; you are conversing with a living system.

    There it is again.

    • zapataband1 1 day ago
      "conversing with a living system" aka "using a common debugging tool"
      • 4xel 11 hours ago
        Lisp debuggers are uncommonly powerful, but there's more to "living systems" than debuggers. I suck at using debugging tools, lisp or otherwise, yet I still love the living system aspect of Lisp or OCaml.

        In mainstream languages, the closest thing to the "living system" part of lisp that I personally grasp and love is not debbuggers; it's Jupyter Notebooks, SQL sandboxes in DBMS UIs, and scripting, as in shell scripting. Still, given the choice, I prefer the Emacs+lisp experience over these great tools.

        Also, live programming is not something lisp overspecialize in, like could be argued for most of the aforementioned tools. Rather, it incorporates it seamlessly. In visual studio, I can run a program line by line or with breakpoints. In lisp, I can select which s experession(s) I want to compile or execute, while an LLM agent is connected to the same image and doing stuffs in the background.

        I do not merely get any single potential benefit of dynamic languages, I get all of them at once, even when working on a source file perfectly suited for punchcard programming (read compile execute).

      • pjmlp 20 hours ago
        Only if your debugging tool supports hot code reloading without changing execution context, updating live references, and is able to save the session across executions.
      • throw10920 1 day ago
        I don't understand. Are you saying that you think that writing Common Lisp is akin to using a debugger in other programming languages?
      • maleldil 1 day ago
        REPLs aren't debuggers.
        • pjmlp 20 hours ago
          More like, debuggers are a subset of what a proper REPL can do.
        • worthless-trash 1 day ago
          The problem is that people think 'python-like' repl is equivalent to CL's repl.
          • aidenn0 9 hours ago
            Can python properly reload an import yet? I complained about the lack of ability to do that about a decade ago, and was told that people were "working on it."
            • worthless-trash 6 hours ago
              I think it will hit up the cache.

              If it exists, Python simply returns the existing module object from memory. It completely ignores the file on disk.

  • CuriouslyC 20 hours 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 19 hours ago
      The 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 18 hours ago
        The 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 12 hours ago
      This 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.
  • mintflow 1 day ago
    I only touch some emacs lisp and never do Common Lisp But seems years of coding experience make me think those tenets in the article reasonable There are indeed elite programmers as I see in my career it’s rare also we do not need to be sad Maybe it’s time to learn some Common Lisp given it’s a good day for exploration and prototyping
  • tehologist 1 day ago
    I was under the impression LISP is nice to write and work with but difficult to read. How well can you understand LISP written by a LLM?
    • dismalaf 1 day ago
      Honestly LLMs write decent enough Lisp. They do however tend to want to use only functions and thus it ends up a bit verbose, but prod them enough and they'll make macros that work and write nice code. Lisp written by an LLM is nicer than Ruby or C++ written by an LLM.
  • willquack 16 hours ago
    > You cannot successfully orchestrate an AI in a language you don't deeply understand.

    This is the primary point and maybe even the later points may be, at least partially, an extension of it.

    Coding agents reflect the developer using them, if the developer isn't proficient with the ecosystem they're developing in or problem they're solving, the output will still be bad. If the developer is lazy, the output will reflect that.

  • rodrigosetti 1 day ago
    Google is making the opposite argument to support Go as the ideal language for vibe coding (https://news.ycombinator.com/item?id=49261133) - i.e., not expressive by design, lowest-denominator, etc.
    • stackghost 1 day ago
      The thing I like about using Go for vibe coding is that, as Google and others argue, there's almost always one obvious way to do things, and the standard library is enormous so there's almost always an easy choice of library to do things with. As a result of that, almost all the Go in the training set for these models is going to be decent.

      Compare that to, shall we say, more permissive (and more popular!) languages like python or js where there are untold terabytes of absolute dogshit code out there.

      But I find Go annoying because the language isn't very expressive. It takes a lot of code to do fairly simple things, so codebases tend to balloon in size very quickly.

      If only the library ecosystem in common lisp wasn't so barren.

  • mark_l_watson 1 day ago
    In the mid 1980s I wrote a commercial neural network product SAIC Ansim and I usually got things working in Common Lisp first, then manually translated to C++. Now we can write in CL and use coding agents to translate to other languages... progress!!
  • tehologist 1 day ago
    As an aside, I wrote a dialect of forth and LLM was pretty good about constraining itself to a subset and create fairly usable code. I was having it implement cordic functions to implement sin/cos.
  • sillysaurusx 1 day ago
    One annoying part of SBCL is that it does something up front with its memory such that if you run it with an 8GB heap, running shell commands takes a noticeably long time even for "echo hi". It’s something to do with the way it forks. Shell commands are also serialized, meaning multiple threads running curl won’t help you more than a single thread running curl. This is in contrast to almost every other programming language, which lets you get more performant network fetches by running the requests in multiple threads. The only alternative to curl is to use a library that simulates curl or write your own, which is fraught with errors: if any piece of the connection times out, it has to gracefully terminate, which is harder than it sounds when you’re interfacing with OpenSSL directly.

    I think that covers my list of grievances though, and it’s a pretty short list. Other than those, CL has been good to me.

  • natmaka 20 hours ago
    Isn't it also in order to reduce dangerous side-effects?
    • mrkeen 13 hours ago
      What mechanism does CL have for reducing dangerous side-effects?
  • bryanrasmussen 1 day ago
    I find only the first reason convincing, and this would obviously be the case for any programmer, just as you choose to implement in a language best for the task at hand that you know well, you should choose to vibe code in the same way.

    Of the other reasons - when he says >Most modern languages force you to describe exactly how a machine should shuffle bits around.

    he must mean something very differently from what I mean if I were to say shuffle bits around, because this is normally what I think most modern languages don't force you to do.

    the elite thing seems not to mean much.

    >Homoiconicity and the AST

    maybe, I would expect predicting well known syntax would be easier for an LLM, but he says it's not. So... maybe?

    >Macros as Context Compression

    Wait, is the LLM generating macros? But LLMs have well known propensity to verbosity. That is to say in these other languages experts in those languages find the code the LLM generates overly verbose. But not in Lisp, or is it that he writes a macro and tells the LLM use that, but I mean other language experts can write a function and say use that instead of your more verbose methods?

    >Superior Error Handling

    shouldn't we have the LLM generate Erlang?

    I mean I get the reasons to go off on how your language is superior and great and do the arguing about all sorts of features and I am all for Lisp or Scheme as maybe the greatest, but the language snobbery in support of LLM target choice just seems weird. Like arguing about why the cream filling in Twinkies is superior to that of Choko-Diles.

    Maybe I am just not keeping up on the latest frontiers of language snobbery anymore.

    • 4xel 11 hours ago
      > > Homoiconicity and the AST

      It's a purely theoretical and speculative advantage as of now. Human lisper think in AST, that's something powerful, and it's reasonable to assume an AI could too, with benefits. But LLMs simply don't; not only they will occasionally mismatch parens, but they will dig themselves in a pit when asked to fix it. Stronger models miss far fewer parens, but that's most likely that they adapt better, not that they think in s expressions ASTs. But we could totally imagine transformer producing directly ASTs, and lisp is probably the best first target for that.

      I've found macros and live programming to be much of the same: it'll do it when asked to, but is not particularly natural or apt at it. They can use macros well, but will rarely choose to write the correct macro when needed.

      Live programming feel particularly ill-suited: multiplying small request with an accumulating context sounds like a sure fire way to explode your token budget. It does wonder for humans because we're able to compress our "context" on the fly. Context caching may mitigate all or most of it, but then it make compressing context less worthwhile. As much as I dislike it, LLMs are punch-card programs suited punch-card programming (write/read all in one go, then compile and execute); his entire training set is arguably punchcard, even from live programming languages.

      > shouldn't we have the LLM generate Erlang?

      Unironically a good idea

    • regularfry 23 hours ago
      I have a hunch (based on using the Kimi models to write some clojure) that the article's AST point is exactly wrong. I had to spend a lot of time cleaning up when it miscounted closing parens, which implies that while the LLM may be operating on the AST, mapping to and from the token stream is harder, not easier, when the individual tokens carry less information.

      If the author is finding that it works well, I suspect there's something else (code or comment style, maybe) that's compensating for it which didn't seem worth mentioning.

      • malloryerik 18 hours ago
        Paren issues with Clojure probably mean your functions are too long? I like to keep mine down to 8-10 lines or less when possible, keep them flat and composable, use threading macro and then transducers for performance. At least that's how I read it. AST might not matter much either way, or in a stranger way, because the LLM's corpus and progression through code will give it a kind of shadow or grooves of an ast, but it isn't making or receiving any ast from this piece of code.

        Still, Elixir scores best on the TenCent AutoCodebench, by far actually, "despite" being like Clojure built with an AST and immutability. Clojure wasn't part of those tests but I use both daily with LLMs (mostly Codex) and imagine it's on par with Elixir. The repl is better than Elixir's. Both have serious strengths.

        • 4xel 11 hours ago
          > Paren issues with Clojure probably mean your functions are too long? I like to keep mine down to 8-10 lines or less when possible, keep them flat and composable, use threading macro and then transducers for performance.

          This is a separate issue. You give great advice for both humans and LLMs, and anything in between, but the fact that it misses parens at all demonstrates it is not reasoning at the AST level, at least not directly, and that's the point the person your replying to is making.

          An hypotetical NN trained to produce valid AST would most likely never get it wrong, it would likely even be given the whole stack of opened context as its input to generate the next token, not just the preceding text tokens, not unlike humans have with indentation and parens highliters. At this point it would be pretty hard to miss a paren.

          • malloryerik 6 hours ago
            Oh I agree the LLM not reasoning at the AST level, and was trying to say I believed this even more strongly than the person I was replying to, but that it didn't matter if you coded or had the LLM code in an appropriate style for a lisp. And then I made a tried to hint at a further claim that the base LLM is not reasoning at all beyond its attention heads I think. As I understand it the corpus space itself -- meaning the relations between tokens and lexemes and so on -- contains the shape of what we call reasoning, so that the language itself + weighting , attention heads, is doing any "reasoning" at all unless the LLM directly starts a chain-of-reasoning where it talks to itself, and if it's doing that just for one's delimiters then one probably hasn't used the lisp very well. I was probably unclear and sounding like I thought the LLM was fundamentally a reasoning device. As far as I understand, "reasoning" or an internal model other than the the language (training corpus corpus) + weights only exists when an LLM does "self talk" either as sub turns, a strong but expensive hack, or as a result of multiple turns layering up context. My claim is that the model can get delimiters right despite not reasoning about them, but deeply nested. My sense is that the model doesn't need to reason to track until attention heads are overwhelmed by nested delimiters; does those sound right? Anyway super interesting conversation, and I do think I was giving less credit to LLM reasoning, as seems to me an LLM trained on AST might still get it wrong a lot. So I don't tend to think AST is something that in and of itself makes languages with ASTs any better. But... immutability, which is practical thanks to AST, is another story. And if I'm wrong about anything here please let me know; I'm not an expert!
      • chriswarbo 17 hours ago
        Indeed, I use LLMs on some hobby Racket programs, and for Emacs Lisp, and it always messes up parentheses; then burns tokens trying to count them over and over (feels like "the number or rs in strawberry" problem).

        I've found https://github.com/shcv/parenmedic to be somewhat helpful, which diagnoses parentheses issues based on when they disagree with indentation, rather than simply counting. The fact this works indicates that LLMs are paying more attention to whitespace than "actual structure".

      • bryanrasmussen 22 hours ago
        >mapping to and from the token stream is harder, not easier, when the individual tokens carry less information.

        this is exactly what I would expect. Also if you are training on code on the internet, what are the chances that you get these kinds of structural errors, especially on code in blogs etc.?

        Lisp is known for being easy to drop a paren on accident so you saying not closing parens jibes with what I expect, that the LLM would predict wrong every now and then about if it should put one in a particular place.

  • asgr 18 hours ago
    “<———— elite hacker” - funcall-blogger
  • dismalaf 1 day ago
    Was going to write something about the article but then poked around the blog and it led to Github including this gem: https://github.com/jrm-code-project/llambda which is much more interesting.

    I do agree with a lot of the article though, Lisp plays nicely with LLMs. Definitely had better luck with Lisp and LLMs than C++ or Rust.

    Also, kind of random, but here's an interesting tool to use CL with LLMs: https://www.lambda-symbolics.com/autolith

  • stackghost 1 day ago
    >I do not operate the LLM in a sterile text editor. I operate it from within a Lisp REPL

    I'd be very interested in reading more about this.

    • drob518 18 hours ago
      If you write a harness in Lisp, you can easily access the running Lisp environment via tools, one of which can be a repl tool. This allows the model to do whatever it wants within that environment. Obviously, this is “dangerous” and should be sandboxed.
  • nineteen999 21 hours ago
    > 3. Designed for the Elite Let’s be honest: Lisp is a language designed by and for elite hackers

    ... it took them up to item #3 this time? Usually i see this quoted as item #1

    • drob518 18 hours ago
      Sign of humility.
  • meerita 19 hours ago
    [flagged]
  • samso26 1 day ago
    [flagged]
  • ohaodha 1 day ago
    [dead]
  • charcircuit 1 day ago
    [dead]
  • rhet0rica 1 day ago
    [flagged]
    • mtlmtlmtlmtl 1 day ago
      I'll never understand why people post LLM outputs in forums pretending they wrote it themselves.

      You asked Claude or some other agent to make your argument for you, and what you got was a well formatted pile of nothing. Bravo.

      • rhet0rica 4 hours ago
        That is... honestly an insane reaction. I spent half an hour writing that.

        I'm sorry you're scared by em-dashes. They were cool when I was young, alright?

    • dreamcompiler 1 day ago
      > Conversely CL's standard library is indebted to decades of history.

      There's no such thing as "CL's standard library." I presume you mean the functions built into Common Lisp which provide basic functionality, but nobody uses "bare" Common Lisp any more than anybody uses bare C. The Quicklisp libraries for CL (among others) provide the modern utilities you seem to think CL lacks.

      • rhet0rica 4 hours ago
        I was thinking of the functions as described by the Common Lisp HyperSpec. Reading it makes me cry.

        It is not unreasonable to call that a 'standard library.' The term 'standard library' is often used to describe built-ins.

        The age of the CL core functions is a genuine weakness, specifically in terms of performance. No matter how many libraries you download from Quicklisp, they still have to be implemented in something, and if that something is antiquated or clunky, you're essentially asking the compiler to optimize the entire language out of existence to keep up with the state of the art. The same applies to npm, pip, cargo, and all the rest.

  • a2ff6eeb0 1 day ago
    In short: sunk cost fallacy.
    • ggm 1 day ago
      An answer appealing for both it's brevity, and the potential recursive application. Use wisely lest stack overflow in discussion threads eventuates.
  • sroerick 1 day ago
    How do you teach LLMs to close parens properly??
    • aag 1 day ago
      That used to be a problem, but Claude Code has been doing fine at it for a few months now.
      • amboo7 21 hours ago
        Agreed. For the others, I asked Claude to write a structural edit tool: s-expressions only, insert/replace/... When passed 'tree' it prints a file like

        <line>: <s-expr .-separated path>

        then eg when passed 'replace 2.1 "(+ x y)"' it returns a new file (as a list of s-exprs).

        • drob518 18 hours ago
          I’ve been struggling with this. I use Clojure and clj-paren-repair has been helpful (https://github.com/bhauman/clojure-mcp-light/blob/main/src/c...), but it would be even better if the model could be taught to do structural editing, the same way I do in Emacs.

          Do you have something in a public repository I can look at?

          • sroerick 15 hours ago
            Thanks, appreciate this also, vibe coding in my own lisp and this has been frustrating
      • sroerick 15 hours ago
        That's good to know. The open weight models are still pretty awful getting stuck in this loop