{"id":13398792,"url":"https://github.com/marcpaq/b1fipl","last_synced_at":"2026-01-28T10:31:59.244Z","repository":{"id":30441861,"uuid":"108603904","full_name":"marcpaq/b1fipl","owner":"marcpaq","description":"A Bestiary of Single-File Implementations of Programming Languages","archived":false,"fork":false,"pushed_at":"2025-04-23T13:41:31.000Z","size":127,"stargazers_count":1005,"open_issues_count":0,"forks_count":40,"subscribers_count":35,"default_branch":"main","last_synced_at":"2025-04-23T14:36:24.078Z","etag":null,"topics":["basic","brainfuck","forth","lisp","pascal","programming-language"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcpaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-27T23:13:51.000Z","updated_at":"2025-04-23T13:41:35.000Z","dependencies_parsed_at":"2024-04-01T17:44:13.672Z","dependency_job_id":null,"html_url":"https://github.com/marcpaq/b1fipl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcpaq/b1fipl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcpaq%2Fb1fipl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcpaq%2Fb1fipl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcpaq%2Fb1fipl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcpaq%2Fb1fipl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcpaq","download_url":"https://codeload.github.com/marcpaq/b1fipl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcpaq%2Fb1fipl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","brainfuck","forth","lisp","pascal","programming-language"],"created_at":"2024-07-30T19:00:31.706Z","updated_at":"2026-01-28T10:31:59.239Z","avatar_url":"https://github.com/marcpaq.png","language":null,"funding_links":[],"categories":["Uncategorized","Technical","Others"],"sub_categories":["Uncategorized"],"readme":"# A Bestiary of Single-File Implementations of Programming Languages\n\n![From a French Prayer-book of the Thirteenth Century, in the British Museum.](https://raw.githubusercontent.com/marcpaq/b1fipl/master/FunnyAnimals.jpg)\n\n\n## Programming languages are amazing\n\nProgramming languages are amazing pieces of work. They turn our words, numbers, and symbols into the bits that make a machine do things.\n\nIt's easy to get overwhelmed when implementing a programming language. The GNU Compiler Collection is [millions of lines long](https://www.phoronix.com/scan.php?page=news_item\u0026px=MTE1OTg).\n\nThat's too complicated to learn how to implement a programming language. Luckily, some smart people have distilled the most interesting parts of programming languages into an approachable essence. I'm referring to implementations of programming languages that fit in a single source code file.\n\nThese single-file implementations are rarely complete, hardly sophisticated or efficient. But they are self-contained, concise, and clear. They make it fun to discover why programming languages are amazing.\n\n## Concatenative\n\n[bbf, v3](https://github.com/blippy/cerbo/blob/master/forth/v3/forth.c) implemented by Mark Carter. A Forth in C.\n\n[dc](https://github.com/dspinellis/unix-history-repo/blob/Research-V7-Snapshot-Development/usr/src/cmd/dc/dc.c) implemented by Lorinda Cherry.\n\n[Forth1](https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d5c6a) implemented by Tycho Luyben.\n\n[jonesForth](https://github.com/nornagon/jonesforth/blob/master/jonesforth.S) implemented by Richard W.M. Jones.\n\n[Mouse](http://users.encs.concordia.ca/~grogono/Mouse/mouse.html) implemented by Peter Grogono.\n\n[Uxntal](https://wiki.xxiivv.com/etc/drifblim.tal.txt) implemented by Devine Lu Linvega. Uxntal in Uxntal.\n\n## Functional\n\n[7 lines of code, 3 minutes](http://matt.might.net/articles/implementing-a-programming-language/) implemented by Matt Might.\n\n[arpilisp](https://github.com/marcpaq/arpilisp) implemented by Marc Paquette.\n\n[How to implement a programming language in JavaScript](http://lisperator.net/pltut/) implemented by Mihai Bazon.\n\n[(How to Write a (Lisp) Interpreter (in Python))](http://www.norvig.com/lispy.html) implemented by Peter Norvig.\n\n[komplott](https://github.com/krig/LISP) implemented by Kristoffer Grönlund.\n\n[Lisp500](https://web.archive.org/web/20040305005602/http://modeemi.cs.tut.fi/~chery/lisp500/) implemented by Teemu Kalvas. \n\n[Lisp9](https://www.t3x.org/lisp9/index.html) implemented by Nils M. Holm. A byte-compiling Lisp interpreter.\n\n[Lisp90](http://howtowriteaprogram.blogspot.com/2010/11/lisp-interpreter-in-90-lines-of-c.html) implemented by Anthony C. Hay.\n\n[Lisp In Less Than 200 Lines Of C](https://carld.github.io/2017/06/20/lisp-in-less-than-200-lines-of-c.html) implemented by Carl Douglas.\n\n[MiniLisp](https://github.com/rui314/minilisp) implemented by Rui Ueyama.\n\n[Mini-Scheme](https://github.com/catseye/minischeme) updated by Chris Pressey, originally implemented by Atsushi Moriwaki.\n\n[mLite](https://www.t3x.org/mlite/index.html) implemented by Nils M. Holm. A lightweight variant of ML.\n\n[Most functional](http://www.ioccc.org/2012/tromp/hint.html) implemented by John Tromp. An implementation of binary lambda calculus in 25 lines of obfuscated C.\n\n[sectorlisp](https://github.com/jart/sectorlisp/blob/main/sectorlisp.S) implemented by Justine Alexandra Roberts Tunney et al. An x86 Lisp interpreter that fits in a boot sector.\n\n[sedlisp](https://github.com/shinh/sedlisp) implemented by Shinichiro Hamaji.\n\n[single_cream](https://github.com/rain-1/single_cream), scheme interpreter implemented by Raymond Nicholson.\n\n[ulc](https://github.com/masaeedu/ulc) implemented by Asad Saeeduddin. A minimalistic implementation of the untyped lambda calculus in JS\n\n## Imperative\n\n[asm6502.py](http://www.dabeaz.com/superboard/asm6502.py) implemented by David Beazley.\n\n[wak](https://github.com/raygard/wak/tree/main/monosrc) is the single-file version of a \"fairly compact implementation of the [AWK](https://en.wikipedia.org/wiki/AWK) programming language\", implemented by Ray Gardner.\n\n[bc](https://github.com/depsterr/bc) implemented by depsterr. Compiles brainfuck into an x86_64 linux binary.\n\n[Brainfuck](http://www.muppetlabs.com/~breadbox/software/tiny/bf.asm.txt) implemented by Brian Raiter.\n\n[c4](https://github.com/rswier/c4) C in 4 functions, implemented by Robert Swierczek.\n\n[Jasic](https://github.com/munificent/jasic) implemented by Robert Nystrom. Old-school BASIC in Java.\n\nmescc-tools-seed, implemented by Jeremiah Orians. A complete chain of\none-file languages, from compiler to assemblers and even a shell, for Intel x86: \n[C compiler in assembly](https://github.com/oriansj/mescc-tools-seed/blob/master/x86/cc_x86.M1),\n[macro assembler to build the C compiler](https://github.com/oriansj/mescc-tools-seed/blob/master/x86/M0_x86.hex2),\n[hex2 assembler to build the macro assembler](https://github.com/oriansj/mescc-tools-seed/blob/master/x86/hex2_x86.hex1),\n[hex1 assembler to build the hex2 assembler](https://github.com/oriansj/mescc-tools-seed/blob/master/x86/hex1_x86.hex0),\n[hex0 assembler to bootstrap the whole thing](https://github.com/oriansj/mescc-tools-seed/blob/master/x86/hex0_x86.hex0), and finally, a\n[shell to script the previous stages](https://github.com/oriansj/bootstrap-seeds/blob/master/kaem-optional-seed.hex0).\n\n[Mini-C](https://github.com/Fedjmike/mini-c) implemented by Sam Nipps. A small subset of C, of course. But not as small as you would guess.\n\n[Pascal-S](http://standardpascal.org/pascals.html) implemented by Niklaus Wirth \u0026 Scott A. Moore.\n\n[picol](http://oldblog.antirez.com/page/picol.html) is a Tcl interpreter implemented in C. Implemented by Salvatore Sanfilippo, aka antirez.\n\n[Selfie](https://github.com/cksystemsteaching/selfie) includes a 1-file C compiler in C. Implemented by the Computational Systems Group at the Department of Computer Sciences of the University of Salzburg.\n\n[swizzle](https://github.com/rswier/swizzle) implemented by Robert Swierczek.\n\n[The Super Tiny Compiler!](https://github.com/thejameskyle/the-super-tiny-compiler) implemented by James Kyle.\n\n[Tiny Basic](http://ittybittycomputers.com/IttyBitty/TinyBasic/index.htm) implemented by Tom Pittman.\n\n[Trac](http://code.activestate.com/recipes/577366-trac-interpreter-sixties-programming-language/) implemented by Jack Trainor.\n\n[Tutorial - Write a Shell in C](https://brennan.io/2015/01/16/write-a-shell-in-c/) implemented by Stephen Brennan.\n\n[VTL02 for 6502](https://github.com/Klaus2m5/VTL02) ported and improved by Mike Barry. VTL-02 was originally designed and implemented by [Gary Shannon \u0026 Frank McCoy](http://www.altair680kit.com/manuals/Altair_680-VTL-2%20Manual-05-Beta_1-Searchable.pdf).\n\n## Logical\n\n[microKanren](https://github.com/jasonhemann/microKanren-DLS-16/blob/master/mk.rkt) is a Kanren interpreter, implemented by Jason Hemann.\n\n[prolog.c](http://www.cl.cam.ac.uk/~am21/research/funnel/prolog.c) is a simple Prolog interpreter written in C++, implemented by Alan Mycroft.\n\n[Prolog](http://t3x.org/lisp64k/prolog.html) originally implemented by Ken Kahn, adapted by Nils M. Holm.\n\n[Tiny Prolog in OCaml](https://github.com/Naereen/Tiny-Prolog-in-OCaml-OneFile) is an interpreter for a subset of Prolog, in OCaml, implemented by [Lilian Besson (@Naereen)](https://github.com/Naereen/)\n\n## Honourable Mentions\n\n[256LOL](http://blog.jeff.over.bz/assembly/compilers/jit/2017/01/15/x86-assembler.html) implemented by Jeff Overbey. An x86 assembler in 256 lines or less. Technically not a single file but Jeff gives good descriptions of the problems with elegant, simple solutions.\n\n[An Implementation of J](http://www.jsoftware.com/books/pdf/aioj.pdf) implemented by Arthur Whitney. See the appendix \"Incunabulum\". It's only a fragment of the J interpreter, but its conciseness is impressive.\n\n[A Regular Expression Matcher](http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html) implemented by Rob Pike, exegesis by Brian Kernighan.\n\n[JS-Interpreter](https://github.com/NeilFraser/JS-Interpreter/blob/master/interpreter.js) implemented by Neil Fraser. A JavaScript interpreter in JavaScript. This file is part of a larger project for running JavaScript in a sandbox. \n\n[Microlisp](https://github.com/lazear/microlisp), a Scheme-like lisp in less than 1000 loc of C, implemented by Michael Lazear. A single-implementation with extra files for examples and building.\n\n[Tiny Compiler](http://blog.mgechev.com/2017/09/16/developing-simple-interpreter-transpiler-compiler-tutorial/) implemented by Minko Gechev. It translates only arithmetic expressions, but it's well written.\n\n## Epilogue\n\nHave you implemented a programming language in a single file? Let me know with a pull request.\n\nOr fork your own b1fipl. If you do, please give me credit.\n\n## Image credit\n\nParton, James. _Caricature and Other Comic Art in all Times and many Lands_. Project Gutenberg. Retrieved 2021-02-04. http://gutenberg.org/ebooks/39347\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcpaq%2Fb1fipl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcpaq%2Fb1fipl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcpaq%2Fb1fipl/lists"}