another dirty Scheme interpreter
C Scheme Other
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
doc code review for GC stack root Feb 23, 2012
lib primitive stream support May 3, 2012
profile profile data Mar 10, 2012
test primitive stream support May 3, 2012
.gitignore support command line argument Apr 19, 2012
LICENSE add LICENSE and README Feb 28, 2012
README.md rename init_obj.c Apr 21, 2012
boolean.c improve logger, support var-args Feb 24, 2012
character.c add character cache Feb 24, 2012
charcache.c improve logger, support var-args Feb 24, 2012
charcache.h add character cache Feb 24, 2012
compound.c add variable argument support Feb 28, 2012
config.h increase heap size May 3, 2012
cont.c suppress unused warning Mar 25, 2012
cont.h continuation support, still buggy Mar 24, 2012
env.c re-write environment using rb-tree Mar 15, 2012
env.h rename files, remove sc_ prefix Feb 16, 2012
eof.c fix hash table dispose bug Feb 22, 2012
eval.c fix a memory corruption during GC May 3, 2012
eval.h rename files, remove sc_ prefix Feb 16, 2012
fixnum.c add integer cache Feb 24, 2012
flonum.c add basic floating point support Feb 24, 2012
frame.c re-write environment using rb-tree Mar 15, 2012
gc.c change recursive mark to iterative May 3, 2012
gc.h continuation support, still buggy Mar 24, 2012
hashtbl.c add more string procedures. strings are not interned now Mar 6, 2012
hashtbl.h add more string procedures. strings are not interned now Mar 6, 2012
initobj.c rename init_obj.c Apr 21, 2012
intcache.c improve logger, support var-args Feb 24, 2012
intcache.h add integer cache Feb 24, 2012
ioproc.c support command line argument Apr 19, 2012
ioproc.h rename files, remove sc_ prefix Feb 16, 2012
list.c code review for GC stack root Feb 23, 2012
loc vector support(parse, write) Mar 12, 2012
log.h improve logger, support var-args Feb 24, 2012
macro.c macro support Apr 15, 2012
main.c support command line argument Apr 19, 2012
makefile change recursive mark to iterative May 3, 2012
mathproc.c improve math procedures Mar 1, 2012
mathproc.h add math primitive procedures Feb 29, 2012
mem.c fix hash table dispose bug Feb 22, 2012
mem.h rename files, remove sc_ prefix Feb 16, 2012
object.h macro support Apr 15, 2012
objstream.c vector support(parse, write) Mar 12, 2012
objstream.h vector support(parse, write) Mar 12, 2012
port.c initial gc support, stack local objects not protected Feb 22, 2012
primitive.c rename files, remove sc_ prefix Feb 16, 2012
procdef.c add macroexpand-1, macro? Apr 15, 2012
procdef.h add macroexpand-1, macro? Apr 15, 2012
queue.c change recursive mark to iterative May 3, 2012
queue.h change recursive mark to iterative May 3, 2012
reader.c quasiquote support Apr 15, 2012
reader.h rename files, remove sc_ prefix Feb 16, 2012
repl.c support command line argument Apr 19, 2012
repl.h support command line argument Apr 19, 2012
sform.c quasiquote support Apr 15, 2012
sform.h quasiquote support Apr 15, 2012
sstream.c improve logger, support var-args Feb 24, 2012
sstream.h rename files, remove sc_ prefix Feb 16, 2012
stack.c continuation support, still buggy Mar 24, 2012
stack.h continuation support, still buggy Mar 24, 2012
string.c add more string procedures. strings are not interned now Mar 6, 2012
strproc.c fixed substring bug Mar 7, 2012
strproc.h add string procedures. Mar 5, 2012
symbol.c add string procedures. Mar 5, 2012
vecproc.c more vector procedures Mar 13, 2012
vecproc.h more vector procedures Mar 13, 2012
vector.c vector support(parse, write) Mar 12, 2012
write.c prettify quote output Apr 21, 2012
write.h rename files, remove sc_ prefix Feb 16, 2012

README.md

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.

Features:

  • 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)

Install:

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

Documentation:

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