Skip to main content

Motivation

Why Learn Common Lisp?

In a world dominated by mainstream programming languages, you might ask, "Why should I learn Common Lisp?" It's a fair question. Common Lisp isn't the trendiest language, but it offers a unique blend of power, expressiveness, and timeless concepts that make it a worthwhile investment for any serious programmer.

Here's why you should consider learning Common Lisp:

  • Dynamic and Interactive Development: Common Lisp's dynamic nature and interactive REPL (Read-Eval-Print Loop) enable a highly iterative development process. You can write code, evaluate it immediately, and make changes on the fly without recompilation. This fosters experimentation and rapid prototyping. This is a very strong contrast to the "Compile and Run" style of programming most other languages have. After programming in a REPL driven way, you will realize just how fast you can develop correct working programs compared to almost every other language.
  • Powerful Object System (CLOS): The Common Lisp Object System (CLOS) is a highly flexible and powerful object-oriented programming system. It supports multiple inheritance, multimethods (methods dispatched on the types of multiple arguments), and metaobject protocols (MOP), which allow you to customize the object system itself. CLOS is extremely powerful, and if you use it properly, you will even wonder how is it that other languages like Java, which are Object Oriented focused, are so limiting and primitive in their capabilities. Using CLOS can lead to effective, succint, and powerful programs. In my opinion, this is one of the most underrated and convincing arguments to use Common Lisp over any other programming language. There's no need for all the "Design Patterns" in Common Lisp like in the non dynamic languages.
  • Mature and Stable: Common Lisp has a long history, dating back to the late 1950s. This means it's a mature and stable language with well-defined standards and implementations. While it may not be the newest language on the block, it has stood the test of time and continues to be used in demanding applications. You can easily run code from the 1970s without much modifications. That's 54 years ago at the time of writing. Compare that to python, where my 10 year old libraries are incompatible with python 3 because of breaking changes. If you want to write code which will work in another 50 years, Common Lisp will do it. Any long term project should seriously consider using Common Lisp. While not the most popular language, it will most certainly be used in production systems in another 50 years, which is not a claim that can be made by most other fad languages which come and go as soon as another fad shows up. (If you think python is here to stay, think about perl)
  • Metaprogramming Power: Lisp's macro system is unmatched in its ability to manipulate code at compile time. This allows you to extend the language itself, create domain-specific languages (DSLs), and implement powerful abstractions that are simply not possible in many other languages. With macros, you're not just writing programs; you're shaping the language to fit your problem. This can potentially drastically reduce the amount of code you write and make it much easier to reason about your programs. It's hard to understand this until you've actually had to use macros in a large project and realize how much boiler plate code the reduce and how expressive your code becomes.
  • Unparalleled Expressiveness: Lisp's syntax, based on symbolic expressions (s-expressions), allows for extremely concise and elegant code. It's often said that you can express complex ideas in fewer lines of Lisp than in most other languages. This leads to faster development cycles and more maintainable code. Once you learn to edit code based on s-expressions, the speed of at which code can be restructured and reasoned about is also unparalleled in non-s-expression languages. S-Expressions also make it very easy to understand properly formatted and indented code because the indentation reveals the structure of the code. This is something usually not understood by non Lisp programmers until they experience it themselves.
  • Extensibility and Stability: The nature of the language makes it so that most new programming ideas can be implemented in Common Lisp without the need of a change in the compilers. This makes it so that multiple competing libraries can implement functionality which in other languages would only be up to the language designer. This in turn allows for the best of the competing ideas to succeed, for cross polination of ideas between libraries, and for quick adoption of new ideas. All of these things are simply not possible in most other languages. Not only that, but because of the ANSI Standard, Common Lisp is stable. This means that none of these changes and new functionality will break backward compatibility. Furthermore, for the rare instances where new functionality cannot be implemented on top of the language, many competing implementations can have different approaches, which repeats the process of allowing for competition and cross polination. Before you think this is something bad because it means code will be implementation dependent (which is the case for almost every other language out there, so this by itself is a non argument), consider tha once the competition settles for what the best approach for novel ideas are, trivial libraries usually follow very quickly, which make writing code implementation-independent. So basically Common Lisp delivers the best of both worlds, fast implementation of novel ideas, backwards compatibility, and eventually implementation independent code via trivial libraries which will make your code stand the test of time. No other language that I know of has this benefit, rather they mostly deal with the tradeoff between implementation of new ideas, and making code backwards compatible when changes need to be made.
  • Focus on Concepts: Learning Lisp allows you to think differently about programming. While all the usual programming facilities of C-like procedural programming are available, it allows for many other fundamental concepts like recursion, symbolic computation, and metaprogramming, which can make you a better programmer in any language.
  • A Different Perspective: In a world of C-style syntax and object-oriented dogma, Lisp offers a refreshing and unique perspective on programming. It challenges conventional wisdom and encourages creative problem-solving.
  • Practical Applications: Common Lisp is used in production in all sorts of fields. While it is true, that large libraries for some repetitive work are not as common as in some other languages, the speed to develop a custom solution can usually dwarf the need for those libraries to begin with. For any standard functionality, there are usually multiple Common Lisp libraries, and the community is usually very responsive in accepting changes and contributions.

If you're looking for a language that will challenge you, expand your programming horizons, and provide you with powerful tools for solving complex problems, then Common Lisp is worth exploring. Dive in and discover the power and elegance of Lisp!

Additional Resources

See the Why Lisp? section of our website which has a few collected articles from around the web.