All Projects → darius → Ichbins

darius / Ichbins

A tiny self-hosting Lisp-to-C compiler

Programming Languages

c
50402 projects - #5 most used programming language
language
365 projects
lisp
113 projects

Labels

Projects that are alternatives of or similar to Ichbins

Hybridizer Basic Samples
Examples of C# code compiled to GPU by hybridizer
Stars: ✭ 186 (-11.43%)
Mutual labels:  compiler
Tengo
A fast script language for Go
Stars: ✭ 2,528 (+1103.81%)
Mutual labels:  compiler
Interim
Low-level Lisp with compile-time memory management
Stars: ✭ 204 (-2.86%)
Mutual labels:  compiler
El Compilador
An SSA-based compiler for Emacs Lisp
Stars: ✭ 187 (-10.95%)
Mutual labels:  compiler
Fast
Find in AST - Search and refactor code directly in Abstract Syntax Tree as you do with grep for strings
Stars: ✭ 194 (-7.62%)
Mutual labels:  compiler
Cub
The Cub Programming Language
Stars: ✭ 198 (-5.71%)
Mutual labels:  compiler
Mlkit
Standard ML Compiler and Toolkit
Stars: ✭ 183 (-12.86%)
Mutual labels:  compiler
Compiler
Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Stars: ✭ 209 (-0.48%)
Mutual labels:  compiler
He Transformer
nGraph-HE: Deep learning with Homomorphic Encryption (HE) through Intel nGraph
Stars: ✭ 195 (-7.14%)
Mutual labels:  compiler
Binaryen.js
A buildbot for binaryen.js, a port of Binaryen to the Web, with TypeScript support.
Stars: ✭ 201 (-4.29%)
Mutual labels:  compiler
Lhc
The LLVM LHC Haskell Optimization System
Stars: ✭ 188 (-10.48%)
Mutual labels:  compiler
Ape
Ape Programming Language
Stars: ✭ 195 (-7.14%)
Mutual labels:  compiler
Xdpw
XD Pascal: A small embeddable self-hosting Pascal compiler for Windows. Supports Go-style methods and interfaces
Stars: ✭ 199 (-5.24%)
Mutual labels:  compiler
Faerie
Magical ELF and Mach-o object file writer backend
Stars: ✭ 187 (-10.95%)
Mutual labels:  compiler
8cc.vim
C Compiler written in Vim script
Stars: ✭ 205 (-2.38%)
Mutual labels:  compiler
Minijit
A basic x86-64 JIT compiler written from scratch in stock Python
Stars: ✭ 185 (-11.9%)
Mutual labels:  compiler
Bridge
♠️ C# to JavaScript compiler. Write modern mobile and web apps in C#. Run anywhere with Bridge.NET.
Stars: ✭ 2,216 (+955.24%)
Mutual labels:  compiler
Cparser
C99 parser and frontend for libfirm
Stars: ✭ 209 (-0.48%)
Mutual labels:  compiler
Transcrypt
Python 3.7 to JavaScript compiler - Lean, fast, open! -
Stars: ✭ 2,502 (+1091.43%)
Mutual labels:  compiler
Nxdk
The cross-platform, open-source SDK to develop for original Xbox: *new* xdk
Stars: ✭ 200 (-4.76%)
Mutual labels:  compiler

ICHBINS

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.

QUICK START

$ git clone [email protected]:darius/ichbins.git

(Or get a tarball from http://github.com/darius/ichbins) $ 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 documented in Documentation.md.

MOTIVATION

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" http://library.readscheme.org/page1.html

Marc Feeley, "Scheme in 90 Minutes" http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html (which compiles a more powerful Scheme subset, but is longer and not self-hosting)

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

See also https://github.com/darius/elv for a more featureful descendant.

THANKS

To Johnicholas Hines for example code.

To Manuel Simoni and Kragen Sitaker for feedback.

LICENSE & CONTACT

Copyright 2007 Darius Bacon under the terms of the MIT X license found at http://www.opensource.org/licenses/mit-license.html

Darius Bacon [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].