GithubHelp home page GithubHelp logo

b1fipl's Introduction

A Bestiary of Single-File Implementations of Programming Languages

From a French Prayer-book of the Thirteenth Century, in the British Museum.

Introduction

Programming languages are amazing pieces of work. They turn our words, numbers, and symbols into the bits that make a machine do things.

It's easy to get overwhelmed when implementing a programming language. The GNU Compiler Collection is millions of lines long.

That'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.

These 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.

Functional

7 lines of code, 3 minutes implemented by Matt Might.

arpilisp implemented by Marc Paquette.

How to implement a programming language in JavaScript implemented by Mihai Bazon.

(How to Write a (Lisp) Interpreter (in Python)) implemented by Peter Norvig.

komplott implemented by Kristoffer Grönlund.

Lisp9 implemented by Nils M. Holm. A byte-compiling Lisp interpreter.

Lisp90 implemented by Anthony C. Hay.

Lisp In Less Than 200 Lines Of C implemented by Carl Douglas.

MiniLisp implemented by Rui Ueyama.

Mini-Scheme updated by Chris Pressey, originally implemented by Atsushi Moriwaki.

mLite implemented by Nils M. Holm. A lightweight variant of ML.

sedlisp implemented by Shinichiro Hamaji.

single_cream, scheme interpreter implemented by Raymond Nicholson.

ulc implemented by Asad Saeeduddin. A minimalistic implementation of the untyped lambda calculus in JS

Imperative

asm6502.py implemented by David Beazley.

Brainfuck implemented by Brian Raiter.

c4 C in 4 functions, implemented by Robert Swierczek.

dc implemented by Lorinda Cherry.

jonesForth implemented by Richard W.M. Jones.

Mini-C implemented by Sam Nipps. A small subset of C, of course. But not as small as you would guess.

Mouse implemented by Peter Grogono.

Pascal-S implemented by Niklaus Wirth & Scott A. Moore.

picol is a Tcl interpreter implemented in C. Implemented by Salvatore Sanfilippo, aka antirez.

swizzle implemented by Robert Swierczek.

The Super Tiny Compiler! implemented by James Kyle.

Tiny Basic implemented by Tom Pittman.

Trac implemented by Jack Trainor.

Tutorial - Write a Shell in C implemented by Stephen Brennan.

VTL02 for 6502 ported and improved by Mike Barry. VTL-02 was originally designed and implemented by Gary Shannon & Frank McCoy.

Logical

microKanren is a Kanren interpreter, implemented by Jason Hemann.

prolog.c is a simple Prolog interpreter written in C++, implemented by Alan Mycroft.

Prolog originally implemented by Ken Kahn, adapted by Nils M. Holm.

Honourable Mentions

256LOL 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.

An Implementation of J implemented by Arthur Whitney. See the appendix "Incunabulum". It's only a fragment of the J interpreter, but its conciseness is impressive.

A Regular Expression Matcher implemented by Rob Pike, exegesis by Brian Kernighan.

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.

Tiny Compiler implemented by Minko Gechev. It translates only arithmetic expressions, but it's well written.

Epilogue

Have you implemented a programming language in a single file? Let me know with a pull request.

b1fipl's People

Contributors

marcpaq avatar masaeedu avatar rain-1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.