Typed Lisp, a Primer

55 todsacerdoti 17 5/4/2025, 5:17:35 PM alhassy.com ↗

Comments (17)

breadchris · 1h ago
I have really fallen in love with LISP recently, specifically clojure. A strong type system is really needed for it to make me feel like I can confidently develop with it.
vindarel · 40m ago
just get Common Lisp with this new Clojure collection and sequence API! https://github.com/dtenny/clj-coll
nextos · 7m ago
A modern CL that borrows ideas from Clojure, and with a strongly typed language (Coalton) is indeed very appealing!
gitroom · 10m ago
honestly i kinda love when deep dives like this pop up, makes me rethink stuff i thought i'd settled on - you think things ever get simple with lisp or it always stays quirky no matter how you do it
codr7 · 2h ago
The main issue I have with CLs type checking is the clunky syntax and the fact that it looks different in different contexts.

I made an attempt to fix that for eli: https://github.com/codr7/eli#type-checking

rjsw · 2h ago
Your eli looks clunky to me.
codr7 · 1h ago
Well, use something else.

And maybe ask yourself why you felt saying so was important to you.

dokyun · 1h ago

    (the number (+ 35 7))
is a lot less clunky than

    (+ 35 7)@Numeric
HexDecOctBin · 39m ago
One problem with Lisp is everything, including variable bindings, increases the nesting level making the code illegible. Last thing you want is for the type declaration to have their own nesting.
codr7 · 1h ago
That's your opinion, I don't agree. And the other reason is I can use the same syntax wherever I want type checking.
NikkiA · 2h ago
praising 'loop' in the same post as describing lisp as 'elegant' shakes head
kagevf · 1h ago
My opinion of LOOP started to change when I read (the much maligned) "Land of Lisp" and went over that "periodic" diagram in TFA. Seeing the elements of LOOP broken down like that went a long way to get me to overcome my original aversion to it.
codr7 · 2h ago
Some people seem to like it, and be very effective using it.

The problem is it's a walled garden, with its own quirky syntax; nothing that happens inside of loop is applicable outside, and the other way around.

shawn_w · 1h ago
I feel bad for people who haven't discovered ITERATE yet.
Jtsummers · 1h ago
ITERATE still breaks when you use `count` inside it, the built-in CL function. If they ever address that problem I'll get back to use it but having a time bomb in my programs isn't something I like.

Trivial example of breakage:

  (iter (for i from 1 to 10)
    (print (count i some-sequence)))
shawn_w · 48m ago
Breaks how? I'm on my phone, not a computer right now and can't test, but that should call the CL function - ITERATE uses `counting` for that particular operation to avoid conflicts; see https://iterate.common-lisp.dev/doc/Gathering-Clauses.html

Or is the documentation wrong?

Jtsummers · 38m ago
Apparently this is a quicklisp problem, they haven't updated the release since 2021 when it was still broken.