Skip to content
A tiny self-hosting Lisp-to-C compiler
C Scheme Other
Latest commit a7189d2 Oct 29, 2013 @darius some more notes
Failed to load latest commit information.
boot-terp import from Jul 5, 2010
examples/datatype_idiom add example code from Johnicholas Hines Jul 13, 2010
Makefile import from Jul 6, 2010
README add overview doc Oct 28, 2013
bless import from Jul 6, 2010
ichbins.c bring ichbins.c up to date with its source Nov 30, 2010
ichbins.scm trivial improvement: use list1 Nov 30, 2010



This is a self-hosting compiler of a Lisp dialect to C in 6 pages of
code. I've tried to make it as simple as possible, with almost no
concessions to performance or extra functionality -- it's meant to be
educational rather than useful.


    $ git clone
(Or get a tarball from
    $ cd ichbins
    $ make

To compile a program named foo.scm and then run it:
    $ ./ichbins <foo.scm >foo.c
    $ cc foo.c -o foo
    $ ./foo

There's a sketchy overview of the language and system in Overview.text.

To make a change to the compiler and rebuild it, just typing 'make'
isn't sufficient because of the circular dependency. 'make' will build
an executable named ichbins2, compiling the current source with the
previous executable. To replace that executable, type './bless', which
does two tests:

    * That the tests in the tests/ directory pass.

    * That the old and new versions of the compiler executable produce
      the same C output from the compiler source. This test typically
      passes for routine changes to the source, but it's perfectly OK
      for it to fail; you should just be sure you can say why this case
      is expected. Then do 'mv ichbins2 ichbins' by hand and do ./bless 
      again; this time it must pass, or something's buggered.

The Lisp dialect implemented here is undocumented, but there's also a
quick-and-dirty interpreter for it in C in boot-terp/. (I don't know if
it can still interpret the compiler by now.)


I'm a nut who wants to grow a beautiful wholeness from tiny beginnings.
This is a rewrite of 'icbins', which had the same larger goal in mind
but a more immediate focus on playing with bootstrapping.

Direct influences include:

Steele & Sussman, "The Art of the Interpreter"

Marc Feeley, "Scheme in 90 Minutes"
(which compiles a more powerful Scheme subset, but is longer and not

The name 'ichbins' could stand for "I Can Hardly Believe It's Not Scheme!"


To Johnicholas Hines for example code.

To Manuel Simoni and Kragen Sitaker for feedback.


Copyright 2007 Darius Bacon under the terms of the MIT X license
found at

Darius Bacon <>
Something went wrong with that request. Please try again.