A Road to Common Lisp (2018)
stevelosh.com
stevelosh.com
Lisp is a gift and I am extremely thankful for it.
But I gave Clojure a try despite the bad taste in my mouth Common Lisp left, and it was def worth it.
To try it out real quick: https://tryclojure.org/
That said, the JVM is wonderful and Clojure is the best way to access it.
I've used Clojure for close to a decade. It's been an issue maybe once. The JVM is absolutely a plus for Clojure.
With those two reasons in mind, at the time Clojure was created, it made a lot of sense to use the JVM.
I see what you did there.
One comment there said, "This is a godsend. Probably the best introductory article on Lisp to date."
This is one of the better design choices with Julia IMHO
documentation is also a good one to know. Common Lisp makes pretty much the entirety of the system available to you programmatically. Browsing the CL Hyper Spec is a good way to discover these things, too.
Did I say it was a good introduction? What are you replying to with this?
That is, I love the idea of everything being exposed. And I dream of the idea of interacting with the system this way.
However, I can count on one hand the number of people I have worked with that new you could get documentation that way in python. The world has moved on to browsers being the expected place for all documentation. :(
(documentation 'documentation 'function)
Any Lisp IDE (like SLIME/GNU Emacs, LispWorks, ...) will have ways to show documentation.DESCRIBE is a more general tool, similar to INSPECT. Using runtime introspection.
## Pick and Editor
The article is right that you can start with anything. Just `load` your .lisp file in the REPL. But even in Vim, Sublime Text, and Atom [and also VSCode] you can get pretty good to very good support. See https://lispcookbook.github.io/cl-cookbook/editor-support.ht... (also Lem, a CL editor that works for other languages, Jupyter notebooks, Eclipse (basic support) and LispWorks (proprietary, advanced graphical tools).
> if anyone is interested in making a Common Lisp LSP language server, I think it would be a hugely useful contribution to the community.
Here's a new project used for VSCode: https://github.com/nobody-famous/alive-lsp There's also https://github.com/cxxxr/cl-lsp
## Other resources
I already linked to it, but the Cookbook (to which I contribute) is a useful reference to see code and get things done, quickly. https://lispcookbook.github.io/cl-cookbook/
While I'm at it, my first shameless plug: after my tutorials written for the Cookbook and my blog, I wanted to do more. Explain, structure, demo real-world Common Lisp. I'm creating this course (there are some free videos): https://www.udemy.com/course/common-lisp-programming/?coupon... (ongoing -50% coupon for June).
## Web Development
See the Cookbook, and the awesome list (see below). We have many libraries, you still have to code for things taken for granted in other big frameworks. I have some articles on my blog.
We have new very cool kids in town, especially CLOG, that is like a GUI for the browser. Check it out: https://github.com/rabbibotton/clog
## Game Development
See again the awesome-cl list. And the Kandria game, in the making, all done in CL: https://kandria.com/ (it just got accepted for a Swiss grant, congratulations).
## Unit Testing
We have even more test frameworks since 2018! And some are actually good O_o
## Projects
To create a full-featured CL project in one command, look no further, here's my (shameless plug again) project skeleton: https://github.com/vindarel/cl-cookieproject you'll find the equivalent for a web project, lighter alternatives in the README, and a demo video: https://www.youtube.com/watch?v=XFc513MJjos&feature=youtu.be
## Libraries
He doesn't mention this list, what a shame: https://github.com/CodyReichert/awesome-cl => the CL ecosystem is probably bigger than you thought. Sincerely, only recently, great packages appeared: CLOG, cl-gserver (actors concurrency), 40ants-doc, official CL support on OVH through Platform.sh, great editor add-ons (Slite test runner, Slime-star modules…), Coalton 1.0 (Haskell-like ML on top of CL), April v1.0 (APL in CL), a Qt 5 "library" (still hard to install), many more… (Clingon CLI args parser, Lish, a Lisp Shell in the making, the Consfigurator deployment service, generic-cl)…
His list is OK, I'd pick another HTTP client and another JSON library (new ones since 2018 too), but that's a detail.
BTW, see also a list of companies: https://github.com/azzamsa/awesome-lisp-companies/
## Community
We are also on Discord: https://discord.gg/hhk46CE and on Libera Chat.
## Implementations
CLASP (CL for C++ on LLVM) reached its v1.0, congrats. https://github.com/clasp-developers/clasp/releases/tag/1.0.0 More are in the making…
We got dynamic library delivery tool for SBCL (sbcl-librarian), more good stuff is coming…
Allegro CL (proprietary) got a new version running in the browser…
Crazy Lisp world <3
You mentioned VSCode: I was surprised at how well the GitHub Codepilot plugin works with Common Lisp code - not as well as with Python or JavaScript, but pretty good. Check it out.
Also if you know you ultimately need to deploy a native binary and only a native binary will work, common lisp historically produces alarmingly fast native binaries. I haven't needed to use this in racket much so I can't directly compare; it doesn't seem to prioritize perf but still seems to be much faster than other languages that don't prioritize perf.
I definitely prefer racket though. It's a bit clunky in places too but is overall much better planned and still has all the extensibility benefits.
Common Lisp is a language standard with multiple (very different) implementations. SBCL is a native code compiled Lisp with type inference. ECL compiles to C or byte codes, with an interpreter. LispWorks and Allegro CL are commercial Lisps with IDEs and GUIs. CLASP integrates with C++. There are a bunch of other ones.
Common Lisp isn't an academic product.
I'm by no measure an expert. Two things I noticed what I really LOVE about Clojure versus CL.
1) The immutability by default: Yes I know you can "get there" in LISP but Clojure really has this as part of the core dna of Clojure. Immutability is surely not the silver bullet it claims to be, but dammit it has made my programs so much nicer and elegant !
2) Square-brackets [] for function parameters: As a newbie to LISP* getting used to the syntax will take some effort. But I feel that with the [] of Clojure it makes it sooo much easier...
YMMY.
"The best book I've found for getting started in Common Lisp is Common Lisp: A Gentle Introduction to Symbolic Computation. "
Then you should be set to start tackling the boring nerd stuff.
Lately I have been working the Exercism exercises and there are over 80 Common Lisp problems, with more problems being added over time (my hope is to finish what's there and then help by adding some more).
[0] https://www.youtube.com/watch?v=HM1Zb3xmvMc [1] https://github.com/norvig/paip-lisp
It's better in print because then you don't need to swap between two apps on the same screen. Plus then you actually type out the code, which is a great exercise.