← Back to context

Comment by drob518

4 hours ago

You don’t program in Lisp, do you? I used to be confused by the smug Lisp weenies. Now I am one. And the difficult thing I’ve found over the years is that Lisp is sort of unexplainable. You either “get it” or you don’t. Yes, it has macros, but macros are a bit overrated. I’ve been programming in Lisp for decades and I rarely write macros. I think the thing that is difficult to convey is how powerful Lisp’s core execution environment is while at the same time being just a page of code that a CS undergraduate can understand. Literally everything else is a library. And those libraries can create syntax, generate code on the fly, and do many other powerful things. But most people won’t “get it” until they take the plunge. I didn’t. Until I did. And now, I don’t feel a need to defend Lisp at all. It won’t go away. You can’t kill it. The folks that “get it” will always have it, and those that don’t “get it” will reach for their Blub language again and again. Such is the way of the world.

Yeah, I didn't get it either until I implemented my own lisp.

> the difficult thing I’ve found over the years is that Lisp is sort of unexplainable

I've found that getting rid of the parentheses helps.

  f(x)
  (f x)
  ["f", "x"]

  (print (< 10 20))
  ["print", ["<", 10, 20]]

Lisp code is just normal Python lists which get evaluated by an interpreter function. Like this:

  code = ["print", ["<", 10, 20]]

  def eval(code):
      # magic

  eval(code)
  True

Filling out that eval function is a great way to learn lisp.

These articles are very good and accessible:

https://www.norvig.com/lispy.html

https://norvig.com/lispy2.html

> You don’t program in Lisp, do you?

Not anymore. I started with Racket and went through the Little Schemer. I did Clojure for a while. I even used Babashka to write all my scripts, then later rewrote them in other languages.

I gave it a good try. Maybe it wasn't enough to properly "get it"?

  • Aw man I love babashka. I will say the lack of static types in clojure is pretty brutal for me. Especially when combined with the obtuse error messages. But I still love babashka and the whole REPL driven world.

    What did you end up rewriting your bb scripts in?

    • If there's one thing that I sometimes wish Lisp had, it's types. Most of the time, I don't need or even want them. But when you're doing a big refactor or changing the shape of your primary data structure, it would be nice to have the compiler be able to assist you in detecting locations where you've cross-wired something. But other than that, I don't care. And yes, Clojure's error messages could be better, but they have been getting better over time.

  • That's a very reasonable try. Your statements are not unfounded. If I may ask, what's your daily driver now and why do you favor it over Lisps?

There are reasons why not that many programmers “get it”, and it’s not because the others are uninformed. It’s a matter of valuing different things.

  • Hmm, that'd be weird, how do you know you "value something different" if you haven't "got it"? You'd need to "get it" first, then you can understand if you value something different or not, otherwise how would you know?

    • The usual insinuation is that if you don’t like it, you “just don’t get it”. I meant not “getting it” in that sense.

  • Absolutely! But it’s also because they don’t really understand one of the things. It’s the Blub Paradox.

this is incredibly smug, but fun to read :) I briefly "got" Clojure but forgot again. Maybe I'll give this Janet thing a try.

  • LOL, indeed. Clojure is fun. I haven't used Janet, but I appreciate seeing some of the good ideas that it stole from Clojure (stealing being the sincerest form of flattery, and all that). IMO, one of Clojure's greatest gifts, above and beyond other traditional Lisps like CL and Scheme, is its focus on immutable data structures. When I started playing with Clojure, I was skeptical. I figured performance was going to be horrible. Now, I can't live without them. It's one of those subtle features that just changes how you program. It's one reason I choose Clojure over CL and Scheme today. Janet seems to have both mutable and immutable data structures, which is nice. Clojure has transients, but that's sort of partially mutable. That said, with Clojure, one of the nice things is that you can always drop back to Java's full mutability if you want, but that's obviously relying on the platform and not Clojure the language.