LISP Family: Olympus of Programming or Underground
October 24, 2024
October 24, 2024
Freshcode
Do you still think LISP has lost its fame? No way!
You are indeed partly right if you'd say that the LISP programming language is being rarely used directly today. But at the same time, developers actively use Lisp standalone implementations such as Clojure, Сommon Lisp, Scheme, and others.
You may not even suspect where you can find a Lisp code. It lurks inside big codebases and is still used by business giants.
So...
- Is Lisp worth learning in 2022 and beyond?
- Why are Lisp concepts gaining popularity?
- What Lisp dialect is the most widely used nowadays?
Let's figure out it together in this post.
Keep calm and read my LISP: origins and ancestors
All these breathtaking facts and epithets are about LISP programming language, the subject of discussions with a thin layer of amusing mystery over it (often inappropriate but...)
Sure, there is no closed knowledge and the esoteric secrecy in LISP. It's just a garden of programmer's delight with a lot of eureka moments and profound enlightenment experience.
So, how it all began? What is a LISP?
Lisp (List Processing Language) was invented in 1958 by John McCarthy and was a pioneered functional programming with
- No need for variables or assignment
- Control via recursion and conditional expression
LISP origins are curious. John McCarthy's wanted something like "Mathematical Physics" — he called it a "Mathematical Theory of Computation". He needed a very general kind of programming language to make a user interface AI that he had thought up in the late 50s. So he needed a language that:
- Process data in lists (rather than arrays)
- Symbolic computation (rather than numeric)
- Syntax based on the lambda calculus
- S-expression
- No need for variables or assignment
- Control via recursion and conditional expressions
Ideas first introduced in Lisp included the if/then/else construct, first-class functions, recursive function calls, dynamic typing, lexical closures, interactive programming, dynamic memory allocation, garbage collection and incremental compilation.
Over time, it has spawned several dialects, including Common Lisp, Scheme, Clojure, Emacs Lisp, Racket, Hy, Arc, and others (more on this later).
Try LISP before you DIE, or why it's worth trying
LISP has been blessed as the most powerful programming language worldwide. Today it is the second-oldest programming language (after Fortran that is older by one year).
You won't find Lisp on the top of the charts kind of "the most popular language worldwide". But as you know 'ad populum' arguments are mostly irrelevant.
LISP pioneered a lot of key concepts that we find across a lot of languages today. It took its place and found a lot of apologists among developers. Even booming Python has many of the features of Lisp.
Learning LISP is a good way to master functional programming, so it's often used as an introductory language for undergraduate students.
But if everything is so great why LISP language clan isn't used universally? Why are so many still so skeptical about it? Why are many developers shying away from learning Lisp?
Let's see what Lisp programming pros and cons are commonly mentioned by its fans and opponents.
It's interesting that syntax is the point of both pros and cons lists. LISP syntax turns off many people — polish (prefix) notation and reams of parentheses take some time getting used to. But, be sure, once your eyes adjust to the parens, it feels like home!
LISP in real life: success stories
LISP-like languages continue to be used for software development and attract new users and businesses.
Let's remember some of the most famous Lisp-based business cases.
LISP dynasty: most popular LISP dialects
Is LISP a single language? What is the most important LISP dialect? What are the differences between them?
Well, language is a dialect with an army and navy. And of course, Common Lisp isn't the only Lisp in town. Let's briefly highlight the Lisp family and its bastard sons.
How clojure is different from other LISPs
No doubt, Clojure hit the scene as a modern LISP that embraced the JVM. It was called the most joyful programming language and there are good reasons why you should start learning Clojure.
Daniel Higginbotham, the author of "Clojure for the Brave and True", called learning Clojure a journey through the Four Labyrinths: The Forest of Tooling, The Cave of Artifacts, The Mountain of Language, and The Cloud Castle of Mindset.
So, this journey is worth trying! Let's see what is new under this Lisp hood.
- Standing on the shoulders of giants. Clojure runs on Java Virtual Machine and JavaScript platforms as opposed to CL and Scheme with the machine-code output of a compiler
- Interop with Java and JS libraries is seamless and comfortable
- ClojureScript lets you compile Clojure code to JS and has all the libraries of node / npm / JS
- Clojure borrowed OOP ideas from Common Lisp (multimethods)
- Case sensitive
- Most data structures are immutable
- Dynamically rebounding. With Clojure (global) functions can be dynamically rebound (if declared dynamic) without interfering with lexical local bindings
- There is more to collections than lists
- Clojure sequences are not specific collections. Sequences are not necessarily concrete lists. This enables them to be lazy
For more detailed information welcome here.
Wrapping up
Lisp-family languages enable programmers to write programs fast and create powerful and flexible software that is required for complex and rapidly evolving domains.
"Lisp is dead" is one of the most commonly repeated myths. It continues to be used for development and that continues to attract new users and businesses. More telling is the growth of open-source projects and the number of communities related to Lisp-family languages.
We don't claim that LISP-like language is the silver bullet that everybody should be using. But it's worth trying! "This experience will make you a better programmer, even if you never actually use LISP itself a lot". (c) PG
Freshcode team is happy to expand horizons with Clojure and its best LISP heritage. We are ready to consult you on how to benefit from Clojure software development and what solutions are suitable for your business — just fill our contact form.
with Freshcode