Comment by jlarocco
7 years ago
For context, I'm a C++ and Python developer in my day job. I've been writing code for about 20 years and create a lot of small projects based on my interests (simple games, 2d/3d graphics, automation, web services, algorithm exploration, etc.). In the past I would use C++, Python, Ada, Haskell, and Ruby for those projects, as well as briefly looking at OCaml, Prolog, Mercury, Dylan, Nim, and some others.
For the past few years I've been using Common Lisp (almost) exclusively for these projects, and even some scripting at work. I have a couple projects in QuickLisp (a latitude/longitude <-> UTM converter and an STL file reader), I help maintain st-json (though I've only merged one changeset ;-), and I've written bindings to Blend2D and ZBar (both on GitHub but not in QuickLisp yet).
For me, Lisp hits a sweet spot between high level features, performance, and interactive development that I haven't found in any other language.
Here are some things I like about it:
* Interactive development
The Common Lisp mode for Emacs is fantastic. There's a REPL in the editor and it's super easy to send code back and forth. It's very convenient to play with a function as you're writing it - it's like an interactive unit test. When the function's working, the test code can be copy/pasted from the REPL into the unit tests.
Code navigation is also great. Alt-. will jump to the source code for the function under the cursor, and since SBCL and all of the libraries I use are open source, it works for everything, even things that would be language keywords in other languages.
Other languges have REPLs, but Lisp emphasizes it much more than the others. Haskell and Python have REPLs (ghci and Idle) but it's rare for software written in them to include a REPL, shipping Lisp software will often have a REPL available - I can connect to the StumpWM REPL, for example.
* The syntax
Some people get hung up on the parenthesis, but I like them. The syntax is consistent, it's easy to indent, it's easy to navigate in the editor, and there aren't punctuation marks all over the place.
* High level with good cross-platform performance
I'm too lazy to post evidence right now, but IME unoptimized Common Lisp is 15-20x faster than Python using the same algorithm, and maybe 1/2 - 1/10 the speed of C or C++.
With simple optimizations (adding type/function type declarations, etc.) the Lisp code can be 30-50x faster than Python, and near the speed of C++. Usually the optimized Lisp is almost exactly the same as the slower code, but has a few type declarations and (declare (optimize (speed 3))) added in.
* Libraries and Community
The CL community is pretty small, and most libraries are created by people scratching their own itch. They're not always perfect, but they'll usually get the job done. If not, most maintainers are happy to get pull requests. I personally like that, but it may not work for people who want "off the shelf", supported libraries that work in every situation.
I've found the community generally helpful and easy to work with. Getting libraries added to QuickLisp is quick and easy.
Interfacing with C code is really easy. For small libraries or a function or two using CFFI is dead simple. For larger projects cl-autowrap can wrap whole libraries easily - it uses llvm and clang to autogenerate the entire binding.
* Lots of books and references available
Lots of smart people (Guy Steele, Paul Graham, Peter Norvig, etc.) have used and written about Lisp, and there are some really unique and interesting books about it. "The Art of the Metaobject Protocol" and "Let Over Lambda" are two examples that really ighlight what makes Lisp unique.
No comments yet
Contribute on Hacker News ↗