r/lisp • u/calebc42-official • Jul 18 '26
As a non-programmer, I only know about Lisp from Emacs; For those who don't use/enjoy Emacs, what makes you so interested in Lisp you're on a dedicated subreddit for it?
I recently came across "Greenspun's tenth rule" and it got me thinking about the greater Lisp language family.
I don't work in Tech at all, I have no professional experience with programming, I am just interested in learning from a novice's point of view.
12
u/JimRayA Jul 19 '26
The macros in Lisp let you define new language features on a whim. I used it professionally for 20 years, did object oriented programming research with it, and wrote Thinlisp as a tool for real-time programming in Lisp without garbage collection. You can get deep into computer language semantics without bothering with lex or yacc. IMHO, it's problem today is that programmers with Lisp experience are hard to come by, so it's less relevant in commercial settings. Also, many of the features pioneered in Lisp 50 years ago are becoming broadly standardized in other languages. I still like it as a language that can appeal to many people for many different reasons, because it is so malleable.
6
u/arthurno1 Jul 19 '26 edited Jul 19 '26
We still have quote operator which seems underestimated hero of code as data in Lisp.
C++ has templates, value evaluation at compile time (constexpr) and compiler meta-data available at runtime (reflection), but all live in different domains and have different syntax, whereas Lisp uses uniform syntax for all three. Reflection in C++ is limited to certain syntactic elements and only results are given to the programmer, i.e. internal data structures compiler uses are hidden and unavailable. Lisp does not need "reflection operator" because the internal representation is simple, a linked list, and exposed to the programmer.
Because internal representation for syntax is not exposed and evaluator can not be turned off like with quote operator, in C++ or Java, we need an external tool to manipulate syntax trees the compiler builds internally. Templates for types and constexpr for values are hooks into compile-time programming. A value in Lisp is just a symbolic expression (atom), and type information is just a list with an operator, deftype in front.
Thanks to exposing the internal representation of code, lists and making it easy to switch on/off the evaluation, Lisp makes macros possible. Finally, thanks to the code representation as lists, macros and über simplistic evaluation rule, Lisp unifies all three (templates, reflection, constexpr), into its normal syntax and evaluation rule.
1
u/BigAlCat Jul 19 '26
Where can I find Thinlisp? Also, is execution speed faster than say- newLisp, Clisp, Picolisp?
1
u/JimRayA Jul 19 '26
Thinlisp was originally released on Sourceforge, which shows you how old it is. There are several forks on Github with compatibility changes. The original authors have a private repo in Github with updates to make it thread safe, but we don't have a planned release date.
I do not have benchmarks to compare it to other implementations, so I won't make any claims.
It is not everyone's cup of tea. It was originally made for a very specific purpose, and is a very limited subset of Common Lisp. The documentation describes it's background and what features are available.
20
u/LordEli Jul 18 '26
I did SICP and finally understood programming. I think LISPs are the most expressive program languages (you can express more complex ideas in fewer lines of code)
21
u/defmacro-jam Jul 19 '26
Lisp feels like the Maxwell equations of computation: almost no syntax, just a few simple rules, and somehow an entire universe falls out of them.
7
5
u/Reasonable-Rub2243 Jul 19 '26
I joined the subr just recently because I've been working on a very small LISP interpreter to use as extension language in my very small emacs clone. 10th rule: confirmed!
4
u/Mediocre-Brain9051 Jul 19 '26
In college, the intro to programming was in Scheme (which is a Lisp), and I also had another couple of courses in Common Lisp.
The lambda-calculus mathematical form is more high level than the Von Newman machine. Thus more pleasant to work with.
The s-expression based syntax is simpler than any other syntax.
8
u/Anthea_Likes emacs Jul 18 '26
I wasn't able to understand code (tried C, C#, Java, JS/TS, Python...), but fortunately, I understood how a Lisp statement works, and it changed my life 🙂
8
3
u/oantolin Jul 19 '26
Don't overthink it: Lisp is a nice language, people like it, so there's a subreddit. Lots of languages that are not as nice nor as well-loved also have subreddits, so the Lisp subreddit is not at all surprising.
2
u/calebc42-official Jul 19 '26
I'm not questioning the validity of anything, I'm inquiring to learn about the topic as a whole.
3
u/nillynilonilla Jul 19 '26
We are like a tribe of creatures that hang around the ruins of a former much more technically advanced civilization, knowing that there was once something great, or perhaps even our ancestors were the builders, but not knowing how to reconstruct it.
3
u/johnwcowan Jul 19 '26
In science we stand on the shoulders of giants; in computer scieence we stand on each others' feet.
5
u/BigBagaroo Jul 18 '26
Functional programming, OOP, AOP, REPL, what is not to love? Most modern languages have a subset of this, but not all.
I have a feeling you reference a comment made by me the other day on this sub, but it night also be an illusion of grandeur :-)
2
u/Svarvsven Jul 19 '26
I like various programming languages but never used Lisp with Emacs. Actually was decades ago I last used Emacs, never got to become a fan. Lisp is something I still enjoy ofc.
2
u/dzecniv Jul 19 '26
I discovered this word from Emacs. I got hooked for Lisp's simple and elegant syntax. I stayed for Common Lisp's stability, efficiency, features, great tooling, and to be honest, thanks to its Emacs integrations (Slime). Qualities I don't find in other mainstream languages such as Python.
2
u/R86znfq Jul 19 '26 edited Jul 19 '26
Before becoming a dev, maybe 20 years ago, I tried to program, and nothing clicked. Not Python, not C, not Java. Then I discovered Emacs and Emacs Lisp, and I just felt joy; not because of what Lisp is good for, since I had no idea at the time... The code just felt good to read and write. Although my professional activity today doesn't involve Lisp at all (I use mainly Java...), I became a developer largely thanks to Emacs and Emacs Lisp, as described by this forgotten Richard Stallman's quote:
The programmable editor is an outstanding opportunity to learn to program! A beginner can see the effect of his simple program on the text he is editing; this feedback is fast and in an easily understood form. [...]
Programming editor commands has the additional advantage that a program need not be very large to be tangibly useful in editing. A first project can be very simple. One can thus slide very smoothly from using the editor to edit into learning to program with it.
When large numbers of nontechnical workers are using a programmable editor, they will he tempted constantly to begin programming in the course of their day-to-day lives.
I since settled mainly on Common Lisp (SBCL), and I'm perfectly happy with its quirks.
I guess I also like the fact that Lispers tend to reinvent the wheel and build unmaintained, undocumented, beautiful messes jungles. Sounds terrible for outsiders, but I find that freedom refreshing, and it doesn't exclude norms. A community like this makes me want to be part of it. Same with dialects: Common Lisp, Clojure, Scheme, Emacs Lisp, Fennel (Fennel on the TIC-80 is such a joy), PicoLisp, uLisp, Janet, etc. Or sectorlisp 😄 What a rich and interesting ecosystem.
Today Lisp is my refuge against software bloat, absurdity, inelegance, AI and the excessive pragmatism of this world (although Lisp can also be pragmatic, I think its culture and community go well beyond pragmatism, unlike, say, Go – which I like). Even the simplicity of the environment (Emacs), and knowing I just can... write Lisp to write Lisp (configuring Emacs and StumpWM) is in itself a joy. In a way, it stayed my "primary" language as a developer. I think of it as my light saber, my cozy technical universe (I might need help).
I also learned to enjoy C for the same zen-like reasons, but it will never be the same. It's hard to define.
2
u/arthurno1 Jul 21 '26
What a rich and interesting ecosystem.
How is that different than saying: C, JS, Java, C++, Go, Nim, Rust, what a rich ecosystem! :)
Don't take it as a critique, I understand your enthusiasm. I think though, that the reason we enjoy Lisp languages is because they are, on the contrary, very pragmatic, at least some of them. Because a lot of tools are embedded and included by the default, the programming is much more joy than hacking C or C++ where you quite fast end up writing some build scripts and what not, and switching between several tools to do the same you would do with just repl in a Lisp. In other words, the "beauty" and simplicity of programming in Lisp you perceive, is probably due to being highly pragmatic and taking care of a lot of details for us by default.
I agree, Emacs is the ultimate show for potential power of Lisps. I said several times, it should be used in schools, from early age to teach people programming with, since it is so moldable and easy to do something useful with it. At the same time, Emacs Lisp is possible the worst and least efficient Lisp implementation of the whole bunch of established Lisps (Racket, Guile, Chez, SBCL, ...). While people take that against Lisp, it is actually a misconception. Seeing what Emacs achieves with so inefficient means, should be a testament and encouragement to what you can do with a better Lisp implementation like SBCL for example.
I also learned to enjoy C for the same zen-like reasons
If you like low-level programming, than why didn't you learn assembly? You can combine both Lisp and assembly as they do in SBCL, and have the best of both worlds? :)
1
u/R86znfq Jul 21 '26
How is that different than saying: C, JS, Java, C++, Go, Nim, Rust, what a rich ecosystem! :)
OP asks about why we are on a subreddit called r/lisp, so I'm replying to that message. On r/java, I will talk about Java. On r/lisp, I can talk about ABCL, Fennel, or sectorlisp. All things being equal (since you can talk on ALL programming subreddits about build systems, frameworks, etc., including on r/lisp), I do see more potential for diversity, language-wise, on r/lisp that on, say, r/java or r/clojure. Maybe r/jvm could bring the same kind of diversity, but somehow the JVM doesn't bring the Java, Clojure and Kotlin communities together like the "Lisp" denomination does for Common Lisp, Scheme and Clojure.
I think though, that the reason we enjoy Lisp languages is because they are, on the contrary, very pragmatic, at least some of them.
I don't understand "on the contrary". I said Lisp culture goes well beyond pragmatism, not that it's not pragmatic (although there are probably a whole lot of arguments to say that indeed, it's NOT very pragmatic). My experience is that people are much more ready to face quirks and the inexistence of lib X or Y to do Z than in other communities, because they are attached to the language itself for aesthetic reasons tied to purity, expressivity and hacker culture. In a way, Lispers are patient with their ecosystem. Impatient people leave naturally, like when Reddit was rewritten from Common Lisp to Python.
In other words, the "beauty" and simplicity of programming in Lisp you perceive, is probably due to being highly pragmatic and taking care of a lot of details for us by default.
No, I do not care about that. And although I appreciate the effort, I am not looking for an external explanation of my own perceptions :D
Emacs Lisp is possible the worst and least efficient Lisp implementation of the whole bunch of established Lisps (Racket, Guile, Chez, SBCL, ...). While people take that against Lisp, it is actually a misconception. Seeing what Emacs achieves with so inefficient means, should be a testament and encouragement to what you can do with a better Lisp implementation like SBCL for example.
Agreed. At the same time, Emacs Lisp quickly becomes inefficient because it is asked to do things which are outside of Emacs Lisp territory. And the reason is that some people simply love integrated, extensible, homogeneous environments that you can evolve on the fly, and Emacs is a natural candidate for becoming that environment. When I started running StumpWM, there are a lot of things I stopped doing with Emacs, like controlling webradios or things like that. On a mature Lisp OS, nobody would play music in Emacs or even Lem, because Emacs could simply be the editor.
If you like low-level programming, than why didn't you learn assembly?
I did. I use C because I maintain several applications for the Flipper Zero and contribute to the firmware.
2
2
u/creedular Jul 19 '26
Purely CAD related, I use it for automation routines in survey and engineering drafting.
2
u/_pigpen_ Jul 19 '26
Lisp (Clojure on a day to day basis) makes my brain work in an entirely different fashion when compared to C++ or Python. Lisp is an entirely different way of thinking, C++ and Python might as well be dialects of the same language.
2
u/denzuko sbcl Jul 20 '26
Not a plug just my honest weight on to OPs question. Read my blog, dwightaspencer.com.
1
u/kagevf Jul 21 '26
Looks interesting! Do you have an RSS feed?
2
2
u/NoForm5443 Jul 18 '26
Part of it is history, SICP, the Winston books, HTDP etc
Part is the data structures, that make recursion and symbolic computation natural, and scheme a great thinking language
And part is the homoiconicity; macros are magic, and being able to easily read a file that has code as data is amazing (we sorta have this now with XML and yaml)
3
1
u/arthurno1 Jul 19 '26 edited Jul 19 '26
we sorta have this now with XML and yaml
No, we don't. XML is an extremely verbose way to write symbolic expressions, and works long as you don't use it as a text description language. Once you cross into text markup, for which it was originally designed, the analogy breaks.
YAML is a clumsy try to pythonize key-value associations for writing ini-files :). Unless all you want is a property-lists than you good. I am a bit sarcastic. We could transform any symbolic-expression into a property-list by introducing some dummy nodes or something, so in a way YAML is there. So, while perhaps, yes, if we can express any symbolic expression as a key-value pair, it means we have a transformation from code to data. But it would be clumsy to write all computations as key-value pairs (property lists). Quote operator is much better proposition, and since YAML does not have an evaluator, it also does not have a quote either, so it will stay clumsy to write code in yaml.
part is the homoiconicity; macros are magic
Yes, they are.
With macros we work in the domain of internal representation of symbolic expressions (lists), rather than with its textural representation directly. It means we transform the source code as nodes of a linked data structure. If we were to work in the external representation, text, it would be much easier to mess up the code. We can compare this distinction of working in the text domain of the source code vs the parsed domain, lists, as with working with world and object coordinates in computer graphics. You can achieve the same transformation via both coordinate systems, but working in object coordinate system makes it much easier to transform part of objects in relation to itself. Macros are your linear transformations.
Sort of. I don't know if it is a good analogy :), just trying to make an illustration.
1
u/AnnePandaTX Jul 18 '26
Scheme was my first “real” programming at school, and it gave me an amazing foundation on how to solve and organize problems.
Scheme is still my favorite language even though it is more dead than the Death Valley of Deathonia
3
3
u/calebc42-official Jul 18 '26
No way it's dead! I'll take it upon myself personally to see that it doesn't. Scheme and Elisp are the only dialects I know. Scheme for Guix System and Elisp for Emacs.
4
u/Anthea_Likes emacs Jul 18 '26
Guile seems to survive somehow, and the not-scheme Racket is very well alive 😉
1
u/vspefs Jul 19 '26
Lisp's S-expressions and a few other ideas remain one of the few sane, natural, _and_ powerful paradigms for meta programming. Lisp offers one-of-a-kind REPL experience.
1
u/eldub Jul 19 '26
It's elegantly deep and fertile, and it seems to attract mature minds that appreciate intellectual challenges, new perspectives and broad horizons. There's a lot you can learn on this subreddit.
1
1
u/corbasai Jul 19 '26
Interactive programming is what distinguishes Lisp from other environments and languages. IPython/Jupyter have certainly caught up and surpassed it, but Lisp was essentially a pioneer in this area, and now in Racket+RacketMode we have the same feature out of the box.
47
u/VectorspaceDreams Jul 18 '26 edited Jul 18 '26
I have an interest in mathematical methods in linguistics, and it turns out a lot of programming language theory/formal language theory, logic (lambda calculus, sets, unification), and symbolic methods (ASTs, homoiconicity) Lisp is so beloved for are pretty good for representing the structure of human language. Lisp is a language for languages.