6 ms·
Can anyone recommend a source for setting up an environment in Linux to run the code in this book? Do I need to learn eMacs to get close to a “modern lisp” pro
by wodenokoto 4y ago
Can anyone recommend a source for setting up an environment in Linux to run the code in this book?
Do I need to learn eMacs to get close to a “modern lisp” programming environment?
- math-dev 4y agoemacs is the easiest but you can try lispworks personal edition or allegro common lisp (they have a web ide IIRC) there’s portacle which combines emacs with a lisp environment
- zelphirkalt 4y agoEmacs would be a fine choice, but is not mandatory, if you can live with less support for parens found in other editors. Emacs traditionally excels at working with lispy languages and REPLs. I started working through the book, but did not feel like using Common Lisp. Instead I used GNU Guile. I am not very far in the book yet, but so far I was able to translate between Common Lisp and Scheme easily. So for me the way to set things up was to install GNU Guile. I did that via GNU Guix package manager. However, GNU Guix can also install SBCL, so that you could use Common Lisp as the book does. SBCL is also in many distros' repositories.
- andrejlamov 4y agodo you think elisp will work for this book? or would one need to implement unique common lisp features in elisp? or will elisp just be too slow
- math-dev 4y agomost of it should work in elisp, note that elisp and common lisp have different semantics for IF. you might find some variances later on. also elisp doesn’t have as nice a debugging environment as SLIME so I’d honestly recommend just setting up common lisp
- proamdev123 4y agoWhat does “IF” stand for in your comment? Are you referring to the IF expression or something different?
- math-dev 4y agoignore me, read the comments above
- kazinator 4y agoAs far as I can tell, any Elisp if-form that is also a valid Common Lisp if-form has the same semantics; but Elisp allows more than one else-form in its syntax, with additional semantics. It's something like: (defmacro elisp-if (expr then &rest elses) `(cond (,expr ,then) (t ,@elses))) Whereas the regular if is like: (defmacro cl-if (expr then &optional else) `(cond (,expr ,then) (t ,else))) In a book that uses Common Lisp, you shouldn't see an if-form that isn't Elisp-compatible.
- math-dev 4y agoOh yes you are 100% right, I just had a brain fart. Thanks for correcting
- trenchgun 4y agoYou should use Common Lisp for this book, unless specifically want a challenge.
- medo-bear 4y agothis is ridiculous for a first reading. its the same as telling someone to use common lisp for sicp. why? maybe on a second or third reading for fun but to digest this book just use a well supported language like common lisp for which the book was written
- zelphirkalt 4y agoI can switch to Common Lisp at any time later in the book, if I feel, that translating to Scheme is too difficult for me. I will need to understand CL anyway, to do the translation. What I do not like about CL is probably one of the "wars" fought in computer programming: I do not like, that I have to use funcall, instead of simply wrapping with parens. I do not like, that variables and functions are in separate namespaces. However, if going through the book using Scheme gets too complicated, these are not things I cannot get over. EDIT: I probably also do not like the less emphasis on pure functions in CL. I think while solving some exercises I already did some things, so that I could solve without mutating global state. But it's been a while since I last continued working through the book, so I am not so sure. I get that sometimes a simple side-effect can be practical, but this is my free time occupation and I get joy from doing things in clean ways. Nevertheless, Common Lisp is one of the languages, which I wish I could actually work in (like on the job, not in my free time), when I compare it to things like Python, JavaScript and so on. At least it is in the family of languages I enjoy using.
- phyrex 4y agoLucky you, one of the chapters implements scheme. Seriously though, use CL, you’re not going to have a good time with scheme with this book. It’s making use of some CL specific behaviours
- zelphirkalt 4y agoThanks for the warning and look-ahead!
- MichaelBurge 4y agoDownload and run Portacle: https://portacle.github.io/ https://portacle.github.io/ It's a distribution of emacs together with a Lisp compiler, emacs add-ons like SLIME, etc.
- headcall 4y agovim + slimv check out susam's guide
- susam 4y agoHello! Thank you for mentioning my Vim + Slimv guide. I have, in fact, two guides to set up a Common Lisp programming environment from scratch: For Vim: https://susam.net/blog/lisp-in-vim.html https://susam.net/blog/lisp-in-vim.html For Emacs: https://github.com/susam/emacs4cl https://github.com/susam/emacs4cl
- sdkgames 4y agoMost popular Linux distributions include Common lisp packages. For example, "sbcl". if you have Debian/Ubuntu you should be able to install it like this: "sudo apt-get install sbcl"
- rbc 4y agoI would say Emacs with SBCL is a good start. I haven't started PAIP yet, I'm working through the Touretzky Lisp book, "Common Lisp: A Gentle Introduction to Symbolic Computation" as a warmup before starting PAIP. I've found that Inferior Lisp mode in Emacs is sufficient for working through those examples. It seems like a lot of working programmers are using SLIME with Emacs though.
- alaaalawi 4y agoMany people will fret when mentioning a commercial vendor. but IMHO and YMMV the leaset systems to get going with the least hassle would be either Lispworks or Allegro and both offer trial versions not getting in your way throughout the book (even though I'm Emacs SLIME user for long time). I'm interested in user minimzing unrelated side topics and spiral customization (I love them) and focusing on the book
- nanna 4y agoBear in mind that this book explicitly expects readers to already be familiar with lisp, so if you've not got a lisp environment going already and need an introduction, you should really look elsewhere first. Touretzsky's book is a great place to start. https://www.cs.cmu.edu/~dst/LispBook/ https://www.cs.cmu.edu/~dst/LispBook/
- dunefox 4y agoHow familiar is enough?
- Jach 4y agoEmacs is popular. I like vim, but people are also using VS Code. https://lispcookbook.github.io/cl-cookbook/editor-support.html https://lispcookbook.github.io/cl-cookbook/editor-support.ht... and other pages on the wiki may help you. https://github.com/CodyReichert/awesome-cl#community https://github.com/CodyReichert/awesome-cl#community has a list of community spots if you want to seek out other opinions. The SBCL implementation is very good, consider getting a binary directly from their site if your distro's version is out of date http://www.sbcl.org/ http://www.sbcl.org/ I disagree with a sibling comment that this book expects you to be comfortable with Lisp; the first chapter is literally an introduction, and the next two chapters cover most of the basics a working programmer should expect to cover quickly with chapter 3 being a handy reference to look back on for a lot of things. If you're new to programming or find the intro too fast, sure, look at other resources, but it's not too bad to just dive in. The main supplement is to figure out, with your editor of choice, how to send blocks of Lisp code to the Lisp prompt so that you can type and edit with an editor and not have to do everything directly on the prompt line.