Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
another dirty Scheme interpreter
C Scheme Other
branch: master
Failed to load latest commit information.
doc code review for GC stack root
lib primitive stream support
profile profile data
test primitive stream support
.gitignore support command line argument
LICENSE add LICENSE and README
README.md rename init_obj.c
boolean.c improve logger, support var-args
character.c add character cache
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
env.h rename files, remove sc_ prefix
eof.c fix hash table dispose bug
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
gc.h continuation support, still buggy
hashtbl.c add more string procedures. strings are not interned now
hashtbl.h add more string procedures. strings are not interned now
initobj.c rename init_obj.c
intcache.c improve logger, support var-args
intcache.h add integer cache
ioproc.c support command line argument
ioproc.h rename files, remove sc_ prefix
list.c code review for GC stack root
loc vector support(parse, write)
log.h improve logger, support var-args
macro.c macro support
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
queue.h 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
strproc.h add string procedures.
symbol.c add string procedures.
vecproc.c more vector procedures
vecproc.h more vector procedures
vector.c vector support(parse, write)
write.c prettify quote output
write.h rename files, remove sc_ prefix

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
Something went wrong with that request. Please try again.