Lisp-like Languages
Questions on the assignment: Binary Decision Diagrams
Using Emacs
- Following on from last Monday's class
- Take notes with pen and paper (especially of key sequences)
- Setting your personal details and configuration in
personal.el - Working with git branches
- Giving Emacs commands with
M-x - Buffers
- Opening, editing and saving files
- Directory listings
- Editing and running Python code
- Magit
Lisp-like Languages
We will study three programming languages from the Lisp family
Why Lisp?
Once you learn Lisp you will see what is missing in most other languages.
– Richard Stallman
Within a couple weeks of learning Lisp I found programming in any other language unbearably constraining.
– Paul Graham
Lisp is a language for doing what you've been told is impossible.
– Kent Pitman
Lisp isn't a language, it's a building material.
– Alan Kay
Lisp is a programmable programming language.
– John Foderaro, CACM, September 1991
The best description of the Lisp programming language is that it is a high level machine language. That is, it shares many of the facets of contemporary machine language –the necessity for attention to detail and the freedom to manipulate the machine's data and programs without restriction– yet Lisp is high level in that the language contains the expressive power and convenience of traditional high level languages.
– John Allen
LISP has jokingly been described as "the most intelligent way to misuse a computer". I think that description a great compliment because it transmits the full flavour of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.
– Edsger W. Dijkstra in his 1972 Turing Award lecture
Syntactic choices
- Prefix, Postfix and Infix
- Separators and delimiters
- Greatest Common Divisor in several languages
- Block structure
- Layout flexibility
- Uniform prefix notation
Racket
Racket is a general-purpose, multi-paradigm programming language based on the Scheme dialect of Lisp. It is designed as a platform for programming language design and implementation.
You can download the DrRacket programming environment on your laptop.
(define (factorial n) (if (zero? n) 1 (* n (factorial (- n 1)))))
sbcl
Steel Bank Common Lisp (SBCL) is a high performance Common Lisp compiler. There are instructions for downloading it and installing it on your laptop.
sbcl from the command line
You can run it from the command line.
bon@amp:~$ sbcl This is SBCL 2.1.1.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. *
The asterisk is the Lisp prompt.
You can exit sbcl by Control d.
Because it is sometimes convenient to be able to edit what you enter into
sbcl, you can wrap the sbcl command in Readline. Put the following lines in
your .bashrc or similar.
sbcl () { /bin/rlwrap sh -c "/usr/local/bin/sbcl --noinform $*" }
Now sbcl will start silently and you can use Emacs editing commands on what
you enter.
sbcl in Emacs
In Emacs we use SLIME to interact with Lisp. Your Emacs config file contains
the necessary configuration so you should be able to do M-x slime to get a
buffer with an sbcl prompt.
Quicklisp
Quicklisp is a library manager for Common Lisp. It plays a similar role in the Lisp ecosystem as pip does in the Python ecosystem. Using Quicklisp we can download, install and manage Lisp packages.
Once you have sbcl installed you can install Quicklisp as follows
From the terminal, download the installer
curl -O https://beta.quicklisp.org/quicklisp.lisp
Run the installer using sbcl
sbcl --load quicklisp.lisp
You should see something like
$ sbcl --load quicklisp.lisp This is SBCL 1.0.42.52, 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. ==== quicklisp quickstart loaded ==== To continue, evaluate: (quicklisp-quickstart:install) *At the sbcl prompt type or copy/paste. Note that the parentheses are important.
(quicklisp-quickstart:install)
Press the return key and see the installer download Quicklisp. The installation ends with
==== quicklisp installed ==== To load a system, use: (ql:quickload "system-name") To find systems, use: (ql:system-apropos "term") To load Quicklisp every time you start Lisp, use: (ql:add-to-init-file) For more information, see http://www.quicklisp.org/beta/ NIL *
Ask Quicklisp to install itself every time you start up sbcl. It will ask you to press enter to confirm.
(ql:add-to-init-file)
- Type
Control Dto leave sbcl. Check that Quicklisp is working by using it to installt the
alexandriapackage of useful Lisp utilities. You should see something like this.$ sbcl This is SBCL 2.1.1.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. * (ql:quickload :alexandria) To load "alexandria": Load 1 ASDF system: asdf Install 1 Quicklisp release: alexandria ; Fetching #<URL "http://beta.quicklisp.org/archive/alexandria/2021-12-09/alexandria-20211209-git.tgz"> ; 54.51KB ================================================== 55,819 bytes in 0.00 seconds (0.00KB/sec) ; Loading "alexandria" [package alexandria].............................. [package alexandria-2]. (:ALEXANDRIA) *
.sbclrc
When you start sbcl it will run the Lisp code in the file ~/.sbclrc If you
open this file in Emacs you should now see the following Quicklisp
configuration.
;;; The following lines added by ql:add-to-init-file: #-quicklisp (let ((quicklisp-init (merge-pathnames #p"/home/bon/code/lisp/quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init)))
An example Lisp function definition
(defun factorial (n) (if (zerop n) 1 (* n (factorial (- n 1)))))
etc
Basejump
- What Basejump is Basejump (Lost Astronaut) is a founder-first AI venture-building program. We identify high-potential early-stage builders (often before they have a concrete idea), provide them with vetted business ideas, structured execution support, and continue with the strongest teams into longer-term building and potential investment. We currently run programs in Vilnius, Belgrade, and Cluj-Napoca, and are expanding further across Amsterdam, Barcelona and Hong Kong.
- Amsterdam Program (April 1 - end of June | 3 months) Format: in-person
hacker house / office base Focus: AI-first products Cohort size: ~5–8
selected participants We are targeting:
- University students / early-career builders
- Strong technical profiles (AI/ML, software, data, automation)
- People with skill sets but not necessarily a fully formed startup idea
- What participants get
- Access to a workspace (hacker house / office) and a peer environment
- A set of business ideas they can choose from (instead of “come with your own idea”)
- Weekly execution rhythm + accountability (light structure, build-focused)
- Access to mentors (we’re building a pool; typically paid sessions)
- Opportunity to continue beyond the 3 months if there’s strong momentum
- Top performers may be considered for follow-up support / investment discussions (case-by-case) • Scholarship €3,000
- Operational budget to cover startup expenses €5,000
- What We’re Looking For in Amsterdam Our main needs:
- Talent reach (university / AI communities)
- Ecosystem credibility & co-branding
- Introductions to relevant mentors
- Optional: joint events / hackathon-style recruitment moments We’re open to co-hosting, co-branding, and aligning with existing ecosystem structures - especially if we can complement (not duplicate) existing programs like the Nursery.