標籤:lisp 程式設計語言
Get start with "Lisp"
在《駭客與漫畫》中,Paul graham提到什麼才是最好的程式設計語言,Lisp和C被明顯的提及,對可謂是Lisp是推崇備至。最近準備看SICP,於是學一下極具逼格的Lisp。
The basic, if primitive, way to get Lisp running is to install a command-line Lisp system. This works especially well if you have a UNIX system (OS X or Linux). Command-line Lisps include:
SBCL is a recent revision of CMUCL with new modifications and additions.I recommend SBCL as the best command-line Lisp. However, SBCL is very verbose and warning-filled though, which can get quite annoying. On the Mac, if you prefer a quieter, more forgiving, and decently fast Lisp, try CCL or MCL.
CLISP is a good Common Lisp, and is highly portable to nearly every environment out there. However, the reason it is portable is that it compiles to a bytecode interpreter rather than to machine code, and so it‘s pretty slow.
MCL is a freeware command-line-only version of Macintosh Common Lisp, which runs under MacOS X nicely. It is much faster than CLISP on the Mac, but its debugging facilities are primitive.
CCL, or Clozure CL, was a fork of MCL way back when but now is a high-performance Lisp implementation in its own right, and runs on a lot of different platforms. If you‘re getting annoyed at SBCL‘s verbosity, try CCL.
CMUCL is a first-rate Common Lisp, but it is not available on all platforms. CMUCL is the system from which SBCL sprang.
If you‘re interested in playing around with it, ABCL is a Common Lisp implementation which runs on the Java VM. Note that it‘s not particularly fast (yet).
這裡推薦使用SBCL。其它的嘛,自己看吧。。。我下了兩個,一個SBCL,一個CLISP。
linux下面,檢測好自己預先裝了SBCL,
[email protected]:~$ which sbcl/usr/bin/sbcl
如果沒有裝
sudo apt-get install sbcl
第一個Lisp程式,你一定猜得到
在當前檔案夾下編輯
vim ./hello.lisp
(princ "hello world!")
然後進入sbcl
[email protected]:~$ vim ./hello.lisp
[email protected]:~$ sbcl
This is SBCL 1.1.1.0.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (load "hello.lisp")
hello world!
T
一切從這裡開始,hello world。
一切在這裡結束,EOF