Comment by vindarel

22 days ago

The real "[Common] Lisp curse" is that once you taste it, there's no going back.

Other than that, the Common Lisp ecosystem is doing well thank you very much. Many contributors to SBCL, regular contributions to the important ecosystem libraries, vivid projects (Lem), new editors (mine) and plugins (OLIVE), some companies picking Lisp and somehow supporting the ecosystem (hosting conferences, contracting implementors). https://github.com/CodyReichert/awesome-cl/ · https://github.com/azzamsa/awesome-lisp-companies/ And yes, new vibe-coded projects too. Some are useful (ICL, cl-tuition…), some reinventing the wheel (badly) went nowhere. For some, we'll see.

Since you mentioned the mine editor you must be aware of Coalton, but since you didn't mention Coalton I'll mention it here. Coalton is a Lisp library that basically adds static typing, type inference, and Haskell-style typeclasses on top of Common Lisp. (If you've never encountered type classes, then think of interfaces in the OOP language you know best. Type classes are what interfaces should have been: they can do everything interfaces can, and many things interfaces can't). Here's an example from the Coalton docs, which should be pretty self-explanatory; go read https://coalton-lang.github.io/manual/topics/whirlwind-tour/ if you want to see more.

    (coalton-toplevel
      ;; Type classes are defined with the define-class keyword
      (define-class (Eq :a)
        (== (:a * :a -> Boolean)))

      (define-type Color
        Red
        Green
        Blue)

      ;; Type class instances are defined with the define-instance keyword
      (define-instance (Eq Color)
        (define (== a b)
          (match (Tuple a b)
            ((Tuple (Red) (Red)) True)
            ((Tuple (Blue) (Blue)) True)
            ((Tuple (Green) (Green)) True)
            (_ False))))

      ;; Type declarations can have constraints
      (declare is-eql (Eq :a => (:a * :a -> String)))
      (define (is-eql a b)
        (if (== a b)
          "They are equal"
          "They are not equal"))

      ;; Multiple constraints must be wrapped in parentheses
      (declare double-is-eql ((Eq :a) (Eq :b) => (:a * :a * :b * :b -> String)))
      (define (double-is-eql a b c d)
        (if (and (== a b) (== c d))
          "Both pairs are equal"
          "The pairs are not both equal")))

  • For anyone who might not have encountered typeclasses before, the example might not be quite as self-explanatory as I thought it would be, so I'll explain that example a little.

    The `(define-class (Eq :a) ...)` block is defining a type class called `Eq` with a type parameter named `:a`. Think of this as an interface that can be added after the fact. Most (all?) major OOP languages only allow you to declare interfaces when you declare a class, but in Haskell, and in Coalton that takes a lot of inspiration from Haskell, you can declare "interfaces" (typeclasses) on any pre-existing type, including ones coming from a library. Here, the `Eq :a` interface means that there must be a function called == (in Lisp even the operators are defined as functions) that takes two parameters of type :a and returns a Boolean.

    `(define-type Color ...)` is defining a simple enum type. (You can do a lot more with it, of course, but this example is kept simple). Then `(define-instance (Eq Color) ...)` is saying "The type called Color is an instance of the typeclass (interface) called Eq". And since Eq requires a function called `==`, inside the define-instance block you have to define that function for the Color type. The pattern-matching should be simple enough that I don't think I need to explain it.

    Now, the thing that makes this more powerful than interfaces is something I already touched on. Here the Color type is declared and then its typeclass instances are defined right away, which is the normal thing to do when you're creating a new type: keep all its code together. But if that Color type had come from another library that you imported, you would still be able to say "oh, and this Color type does implement Eq: here's the definition of == as applied to Color values". You're not restricted to only the interfaces that the library author thought to apply: you can take someone else's code and add interfaces to it! There have been several times when I really wished that were possible in C#.

    Finally, the constraints before the => fat arrow are like declaring your function parameters as `public T isEqual<T>(T a, T b) where T : IEquatable`. This allows Coalton to catch, at compile time, any call to `is-eql` with parameters for which the `==` function is not defined.

    There's plenty more at https://coalton-lang.github.io/manual/topics/whirlwind-tour/.

    • Thanks for the detailed explanation. I'm very familiar with Haskell, so this all feels very natural. How good is the type inference in practice? Is it a good as Haskell? And are there any places where you'd rather use vanilla common lisp?

      1 reply →

  • About static typing and type inference: what does it do with code that it can't infer? It turns into a dynamic type ala Typescript, or it gives a type error?

    I mean it must employ gradual typing, right? So that it can interface with existing code that is untyped

    • Coalton infers and checks all types for pure Coalton code; there's no such thing as a dynamic or untyped expression.

      Code that is outside of the purview of Coalton—raw Common Lisp code—is run in explicit (LISP ...) forms [0] which require the user to annotate the type and they add dynamic type checks to ensure the enclosed code meets the contract the programmer specified (unless UNSAFE is used [1]).

      [0] https://coalton-lang.github.io/manual/operators/lisp/

      [1] https://coalton-lang.github.io/manual/operators/unsafe/

    • If I've understood https://coalton-lang.github.io/manual/topics/whirlwind-tour/... correctly (and please do read it for yourself because I might be misunderstanding it: I haven't used Coalton yet, only read the manual), Coalton will guess a type in some cases (such as numbers, but not only numbers). I don't know whether it gives warnings or errors for types it can't infer, but since it's based on Common Lisp I would assume it would give a warning and continue with an unknown type.

      But there are definite advantages to having Coalton know your types, which is why they give you a `(declare foo Integer)` form. This doesn't compile to any code, it's a compiler hint that tells Coalton that it can assume `foo` is an int, not a float64/double, which allows it to pick at compile time which implementation of + gets used in `(+ foo 5)`.

      The 2025 video introducing Coalton at https://www.youtube.com/watch?v=of92m4XNgrM gives an example of what Coalton can do with knowing types. Robert Smith (the presenter, and the primary creator of Coalton) gives an example of a Fast Fourier Transform function that uses generic numeric types so you can call it on any number type: float32, float64, int-modulo-a-prime, whatever. He then benchmarks it, and it takes about 1 second to run 2 million times. Then he adds the single compiler hint `(monomorphize)` above the function declaration. This tells Coalton "Hey, instead of doing a dispatch table lookup in this function and calling different + implementations based on the type of the parameters, I want you to create two different copies of this function, one that will call the specialized float32 math functions, and the other one that will call the specialized float64 math functions." (Or three copies if you also called it with your int-modulo-prime number type). This eliminates a dispatch-table lookup and allows the compiler to produce much more specialized code. It comes at the expense of larger binaries, of course: he's explicit about how this is trading speed for size, so it's an opt-in choice you make (by adding a `(monomorphize)` declaration above the function definition) rather than something that Coalton defaults to.

      But I've digressed. Yes, I believe (though note my caveat about not having used Coalton yet) that it would use dynamic types for code whose types it can't infer. But I'm pretty sure it would also give you a warning. If it gives you an error, the solution is to add a `(declare [name] [type])` line in the appropriate place.

Lisp missed its timing. When it was above and beyond everything else and a totally different world, it was way too expensive and way too inefficient.

Today, when mainstream languages have stolen much from Lisp, the benefit of using a language where you can generally just add a gem, egg, or crate is much higher than the benefit of the one thing that is still unique to Lisp: macros. Reflection is inelegant as hell when you compare, but it will get you almost all the way macros do.

At the same time, typed languages have become much more like dynamic languages. The types have disappeared into var and let statements; they are now inferred rather than repeated. Pattern matching has been added, and more—without compromising the benefits for larger teams and larger code bases.

Purists will disagree, but I haven't seen a real world problem solved in Lisp that I couldn't also solve in other languages.

And yes, I am interested in being proven wrong. I want to know what kind of problems still exist that are that hardcore. But I suspect a big part of it is that those who code in this still think the "hello world" for Java looks something like this:

    public class HelloWorld {
      public static void main(String[] args) {
        System.out.println("Hello, World!");
      }
    }

when in reality it now looks like this:

    void main() {
      println("Hello World");
    }

and in C# it looks like this:

    Console.WriteLine("Hello, World!");

And comes with full first class support for Linux and Mac.

Lisp is an intellectual tower and has given an incredible amount to the programming community in terms of ideas and a playground for people to try things. I'm not denying any of that — it should be celebrated. But my thesis is this: most of that has been moved, copied, stolen, and adapted to mainstream programming languages.

  • >Purists will disagree, but I haven't seen a real world problem solved in Lisp that I couldn't also solve in other languages.

    Turing completeness makes "I couldn't also solve" an impossibly high bar.

    But if what you mean is, you haven't seen macros used in ways that make you wish your day-job programming language had macros, that's fixable.

    • Not GP and not Lisp programmer. But I'm curious about what you said. If you had to name one popular app or web service (>10,000 monthly unique users) that'd be much easier to clone in Lisp than in Python or Rust, specifically due to macros - what would that be?

      10 replies →

  • > the one thing unique

    it's the developer experience

    (and the combination of all features, including homoiconic macros)

    > a real world problem

    You can solve anything with enough sweat ;)

    One example? Routific's core algorithm is written in CL (source: its author on HN). Why not Java, like everybody on his field at this time? Because it was too tedious (edit: and we're not talking only about syntax) (there's a blog post somewhere). His prototype evolved in efficient production code, now the heart of the company.

    > my thesis: most of that…

    agreed on "most". Many features appear here and there in other languages. But there's the parts and the whole.

    And the living platform ("stop writing dead programs"), still unique (with Smalltalk).

  • As big Smalltalk / Lisp / ML languages fanboy, I mostly agree with you.

    In fact the main reason I hang around Java and .NET as my main tools, is that those development environments have taken many key features from those programming languages and development experience, to the point that where they still lose to them isn't that much relevant.

    Additionally, now with AI code generation, the actual programming language matters even less, natural language can be translated to whatever programming language one feels like, at the whim of a Markdown paragraph describing the desired output, assuming it is supported on the model being used.

    However it is kind of sad that we lost the last AI wave from Lisp/Prolog to Python, losing good machine code generation in the process.

    And I have seen many real problems solved with Lisp, regardless, that is why commercial Lisps like LispWorks and Allegro are still in business.

    • > And I have seen many real problems solved with Lisp, regardless, that is why commercial Lisps like LispWorks and Allegro are still in business

      Can you think of some domains where Common Lisp is a better choice than other languages? I have enjoyed Clojure for a lot of things, but I have not really found the features of SBCL useful for the kind of work I do.

      For instance, restarts without unwinding the stack are cool, but for a server that's going to be running in production, it's not something I really leverage. I could use conditions to change the context of code called downstream, but I just haven't had a reason to do this yet.

      1 reply →

  • > I haven't seen a real world problem solved in Lisp

    Bruh... Nubank is literally the biggest effing digital bank in the world. Famously built on Clojure stack. Just because you have not seen shit it doesn't mean it's not happening.

    Apple, Netflix, Amazon, Walmart, NASA - they all use Lisp, and that's just the States. There are tons of European startups building on it.

    > Lisp missed its timing.

    It is literally timeless. Emacs just turned 50. Name a single half-a-century old software product that's being actively used, developed and improved. r/emacs subreddit gets daily, daily! updates of new Emacs package announcements.

    > most of that has been moved, copied, stolen, and adapted to mainstream programming languages.

    Totally. Except homoiconicity. The point of which the majority of programmers miss, misunderstand, or ignore. The bigger point programmers miss is that Lisp effectively proves that largely the syntax of programming languages doesn't really matter. What matters is the runtime. And Lisp today runs practically on every possible runtime. Meaning that to be a polyglot, you don't really need to know dozens of PLs, you can just understand homoiconicity and voila - you can practically ship software for any runtime. Syntax is the cheap part, and Lisp shows it well: Clojure on the JVM and CLR, Clojurescript on JS, Fennel on Lua, Hy on Python, LFE on BEAM, Jank on LLVM, etc. The surface stays the same, and the host changes underneath. Then you learn runtimes and type systems, which is the real work of being a polyglot. That is a big win. Most programmers spend years on syntax and then mistake it for knowing a language. Learn the damn Lisp. It is enormously practical.

    > still think the "hello world ...

    Who the fuck cares about intricacies? In pretty much [almost] every Lisp dialect it would be just:

    (print "Hello, World!")

    For EVERY different runtime.

Reading the first paragraph of the article, I agree with them that Lispers don't collect as many dependencies.

But then once I read the second paragraph, I agree with you. Lisp is doing fine in terms of important ecosystem libraries. The article sets that as the context when it asserts as fact that "established libraries are incredibly stable, tested by hundreds of thousands of developers, included in thousands of CI pipelines and maintained by experts on the topic."

I don’t really see that either.

I see that sbcl itself is alive and doing rather well, but other than that the landscape is fairly grim.

Unironically the most successful modern day lisp is clojure, that mostly piggybacks the jvm and can reuse most java libraries and frameworks.

  • The thing about lisp, it’s that it’s fairly expressive. You only need a few foundational libraries (mostly algorithms) and it’s very easy to build on the rest. In something like Python, or Go, once you define a conceptual model in a library, you need another library for the glue code to bind it to another ecosystem. In Lisp, almost everything is using the basic list, alist, and plist,…

    So you design from the core logic and write shim to external dependencies. Instead of bringing deps from the get go.

    • > You only need a few foundational libraries (mostly algorithms) and it’s very easy to build on the rest.

      Yeah but i don’t want to. Let’s say i need to connect to rds using iam authentication.

      I don’t want to write code for that, i want to use a library.

      I don’t want a library that works with chicken scheme but not on sbcl and maybe on cmucl.

      I know i can, i don’t want to. I want to reuse code written and maintained by other people.

      2 replies →

Lots of people have used lisp, scheme or scripting languages and never go back. Lisp was created in the 50s, if it converted everyone it would have done it a long time ago.

  • I don't think these 'most people' you anecdotally cite have gone deep enough into Lisp to realize what it's all about, and why it turns users who do taste real Lisp into Lisp fanatics.

  • You probably have no idea how much Lisp is out there in real, production systems. Just because the majority is required to be on Python, doesn't mean it's the best stack for solving problems. Gathering language stats for Lisp is also challenging, because it's not a single PL - it's a whole family of dialects. And these dialects and communities are absolutely thriving. Modern Lisp landscape is very, very different from LISP you're talking about (invented in the 50s).

    • I just wanna throw myself in here and get some advice. I’ve started using lisp recently mostly for emacs configuration but also doing a bit of recreation game programming in Fennel. If I wanted to learn a lisp for general programming/application stuff like writing a shell, a compiler, something more user facing, what would be good to check out?

      2 replies →

    • That's kinda the problem of Lisp curse. You have several hundred slightly incompatible dialects instead of a one good language.

      It's akin to how Linux isn't a OS but a family of OS with same core.

      5 replies →

    • You probably have no idea how much Lisp is out there in real, production systems.

      We really do have a good idea because we can see how much every language is used on github and we can see bulk job listings on the internet.

      Just because the majority is required to be on Python, doesn't mean it's the best stack for solving problems.

      So which is it? Secretly popular or it doesn't matter that it's unpopular because it's so great anyway?

      Gathering language stats for Lisp is also challenging, because it's not a single PL - it's a whole family of dialects.

      If you take them all together, they still don't amount to much.

      Modern Lisp landscape is very, very different from LISP you're talking about (invented in the 50s).

      The old lisp landscape actually had some people using it.

      It might be time to accept that most experienced programmer have heard of and used lisp or a variant at some point and it just didn't offer a real pragmatic advantage. It was very influential when the alternative was putting in assembly instructions using their hex codes, but modern languages have adopted all the best parts. The parts that are still unique like s-expressions, macros and 'code as data' haven't really paid off as much as people like to pretend. If you have every program writing their own crazy DSL, things get very squirly very fast, because every program becomes it's own niche language.

      Mixing 'code and data' is the same thing. The key to simplicity is to use simple straightforward data structures and keep the data and execution as separate as possible because data is static and easy.

      It has been 70 years and many ideas were hugely influential while some others ended up doing more harm than good. People thought inheritance was a great idea for 20-30 years too and we're still trying to fix that damage.

      7 replies →

You forgot QuickLisp+Ultralisp, which is like PIP and PIP with daily builds or whatever it's called in Python.

I keep hearing this, but not really seeing it.

I've used more Rust tools, and jobs are outside few niches non-existent.

  • I've been mostly working in Clojure shops since 2015. I've changed multiple roles, different companies, dissimilar domain spaces, moved across the states. Never had a problem finding a job. My problem is the opposite - I kept getting offers for dealing with Clojure, only because I already have a track record.

    Not recently though, right now it seems the market has just been completely obliterated and it is hard to find any kind of job, regardless of the tech stack.

Not my experience. I’ve played around with Common Lisp, Clojure, Scheme, Chicken, even wrote my own Lisp in C++. I’ve really wanted to like it, but it never stuck.

Also, the whole cult-like attitude from a number of people in the Lisp community was a big turn-off. All that “if you don’t get Lisp, you’re not smart enough, haven’t got enough experience, or just haven’t tried hard enough” BS gets pretty tiresome. Lisp is really simple. There isn’t much to “get”. Haskell/LEAN was much harder for me to “get” than Lisp. And LEAN absolutely blew my mind. Lisp didn’t.