Understanding Lisp

Stepan Parunashvili writes:

Every lisp hacker I ever met, myself included, thought that all those brackets in Lisp were off-putting and weird. At first, of course. Soon after we all came to the same epiphany: lisp’s power lies in those brackets!

Stepan invites to his article, saying:

In this essay, we’ll go on a journey to that epiphany.

About Scheme which is a dialect of Lisp, Peter Norvig writes [1]:

The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. In comparison, Python has 33 keywords and 110 syntactic forms, and Java has 50 keywords and 133 syntactic forms. All those parentheses may seem intimidating, but Scheme syntax has the virtues of simplicity and consistency.

Norvig compares Scheme with Java on the example:

Java:

if (x.val() > 0) {
  return fn(A[i] + 3 * i,
            new String[] {"one", "two"});
}

Scheme:

(if (> (val x) 0)
    (fn (+ (aref A i) (* 3 i))
        (quote (one two)))

In fact, there’s a style of programming, well known in Lisp and Smalltalk circles, in which you define a toplevel function with calls to other functions that don’t yet exist, and then define those functions as you go in the resulting breakloops. It’s a fast way to implement a procedure when you already know how it should work.

‒ Mikel Evins, http://mikelevins.github.io/posts/2020-12-18-repl-driven/

REPL Driven Design is quite popular in Clojure circles. It’s also quite seductive. The idea is that you try some experiments in the REPL to make sure you’ve got the right ideas. Then you write a function in your code using those idea. Finally, you test that function by invoking it at the REPL.

‒ Robert C. Martin, "REPL Driven Design", https://blog.cleancoder.com/uncle-bob/2020/05/27/ReplDrivenDesign.html

There is one aspect of programming in which Common Lisp keeps it first position after so many years: “interactive programming.” Only few languages come close (maybe Racket is one of them). Interactive programming boosts your productivity so much that I believe it should always be part of the decision process when it comes to choosing a language to work with. Hopefully this advance in the practice of programming will be remembered when we design the language of the future.

I believe that for this reason alone Common Lisp is worth learning (and using).

https://ambrevar.xyz/modern-common-lisp/

Why does Lisp continue to be one of the most powerful, flexible, and concise programming languages in existence, despite the fact that it was invented in 1958–making it the second-oldest high-level programming language in the world?

https://insearchofsecrets.com/2014/08/04/lisp-smalltalk-and-the-power-of-symmetry/

What makes Lisp powerful isn’t its macros, it’s the fact that Lisp runs in the same context it’s written in. It’s s-expressions all the way down.

https://insearchofsecrets.com/2014/08/04/lisp-smalltalk-and-the-power-of-symmetry/


  1. https://norvig.com/lispy.html ↩︎