Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is the magic behind Lisp anyways?

Is it that the Lisp language exposes the Abstract Syntax Tree (AST) of the code, so that you can reformulate it into your domain-specific macros, thereby helping you encapsulate complex logic into more succinct constructs?

Is this why they say that Lisp is fantastic for small groups of programmers, that share similar groupthink, and uses all the same macros, but it becomes a horrendous mess when multiple teams are involved.



> magic

I'd say yes, this, though you don't actually manipulate a proper AST, but a list (tree) of program instructions. An AST would be given by a "code walker". Plus, the syntax is small and coherent, the language is stable, the syntax makes it straightforward to add new language constructs that would need a language release for another classical language. With most implementations of Common Lisp, you code against a live image, so you get instant feedback: compile a function with a keybinding, see compiler warnings or errors instantly, try it right away in the REPL (no process had to restart), get an interactive debugger on an error, fix it and resume the execution from a chosen frame (no stack unbinding), inspect objects, change a class definition and have existing objects being (lazely) updated, given rules in the standard that you can control… when ready, build a binary, and deploy. Today, SBCL's compile-time type-inference warnings are very helpful.

Of course, some companies use CL in a million-sized codebase (if that helps as a counter example): Google (ITA software), SISCOG (underground and rail transport optimisation), ACL2 (industry-strength theorem prover)…

https://lisp-lang.org/success/

https://github.com/azzamsa/awesome-lisp-companies (disclaimer: these resources are not complete)


This sounds incredible. I wonder why Lisp didn’t catch on as a more popular programming language.


I can give you some pointers, as a relatively young lisp developer (came to it ±3 years ago): at the time, unappealing official website (now fixed); only books to learn, few online code-first resources, so was harder to learn than necessary (greatly improved); only Emacs & Vim first-class support (now we have very good Atom and VSCode plugins, and more (Jupyter kernel,…)); hard to find libraries (only Cliki existed, it's now better, and there are plenty of libraries); Quicklisp seemed limited from the outside (although it's great) (we now have Ultralisp and the CLPM package manager, along with Qlot (directory-local installations), utilities like Roswell etc); hard to know if the language was being used at all (we now have lisp-lang.org showing success stories, awesome-lisp-companies shows more examples); hard to get into web development / no major framework (the Cookbook helps and there are many choices, although still no world-class framework. But I use a Lisp backend, classical Django-like templates and it's enough to build real-world, work-related stuff); no good GUI options (there was Qt4 without much examples, and Ltk. We now have IUP bindings, some more, and a Qt5 is coming soon©);…

Others know better the limitations of Lisp systems of the 80s or 90s. The compilers also improved (SBCL; there is CLASP in development to interface with C++ code, and more)

TLDR; it's catching up :D


> Is this why they say

No, why they say is because they have zero experience with Lisp, in any size project.

And there exists no tool using which some people have not made big, huge mess. We can easily lob this criticism at anything, quite randomly.

Imagine a tool which has the property that a team of doofuses, no matter how large (in head count and doofiness), cannot make any sort of "horrendous mess". What sort of limitations does that entail, and could any of us here live with them?


So what has your industry experience with Lisp been like?


lisp program is the program, not a representation of one like in all other kinds of languages (except machine code, which isn’t really a language).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: