5 ms·
Often those who are curious to try Lisp are faced with a number of choices: Which dialect to choose? Which implementation to choose? Which book or tutorial shou
by susam 9y ago
Often those who are curious to try Lisp are faced with a number of choices: Which dialect to choose? Which implementation to choose? Which book or tutorial should one follow? Is it necessary use Emacs? SLIME?
Here are my recommendations:
- Choose Common Lisp because it has been the most popular dialect of Lisp in the overall history of Lisp. It is more convenient than Scheme if one decides to develop serious software in Lisp. Clojure appears to be more popular in the technology industry than Common Lisp among organizations (my workplace included) that use Lisp. I still recommend Common Lisp because I believe that it is more likely that one would work on an independent open source or hobby Lisp project than one would encounter one of the rare organizations who use Clojure at work.
- Choose SBCL (Steel Bank Common Lisp) as the implementation.[1][2] It is the most popular Common Lisp implementation and is recommended in many online discussions. CCL (Clozure CL, not to be confused with Clojure which is a separate dialect) is also another very good implementation. I still recommend SBCL because as a result of its greater popularity, it is readily available via package managers such as brew and apt-get as well IDE packages such as Portacle, Lisp in a Box, etc. CCL is currently missing from both brew and apt-get.
- Work through this book: Practical Common Lisp: http://www.gigamonkeys.com/book/ http://www.gigamonkeys.com/book/ (available in print too if you search online). Skip the sections about Emacs and SLIME if you don't use Emacs.
- There is no need to use Emacs if you are not an Emacs user. Any good editor would do.
- A Vim user may consider installing Slimv[3][4]. Superior Lisp Interaction Mode for Vim ("SLIME for Vim") or Slimv is similar to Emacs/SLIME, displays the REPL in a Vim buffer, and comes with Paredit mode that makes typing and executing Lisp code quite convenient.
- Emacs with SLIME or Vim with Slimv are quite useful but not necessary. To get started quickly without being bogged down by the details of an editor, just execute the Lisp source code file on shell.[5]
- Optionally, keep another implementation of Common Lisp. Common Lisp is a standard that is implemented by various implementations. Each implementation may have its own extensions or implementation-specific behaviour regarding error handling, command line options, FASL format, unspecified behaviour, etc. Experimenting with concepts with another implementation of Lisp occasionally may offer some perspective about how some things could be different in different implementations. I keep CLISP around for this purpose.[6][7][8]
[1]: Install SBCL on macOS: brew install sbcl
[2]: Install SBCL on Debian-based distro: apt-get install sbcl
[3]: Slimv in a ZIP file: https://www.vim.org/scripts/script.php?script_id=2531 https://www.vim.org/scripts/script.php?script_id=2531
[4]: Slimv as a Git repo: https://github.com/kovisoft/slimv/ https://github.com/kovisoft/slimv/
[5]: Load (execute) code in a file and exit: sbcl --script foo.lisp
[6]: Install CLISP on macOS: brew install clisp
[7]: Install CLISP on Debian-based distro: apt-get install clisp
[8]: Unfortunately CLISP is missing from Debian's stretch (stable) repository but it is available in its buster (testing) and sid (unstable) repositories. Hopefully this will be addressed when buster becomes stable. CLISP is available on Ubuntu.
- pavelludiq 9y agoPortacle makes it all even easier, it's a self-contained package of emagc/SBCL/Slime, etc. with sane defaults https://portacle.github.io/ https://portacle.github.io/
- xyrouter 9y agoCan Portacle be used without Emacs? Does it integrate with Sublime Text, Atom or Vim?
- pavelludiq 9y agoPortacle is an emacs packaged to be easy for beginners, so no :)
- aidenn0 9y agoYou are doing yourself a huge disservice developing in lisp without slime. I've been using a vi-like for 25 years and vim for 20 years and still use emacs/slime for my lisp development environment.
- flavio81 9y ago>Can Portacle be used without Emacs? Does it integrate with Sublime Text, Atom or Vim? For Lisp development, Emacs is superior. There's also SLIMV for VIM, giving the same features.
- svetlyak40wt 9y agoI'd recomment a ClozureCL instead of SBCL for a newcomer, because CCL does not do some optimizations and it is easier to debug. For example, it will show you local variables created by `let`, but SBCL – does not.
- weavie 9y agoRunning (declaim (optimize (debug 3))) in your repl will turn these optimizations off and give you roughly the same debugging experience.