Get start with "Lisp"

來源:互聯網
上載者:User

標籤: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

















聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.