https://github.com/jart/sectorlisp Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} jart / sectorlisp Public * Notifications * Fork 44 * Star 843 Bootstrapping LISP in a Boot Sector License ISC license 843 stars 44 forks Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Wiki * Security * Insights jart/sectorlisp This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 5 branches 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/j] Use Git or checkout with SVN using the web URL. [gh repo clone jart/s] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @jart jart Add linker script ... a159070 Jan 4, 2023 Add linker script This makes correct compilation of sectorlisp.bin more of a sure thing. a159070 Git stats * 77 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time bin test .gitignore LICENSE Makefile README.md bestline.c bestline.h lisp.c lisp.lisp sectorlisp.S sectorlisp.lds View code sectorlisp Overview Getting Started Demo README.md sectorlisp sectorlisp is a 512-byte implementation of LISP that's able to bootstrap John McCarthy's meta-circular evaluator on bare metal. Yo dawg, I heard you like LISP so I put a LISP in your LISP so you can eval while you eval Overview LISP has been described as the Maxwell's 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 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. 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. 3. We provide a 512-byte i8086 implementation of LISP that boots from BIOS on personal computers. See sectorlisp.S. To the best of our knowledge, this is the tiniest true LISP implementation to date. Binary Footprint Comparison Getting Started See lisp.lisp for code examples that you can copy and paste into your LISP REPL. You can run the C implementation as follows: $ 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. 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: qemu-system-i386 -nographic -fda sectorlisp.bin Further information may be found on our wiki. Demo booting sectorlisp in emulator 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. About Bootstrapping LISP in a Boot Sector Resources Readme License ISC license Stars 843 stars Watchers 22 watching Forks 44 forks Releases No releases published Packages 0 No packages published Contributors 7 * @jart * @peterferrie * @woodrush * @agreppin * @swolchok * @moon-chilled * @ilyakurdyukov Languages * C 88.2% * Common Lisp 5.7% * Assembly 5.3% * Other 0.8% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.