Install lisp on my linux machine

前端 未结 4 2139
悲哀的现实
悲哀的现实 2021-02-19 11:44

I use Vim as my editor. \"Practical common Lisp\" suggest installing Lispbox, I don\'t know how to use emacs, don\'t know how to run lisp code with that T.T after that i find li

相关标签:
4条回答
  • 2021-02-19 12:07

    Lisp can be compiled but that is not "necessarily" so. Clisp is just one Lisp running on Linux. SBCL is another one. And SLIME is the interface from Emacs to one can say all Lisps on Linux.

    You can use Slime with SBCL, CLisp, Lispworks and Franz Common Lisp. You can even learn much of Lisp just by using Emacs. It has it's own Lisp-dialect Elisp, but you can use Common Lisp compatibility libraries also.

    Emacs probably is a preferred IDE for Common Lisp because of it's use of an internal Lisp.

    If you want one software to install you should check LispWorks or Allegro Common Lisp (formerly Franz Common Lisp).

    0 讨论(0)
  • 2021-02-19 12:11

    You can learn lisp using the idioms you're used to from other languages (editing, compiling, running). In the long run, lisp offers other choices, which you may come to prefer.

    So long as Vim will balance ()'s as you type, it has the only feature you really need in your editor.

    Eventually, you might well choose to look into SLIME (which needs emacs), but it's certainly not necessary to get started.

    You can choose any 'Common Lisp' implementation (of which clisp appears to be one you already have). Some will compile to a standalone binary (as you may be used to from C like toolchains), but most will depend on the runtime the lisp comes with, even when the .lisp file is compiled (similar to Java, Python, etc).

    You can lookup 'compile-file' in your lisp's documentation to see how to compile .lisp files. Common Lisp's include the compiler in the language runtime.

    0 讨论(0)
  • 2021-02-19 12:25

    Install and learn the following things:

    • SBCL the compiler

    install a binary from http://www.sbcl.org/platform-table.html Once your used to it, compile from source and keep the source around. This way you can easily jump to the definitions of functions of SBCL with M-. in Emacs.

    • Emacs

    watch this screencast to see someone implementing a raytracer Raytracer in Common Lisp

    • quicklisp.lisp http://www.quicklisp.org/beta/

    This is the new package management. When I started it wasn't there. Now we have it and you should use it. It makes things a lot easier. Run 'sbcl --load quicklisp.lisp' and then enter (quicklisp-quickstart:install) press enter and then run (ql:add-to-init-file)

    • SLIME runs within Emacs.

      Try installing it with quicklisp. Read its manual and figure out what to write into your .emacs file so that it automatically starts when you open a lisp file. Optionally watch a screencast.

    • Paredit

    Seriously, you have to learn that (even if the guy in the raytracing screencast didn't use it). You should start with ( , this will make two parenthesis. With M-( you can enclose an existing s-expression. C-k cuts the s-expression behind the cursor and with C-y you can insert it anywhere.

    • ASDF

    This is the make for lisp. You should learn how to define a system in an ASDF file.

    • Reference

    I printed this booklet, Common Lisp Quick Reference. It's very concise.

    0 讨论(0)
  • 2021-02-19 12:27

    Can anybody tell me what exactly need to install lisp on my linux?

    The other answers have described what SLIME, sbcl etc. are. But I wanted to give a concise answer.

    To install clisp on Ubuntu, just run sudo apt-get install clisp. Nothing else is necessary to run Lisp. For other distros find clisp on their relevant package managers. However do not be surprised not to find clisp on some distros, for example the Amazon Linux AMI appears not to have clisp. clisp ~/test.lisp is all you need to run Lisp.

    Nowadays it is more popular to use SLIME and ASDF. As a beginner you will not need to use them yet. SLIME is a fancy editor for Lisp, and ASDF is a package manager. It is much easier to setup Clisp given that it literally takes just one line to install and one line to run. SLIME and ASDF are more involved and take more time to learn and setup. I personally would recommend starting off with using Clisp and only later on using SLIME and ASDF so that you will gain a better understanding of Lisp which will make using SLIME and ASDF much easier. When you are ready, then I recommend reading the documentation of SLIME and ASDF.

    0 讨论(0)
提交回复
热议问题