Skip to content


Subversion checkout URL

You can clone with
Download ZIP
another dirty Scheme interpreter
C Scheme Other
Branch: master
Failed to load latest commit information.
profile profile data
test primitive stream support
.gitignore support command line argument
LICENSE add LICENSE and README rename init_obj.c
boolean.c improve logger, support var-args
charcache.c improve logger, support var-args
charcache.h add character cache
compound.c add variable argument support
config.h increase heap size
cont.c suppress unused warning
cont.h continuation support, still buggy
env.c re-write environment using rb-tree
eval.c fix a memory corruption during GC
eval.h rename files, remove sc_ prefix
fixnum.c add integer cache
flonum.c add basic floating point support
frame.c re-write environment using rb-tree
gc.c change recursive mark to iterative
initobj.c rename init_obj.c
intcache.c improve logger, support var-args
ioproc.c support command line argument
list.c code review for GC stack root
loc vector support(parse, write)
log.h improve logger, support var-args
main.c support command line argument
makefile change recursive mark to iterative
mathproc.c improve math procedures
mathproc.h add math primitive procedures
mem.c fix hash table dispose bug
mem.h rename files, remove sc_ prefix
object.h macro support
objstream.c vector support(parse, write)
objstream.h vector support(parse, write)
port.c initial gc support, stack local objects not protected
primitive.c rename files, remove sc_ prefix
procdef.c add macroexpand-1, macro?
procdef.h add macroexpand-1, macro?
queue.c change recursive mark to iterative
reader.c quasiquote support
reader.h rename files, remove sc_ prefix
repl.c support command line argument
repl.h support command line argument
sform.c quasiquote support
sform.h quasiquote support
sstream.c improve logger, support var-args
sstream.h rename files, remove sc_ prefix
stack.c continuation support, still buggy
stack.h continuation support, still buggy
string.c add more string procedures. strings are not interned now
strproc.c fixed substring bug
symbol.c add string procedures.
vecproc.c more vector procedures
vecproc.h more vector procedures
write.c prettify quote output
write.h rename files, remove sc_ prefix

Another Dirty Scheme Interpreter

"We were actually trying to build something complicated and discovered, serendipitously, that we had accidentally designed something that met all our goals but was much simpler than we had intended....we realized that the lambda calculus--a small, simple formalism--could serve as the core of a powerful and expressive programming language." -- Sussman and Steele

Writing a Scheme interpreter is easy, and more importantly, it is fun.


  • lambda, of course
  • integer(32 bit), floating-point numbers, string, symbol, boolean, character, pair, vector
  • basic number/mathematical functions
  • basic input/output support
  • basic string/character procedures
  • vector procedures in R5RS
  • most list procedures in MIT Scheme
  • cond, if, let, begin, and, or, define, set!, apply, eval...
  • var-arg
  • mark-sweep garbage collector
  • continuation
  • macro(define-macro)
  • promise(delay, force)


$ make
$ sudo make install
$ asc
If you don't like it, $ sudo make uninstall


If you already know Scheme, just start typing code in the REPL. Or you can read the R5RS. here

Thanks for Peter Michaux's excellent introduction series.

Todo list:

  • rename files, remove "sc" prefix [DONE]
  • add gc support [DONE]
  • add cache for integer objects [DONE]
  • add cache for character objects [DONE]
  • add floating point support [DONE]
  • add var-arg support [DONE]
  • improve logger [DONE]
  • modify equal? eq? eqv? [DONE]
  • add / primitive procedure [DONE]
  • add math primitive functions [DONE]
  • add character procedures [DONE]
  • add gcd, lcm procedures [DONE]
  • add (runtime) procedure [DONE]
  • add more list procedures [DONE]
  • add string functions [DONE]
  • add (display) procedure [DONE]
  • improve io support [DONE]
  • add vector support [DONE]
  • rewrite environment using rbtree(variable lookup is too slow) [DONE] ~2x speedup
  • call/cc [DONE]
  • macro support [DONE]
  • command line options [DONE]
  • make install [DONE]
  • add case, do [DONE]
  • prettify quote output [DONE]
  • stream support
Something went wrong with that request. Please try again.