Why I Program in Lisp

ska80 | 284 points

Good article. Funnily enough the throw away line "I don't see parentheses anymore". Is my greatest deterrent with lisp. It's not the parens persay, it's the fact that I'm used to reading up to down and left to right. Lisp without something like the clojure macro ->, means that I am reading from right to left, bottom to top - from inside out.

If i programmed enough in lisp I think my brain would adjust to this, but it's almost like I can't full appreciate the language because it reads in the "wrong order".

discmonkey | 6 days ago

Whenever I hear someone talking about purely functional programming, no side effects, I wonder what kind of programs they are writing. Pretty much anything I've written over the last 30 years, the main purpose was to do I/O, it doesn't matter whether it's disk, network, or display. And that's where the most complications come from, these devices you are communicating with have quirks that need you need to deal with. Purely functional programming is very nice in theory, but how far can you actually get away with it?

lukaslalinsky | 7 days ago

Had a PalmPilot taped to a modem that did our auth. Lisp made the glue code feel like play. No types barking, no ceremony—just `(lambda (x) (tinker x))`. We didn’t debug, we conversed. Swapped thoughts with the REPL like it was an old friend.

DadBase | 6 days ago

The most impressive thing, to me, about LISP is how the very, very small distance between the abstract syntax tree and the textual representation of the program allows for some very powerful extensions to the language with relatively little change.

Take default values for function arguments. In most languages, that's a careful consideration of the nuances of the parser, how the various symbols nest and prioritize, whether a given symbol might have been co-opted for another purpose... In LISP, it's "You know how you can have a list of symbols that are the arguments for the function? Some of those symbols can be lists now, and if they are, the first element is the symbolic argument name and the second element is a default value."

shadowgovt | 6 days ago

Always read from experienced developers praising lisps, but why is it so rare in production applications?

bgitarts | 6 days ago

Terry Pratchett's quote in one of his books (in fact I think this is a running gag, and appeared in multiple books):

  Five exclamation marks, a sure sign of an insane mind
That's what I think about five closing parentheses too... But tbh I am also jealous, because I can't program in lisp at all
p0w3n3d | 6 days ago

I agree with some statements OP makes but not others. Ultimately, I write in lisp because it's fun to write in Lisp due to its expressive power, ease of refactoring, and the Lisp Discord[1].

> Lisp is easier to remember,

I don't feel this way. I'm always consulting the HyperSpec or googling the function names. It's the same as any other dynamically typed language, such as Python, this way to me.

> has fewer limitations and hoops you have to jump through,

Lisp as a language has incredibly powerful features find nowhere else, but there are plenty of hoops. The CLOS truly feels like a superpower. That said, there is a huge dearth of libraries. So in that sense, there's usually lots of hoops to jump through to write an app. It's just I like jumping through them because I like writing code as a hobby. So fewer limitations, more hoops (supporting libraries I feel the need to write).

> has lower “friction” between my thoughts and my program,

Unfortunately I often think in Python or Bash because those are my day job languages, so there's often friction between how I think and what I need to write. Also AI is allegedly bad at lisp due to reduced training corpus. Copilot works, sorta.

> is easily customizable,

Yup, that's its defining feature. Easy to add to the language with macros. This can be very bad, but also very good, depending on its use. It can be very worth it both to implementer and user to add to the language as part of a library if documented well and done right, or it can make code hard to read or use. It must be used with care.

> and, frankly, more fun.

This is the true reason I actually use Lisp. I don't know why. I think it's because it's really fun to write it. There are no limitations. It's super expressive. The article goes into the substitution principle, and this makes it easy to refactor. It just feels good having a REPL that makes it easy to try new ideas and a syntax that makes refactoring a piece of cake. The Lisp Discord[1] has some of the best programmers on the planet in it, all easy to talk to, with many channels spanning a wide range of programming interests. It just feels good to do lisp.

1: https://discord.gg/HsxkkvQ

djha-skin | 6 days ago

As much as I sympathize with this post and similar ones, and as much I personally like functional thinking, LISP environments are not nearly as advanced anymore as they used to be.

Which Common LISP or Scheme environment (that runs on, say Ubuntu Linux on a typical machine from today) gets even close to the past's LISP machines, for example? And which could compete with IntelliJ IDEA or PyCharm or Microsoft Code?

https://ssw.jku.at/General/Staff/PF/genera-screenshots.html

jll29 | 6 days ago

This is the first article I’ve ever read that made me want to go learn Lisp.

efitz | 7 days ago

Could a not-too trivial example like the difference between a Java sudoko solver and a lisp version with all the bells and whistles of FP such as functions as data and return values, recursion and macros be used to illustrate the benefits?

smckk | 6 days ago

> Other general purpose languages are more popular and ultimately can do everything that Lisp can (if Church and Turing are correct).

I find these types of comments extremely odd and I very much support lisp and lisp-likes (I'm a particular fan of clojure). I can only see adding the parenthetical qualifier as a strange bias of throwing some kind of doubt into other languages which is unwarranted considering lisp at its base is usually implemented in those "other general purpose languages".

If you can implement lisp in a particular language then that particular language can de facto do (at least!) everything lisp can do.

terminalbraid | 7 days ago

I've never programmed in a Lisp, but I'd love to learn, it feels like one of those languages like Perl that are just good to know. I do have a job where getting better with SKILL would be useful.

0xTJ | 6 days ago

"Why I Program in Lisp"

because you don't have money to waste on doctors?

fithisux | 3 days ago

Surely one of the the main reason to program in Lisp (and Haskell, and ???) is so you can write blog posts about doing so :-)

(I do really like Lisp).

dramm | 6 days ago

> Lisp's dreaded Cambridge Polish notation is uniform and universal. I don't have to remember whether a form takes curly braces or square brackets or what the operator precedency is or some weird punctuated syntax that was invented for no good reason. It is (operator operands ...) for everything. Nothing to remember. I basically stopped noticing the parenthesis 40 years ago. I can indent how I please.

Well, that might be true for Scheme, but not for CL. There are endless forms for loops. I will never remember all of them. Or even a fraction of it. Going through Guy Steel’s CL book, I tend to think that I have a hard time remembering most of the forms, functions, and their signatures.

submeta | 6 days ago

[dead]

curtisszmania | 6 days ago

[dead]

prakashrj | 6 days ago

[flagged]

coolThingsFirst | 7 days ago

Programming is about coordination between tasks. Prove me wrong.

revskill | 7 days ago

>It's less of a big deal these days, but properly working lambda expressions were only available in Lisp until recently.

I think Haskell and ML had lambda expressions since like 1990.

DeathArrow | 7 days ago

"properly working lambda expressions were only available in Lisp until recently."

until -> since

damnitbuilds | 7 days ago

I’m not really familiar with Lisp, but from glancing at this article it seems like all of these are really good arguments for programming in Ruby (my language of choice). Easily predictable syntax, simple substitution between variables and method calls, dynamic typing that provides ad hoc polymorphism… these are all prominent features of Ruby that are much clunkier in Python, JavaScript, or really any other commonly used language that I can think of.

Lisp is on my list of languages to learn someday, but I’ve already tried to pick up Haskell, and while I did enjoy it and have nothing but respect for the language, I ultimately abandoned it because it was just too time-consuming for me to use on a day-to-day basis. Although I definitely got something out of learning to program in a purely functional language, and in fact feel like learning Haskell made me a much better Ruby programmer.

zoky | 7 days ago

Given that code is mostly written by LLMs now (or will be soon) isn't it better to just use the best language that fits these requirements:

- LLM well trained on it. - Easy for human team to review. - Meets performance requirements.

Prob not lisp?

i_love_retros | 6 days ago