Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sectorlisp

> 编程语言
Open source

Bootstrapping LISP in a Boot Sector

1.5K stars0 likes0 views
WebsiteGitHub

About

Bootstrapping LISP in a Boot Sector

# sectorlisp sectorlisp is a 512-byte implementation of LISP that's able to bootstrap John McCarthy's meta-circular evaluator on bare metal. ## Overview LISP has been described as the [Maxwell's equations of software](https://michaelnielsen.org/ddi/lisp-as-the-maxwells-equations-of-software/). Yet there's been very little focus to date on reducing these equations to their simplest possible form. Even the [original LISP paper](https://people.cs.umass.edu/~emery/classes/cmpsci691st/readings/PL/LISP.pdf) from the 1960's defines LISP with nonessential elements, e.g. `LABEL`. This project aims to solve that by doing three things: 1. We provide a LISP implementation that's written in LISP, as a single pure expression, using only the essential functions of the language. See [lisp.lisp](lisp.lisp). It's the same meta-circular evaluator in John McCarthy's paper from the 1960's, except with its bugs fixed, dependencies included, and syntactic sugar removed. 2. We provide a readable portable C reference implementation to show how the meta-circular evaluator can be natively bootstrapped on POSIX conforming platforms, with a pleasant readline-like interface. See [lisp.c](lisp.c). 2. We provide a 512-byte i8086 implementation of LISP that boots from BIOS on personal computers. See [sectorlisp.S](sectorlisp.S). To the best of our knowledge, this is the tiniest true LISP implementation to date.

## Getting Started See [lisp.lisp](lisp.lisp) for code examples that you can copy and paste into your LISP REPL. You can run the C implementation as follows: ```sh $ make $ ./lisp ``` After running `make` you should see a `sectorlisp.bin` file, which is a master boot record you can put on a flopy disk and boot from BIOS. If you would prefer to run it in an emulator, we recommend using [Das Blinkenlights](https://justine.lol/blinkenlights/). ```sh curl --compressed https://justine.lol/blinkenlights/blinkenlights-latest.com >blinkenlights.com chmod +x blinkenlights.com ./blinkenlights.com -rt sectorlisp.bin ``` Alternatively you may use QEMU as follows: ```sh qemu-system-i386 -nographic -fda sectorlisp.bin ``` Further information may be found on [our wiki](https://github.com/jart/sectorlisp/wiki). ## Demo

The video above demonstrates how to boot sectorlisp in the blinkenlights emulator, to bootstrap the meta-circular evaluator, which evaluates a program for finding the first element in a tree. You can [watch the full demo on YouTube](https://youtu.be/hvTHZ6E0Abo).

GitHub Issues· 6 open

View all on GitHub
  • #36

    Not working with blinkenlights.

    Updated Aug 17, 2026
  • #38

    Code reduction suggestion

    Updated Jun 10, 2026
  • #39

    how to remove bestline

    Updated Apr 3, 2026
  • #37

    Confusing comment on a JS branch instruction

    Updated Feb 3, 2026
  • #32

    First two bytes need to be "33 C0" (alternative encoding of "mov eax, eax") for some brain-dead BIOSes

    Updated Sep 16, 2024
  • #2

    Fails to build with GNU as from binutils 2.35.1

    Updated Feb 28, 2021

Highlights

  • •C

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言