# Lisp

- Page: https://shared.btbytes.com/p/lisp
- Date: 2020-02-11
- Tags: lisp, programming-language

## What makes lisp special?

- [Rondam Ramblings: Yes, code is data, but that's not what makes Lisp cool](http://blog.rongarret.info/2018/02/yes-code-is-data-but-thats-not-what.html) [2018]
- [What Made Lisp Different](http://www.paulgraham.com/diff.html); Paul Graham [2002].
- [How Lisp Became God's Own Programming Language](https://twobithistory.org/2018/10/14/lisp.html); Oct 2018 by [Sinclair Target at Two-Bit History](https://twobithistory.org/about.html).


## Starting to code in Common Lisp

* [Articulate Common Lisp](http://web.archive.org/web/20130516190151/http://articulate-lisp.com/) -- How to write Common Lisp in 2018 - an initiation manual for the uninitiated.

* [A Road to Common Lisp / Steve Losh](http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/); Aug 2018
* [Starting a minimal Common Lisp project | notes.eatonphil.com](http://notes.eatonphil.com/starting-a-minimal-common-lisp-project.html); Mar 2018.
* [Getting started with Common Lisp | Dark Chestnut](https://www.darkchestnut.com/2017/getting-started-with-common-lisp/); Aug 2017.
* [How I got started with Common Lisp in 2017](https://anticrisis.github.io/2017/09/04/how-i-got-started-with-common-lisp-2017.html); Sep 2017 --  this one uses roswell, compares different editors (atom, emacs-bare/prelude and portacle), explains a bit how asdf and directory structure works etc., *useful*.
* [Home – the Common Lisp Cookbook](http://lispcookbook.github.io/cl-cookbook/)
* [Features of Common Lisp](http://random-state.net/features-of-common-lisp.html)

* [qvm/Lisp Setup Instructions](https://github.com/rigetti/qvm/blob/master/doc/lisp-setup.md)
* [qvm/A Primer on Editing & Running Lisp](https://github.com/rigetti/qvm/blob/master/doc/editing-and-running.md)


### CL-References

- [CLHS: Permuted Symbol Index (I)](http://www.lispworks.com/documentation/HyperSpec/Front/X_Perm_I.htm)
- [Lisp Machine Manual](http://web.archive.org/web/20100807113732/http://www.textfiles.com/bitsavers/pdf/mit/cadr/chinual_6thEd_Jan84/)  1984 by Moon, Stallman and Weinreb.
- [Simplified Common Lisp reference](http://jtra.cz/stuff/lisp/sclr/index.html) -- appears to be not complete, but interesting presentation.


## Other Lisps

* [fogus: The German School of Lisp](http://blog.fogus.me/2011/05/03/the-german-school-of-lisp-2/)
* Lumen -- [Right! I've been waiting a couple years for Lumen to get some traction. | Hacker News](https://news.ycombinator.com/item?id=17963471) -- wherein user `shawn` shows off the cool things you can do with [Lumen Lisp](https://github.com/sctb/lumen). Reference to Ken Thompson's "Trusting Trust" paper.
* [Lush: Lisp Universal SHell](http://lush.sourceforge.net/)
* [uLisp](http://www.ulisp.com/show?3J) is a Lisp for microcontrollers (Arduino ATmega, Adafruit, BBC MicroBit, STM32, ESP8266 and MSP430 based Launchpad boards).
* [GameLisp](https://gamelisp.rs/) -- a scripting language (lisp) for Rust game development.
* [The Many Faces of an Undying Programming Language — Jakob's Personal Webpage](http://jakob.space/blog/thoughts-on-lisps.html); Jul 2020.
* [Lush: my favorite small programming language | Locklin on science](https://scottlocklin.wordpress.com/2024/11/19/lush-my-favorite-small-programming-language/)


### T

- [The T Project](http://mumble.net/~jar/tproject/index.html) "T was one of the best Lisp implementations, and set a standard for clean    design that few newer dialects have been able to meet." -- Olin    Shivers [History of T](http://www.paulgraham.com/thist.html).
- [Orbit paper (pdf)](http://web.archive.org/web/20040809044152/http://repository.readscheme.org/ftp/papers/orbit-thesis.pdf)    by [Jonathan Rees](http://mumble.net/~jar/)

### Urn

Urn is a Lisp that compiles to Lua. Its [tutorial](https://urn-lang.com/) is one of the friendliest to learn Lisp itslef.

### Picolisp

- [some fun picolisp code](http://web.archive.org/web/20160530022303/https://bitbucket.org/mihailp/tankfeeder/src)

### uLisp

- [uLisp](http://www.ulisp.com/) -- Lisp for Arduino, Adafruit M4, Micro Bit, ESP8266/ESP32, and MSP430 boards.

## Notes

To add readline support to the SBCL REPL, use
[rlwrap](http://www.debian-administration.org/article/634/Providing_better_editing_support_for_sbcl_via_readline)

Use `quicklisp` to discover, install and manager Lisp libraries

Starting SBCL with QuickLisp pre-loaded.

    $ rlwrap sbcl --load ~/quicklisp/setup.lisp

## Quotes


> In C, you are writing assembly constructs disguised as a high level
> language. In lisp, you are writing compiler constructs (abstract
> syntax trees) disguised as a high level language. Assembly language
> targets hardware-oriented geeks. Lisp targets compiler-oriented geeks.
> Since the two don't (generally) understand the other's viewpoint, each
> hates the other's favorite language.

-- [gvb](http://www.blogger.com/profile/02289128357770166585) at [i hate lisp](http://funcall.blogspot.com/2009/03/i-hate-lisp.html).


## Implement your own Lisp

- [Build your own Lisp](http://www.buildyourownlisp.com/)
- [mal: make a lisp](https://github.com/kanaka/mal) in multiple languages.
- [Lisp in a few lines of Haskell](https://crypto.stanford.edu/~blynn/lambda/lisp.html) by [Ben Lynn](https://crypto.stanford.edu/~blynn/) at CS.Stanford.
- [krig/LISP: My attempt at implementing the original LISP paper while learning lisp. Nothing special, mostly posted as a homage to McCarthy.](https://github.com/krig/LISP)

## Links

* [Daniel Kvasnička - Using Advent of Code 2019 to rediscover Common Lisp](https://danielkvasnicka.tumblr.com/post/190617984237/using-advent-of-code-2019-to-rediscover-common)
- [These years in Common Lisp: 2018 – Vince Zd – Medium](https://medium.com/@vindarel/these-years-in-common-lisp-2018-1d6b9084920d)
- [Lisp and DSLs](http://lists.common-lisp.net/pipermail/pro/2011-July/000621.html)
- [Classic Lisp books](http://www.quora.com/Lisp-programming-language/What-are-some-classic-Lisp-books/answer/Paul-McJones?srid=dSb)
- [Writing a Common Lisp Web App in caveman2](http://ahungry.com/blog/2015-07-07-Writing-a-Common-Lisp-Web-App.html). Blog written in CL [Source](https://github.com/ahungry/ahungry-blog)
- [LispOS: Specification of a Lisp Operating System” (Robert Strandh, 2013)](https://metamodular.com/lispos.pdf) (PDF).
-  [Discussion on Lisp](https://news.ycombinator.com/item?id=11823902)
- [Adam Tornhill's Programming Pages](http://www.adamtornhill.com/index.htm)
- [uLisp - Lisp for the arduino](http://www.ulisp.com/)
- [L-99: Ninety-Nine Lisp Problems](http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html)
- [Pascal Costanza's Highly Opinionated Guide to Lisp](http://www.p-cos.net/lisp/guide.html)

## Blogs

- [Borretti -- Articles](https://borretti.me/article/). See [State of the Common Lisp Ecosystem, 2015](https://borretti.me/article/common-lisp-sotu-2015)
- [stablecross.com lisp articles](https://stablecross.com/files/category-lisp.html). See [The Myth of the Super Programming Language?](https://stablecross.com/files/Super_Programming_Languages.html)

- [Paul Khuong: some Lisp](https://www.pvk.ca/Blog/archives/). See [Starting to Hack on SBCL](https://www.pvk.ca/Blog/2013/04/13/starting-to-hack-on-sbcl/)
- [malisper.me](https://malisper.me/). See [Loops in Lisp Part 4: Series – malisper.me](https://malisper.me/loops-in-lisp-part-4-series/)
- [Clint Moore](http://ivy.io/)
- [Lisp journey](https://lisp-journey.gitlab.io/). See [Introducing Replic: an executable and a library to build a readline app in no time - Lisp journey](https://lisp-journey.gitlab.io/blog/introducing-replic-a-readline-app-in-no-time/) / [State of Common Lisp Web Development - an overview - Lisp journey](https://lisp-journey.gitlab.io/web-dev/)
* [Uniform Structured Syntax, Metaprogramming and Run-time Compilation](https://m00natic.github.io/lisp/manual-jit.html)


## Videos

- [Baggers' Little bits of Lisp](https://www.youtube.com/watch?v=m0TsdytmGhc&list=PL2VAYZE_4wRJi_vgpjsH75kMhN4KsuzR_) (shorter videos, few minutes each).
- [Baggers' Lots of bits of Lisp](https://www.youtube.com/user/CBaggers/search?query=lots+of+bits+of+lisp) (longer videos 1-2 hour).

## Algorithms

- [Lisp, the Universe and Everything: "Programming Algorithms" Book](https://lisp-univ-etc.blogspot.com/2019/07/programming-algorithms-book.html) [WIP book]; Jul 2019.


## Lisp Machines

- [dump.mntmn.com/interim-paper/](http://web.archive.org/web/20150916002343/http://dump.mntmn.com/interim-paper/)


## Books

- [norvig/paip-lisp: Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"](https://github.com/norvig/paip-lisp) (Also contains PDF of the book).
- [Land of Lisp: Learn to Program in Lisp, One Game at a Time!](http://landoflisp.com/)
- [Practical Common Lisp (free book)](http://www.gigamonkeys.com/book/)
- [On Lisp by Paul Graham (free book)](http://www.paulgraham.com/onlisp.html)
- [Lisp Outside the Box](http://web.archive.org/web/20160913222035/http://www.nicklevine.org/lisp-book/); partially completed; [original plan](http://web.archive.org/web/20160913222035/http://www.nicklevine.org/lisp-book/talks/eclm-2011-10-23/plan.txt)
- [Full stack Lisp](https://leanpub.com/fullstacklisp/read); develop web applications (hence the "fullstack") using Common Lisp. [Work in progress]
* [マンガで分かるLisp(Manga Guide to Lisp)](http://web.archive.org/web/20091018080850/http://lambda.bugyo.tk/cdr/mwl) in Japanese-u.


## IDEs

The de-facto IDE for most lisps in Emacs. Howver [Portacle - A Portable Common Lisp Development Environment](https://portacle.github.io/) is a good, ready-to-go, purpose-built distribution of Eamcs for use on Windows, Mac and Linux.

- [Lem: A Common Lisp editor/IDE with high expansibility | Hacker News](https://news.ycombinator.com/item?id=19407548)

## Talks

- [This Old Lisp](http://thisoldlisp.com/talks/els-2018/)


## People

- [dlweinreb's comments | Hacker News](https://news.ycombinator.com/threads?id=dlweinreb) ; [Daniel Weinreb](https://en.wikipedia.org/wiki/Daniel_Weinreb) passed away in 2012.
- [Fernando Borretti](https://borretti.me/)
- [40ants](http://40ants.com/) -- "are a group of Lisp hackers. Our goal is to extend Common Lisp's ecosystem and to solve realworld problems using the most powerful programming language."


## Implementations

- SBCL
- ABCL
- CCL
- Corman Lisp (windows only)
- Allego CL
- Lispworks
- [jscl: A Lisp-to-Javascript compiler bootstrapped from Common Lisp](https://github.com/jscl-project/jscl)


## Distributions

- quicklisp
- [ultralisp.org/](https://ultralisp.org/) -- bleeding edge quicklisp


## Interesting programs / libraries

- <https://github.com/Shinmera/beamer> slide show program based on [trial](https://github.com/shirakumo/trial) game engine. [Example slide](https://github.com/Shinmera/talks/blob/master/els2018-glsl-oop/presentation/els.lisp) from ELS 2018.


## Tips

[lisp tip](https://x.com/vindarel/status/1648630666202841088): run visual programs with `(uiop:run-program '("sudo" "htop") :output :interactive :input :interactive)` works for` sudo, vim, htop, ncdu`… see also `(cmd:cmd "sudo htop" :<> :interactive)`

## Discussions/ Comparisons

- [Outperforming everything with anything. Python? Sure, why not? : programming](https://old.reddit.com/r/programming/comments/akbka5/outperforming_everything_with_anything_python/) ... has some discussions on Common Lisp and CLASP.

- [Dynamic language compilation discussion](https://news.ycombinator.com/item?id=19653902), many interesting points about Common Lisp and AOT; Apr 2019.

- [Why lisp over Julia](https://news.ycombinator.com/item?id=20733714) (HN).

Understanding the words "package", "system", "project" .. which have different meanings than commonly understood ones.. As explained by `sjl` on [lobste.rs](https://lobste.rs/s/fwhuz5/my_lisp_journey_1_getting_started_with#c_ebhvzq):



> Common Lisp’s terminology is confusing because it’s old and uses a lot of words that we use now (like “package”) to mean different things than people mean today. Things get easier once you internalize what Common Lisp means by the terms.
>
> A **package** in Common Lisp is a container for symbols. They’re a way to group related names (symbols) together so you don’t have to do the miserable prefixing of every name with `mylibrary-...` like you do in Emacs Lisp or C to avoid name clashes.
>
> Unlike other languages like Python/Clojure/etc, packages and files on the hard disk are not tied strongly together in Common Lisp. You can have several files that all work with the same package, a single file that switches back and forth between packages, or even write code that creates/mutates packages at runtime. Files and packages are orthogonal in Common Lisp, which gives you maximum flexibility to work however you want.
>
> A **system** in Common Lisp is a collection of code (mostly) and a description of how to load that code (and some metadata like author, license, version, etc). For example: [my directed graph library `cl-digraph`](https://github.com/sjl/cl-digraph) contains a system called `cl-digraph`. That system has a description of how to load the code, and that description lives in the `cl-digraph.asd` file. It creates a Common Lisp package (called `digraph`).
>
> The Common Lisp language itself has no knowledge of systems. ASDF is a Common Lisp library bundled with most (all?) modern implementations that handles defining/loading systems. (The name stands for Another System Definition Facility, so as you might guess there have been several other such libraries. ASDF is the one everyone uses today.)
>
> Systems and packages are orthogonal in Common Lisp. Some systems (like small libraries) will define exactly one package. Some systems will define multiple packages. Rarely a system might not define _any_ new packages, but will use or add to an existing one.
>
> A **project** in Common Lisp is not an official term defined anywhere that I know of, but is generally used to mean something like a library, a framework, an application, etc. It will usually define at least one system, because systems are where you define how to load the code, and if it didn’t define a system how would you know how to load the code? My `cl-digraph` library mentioned above is a project that defines _three_ systems:
>
> -   `cl-digraph` which contains the actual data structure and interface.
> -   `cl-digraph.test` which contains the unit tests. This is a separate system because it lets users load the main code without also having to load the unit test framework if they’re not going to be running the tests.
> -   `cl-digraph.dot` which contains code for drawing the directed graphs with Graphviz. This is a separate system because it lets users load the main code without also having to load the `cl-dot` system (the graphviz bindings) if they don’t care about drawing.
>
> If I were writing this today I’d use ASDF’s `foo/bar` system naming notation instead of separating the names with a dot, because there’s some nice extra support for that. I just didn’t know about it at the time, and don’t want to break backwards compatibility now.
>
> We saw how Common Lisp has no concept of a system — that comes from ASDF. Similarly, ASDF has no concept of the internet, or reaching out to somewhere to download things. It assumes you have somehow acquired the systems you want to load, maybe by sending a check to an address and receiving a copy of the code on floppy disk, as many of my old Lisp books offer in the back pages.
>
> Quicklisp is another library that works on top of ASDF to provide the “download projects from the internet automatically if necessary” functionality that people want in our modern world. So when you say `(ql:quickload :cl-digraph)` you’re asking Quicklisp to download `cl-digraph` (and any dependencies) if necessary, and then hand it off to ASDF to actually load the code of the `cl-digraph` system. Unlike ASDF, Quicklisp is relatively new in the Common Lisp world (it’s only about eight years old) bundled with any modern Lisp implementations (that I know of) (yet?), which is why you need to install it separately.
>
> So to summarize:
>
> -   **Files** are files on your hard drive.
> -   **Packages** are containers of symbols. They are orthogonal to files.
> -   **Systems** are collections of code, plus instructions on how to load this code. They are orthogonal to packages.
> -   **Projects** are high-level collections of… “stuff” (code, documentation, maybe some image assets, etc). They are (mostly) orthogonal to systems (seeing a trend here?).
> -   Common Lisp knows about files and packages. ASDF adds systems. Quicklisp adds the internet.
>
> This is a pretty high-level view that glosses over a lot, but maybe it’ll clear things up and help you dive into the details later.

----

* [Between two Lisps](https://ane.github.io/2020/10/05/between-two-lisps.html)
