Official chibi-scheme repository
Find a file
2009-06-23 11:53:06 +09:00
include/chibi fixes for alternate compile options 2009-06-22 21:30:14 +09:00
opt cleanup, removing mid-function returns which could corrupt 2009-06-18 00:36:39 +09:00
tests adding basic call/cc tests 2009-06-23 11:53:06 +09:00
.hgignore store difference between ip and bytecode start instead of the 2009-06-21 16:37:58 +09:00
debug.c adding immediate flonum support 2009-06-18 16:15:56 +09:00
eval.c Updating resume/cc needs to jump to the start of the procedure 2009-06-23 11:46:56 +09:00
gc.c Was unintentionally using the same name 'sexp_types' for the sexp 2009-06-23 11:49:26 +09:00
init.scm store difference between ip and bytecode start instead of the 2009-06-21 16:37:58 +09:00
main.c fixing bug in loading init.scm file 2009-06-21 17:26:36 +09:00
Makefile fixes for alternate compile options 2009-06-22 21:30:14 +09:00
opcodes.c switching to data-driven sexp_mark 2009-06-15 17:34:26 +09:00
README store difference between ip and bytecode start instead of the 2009-06-21 16:37:58 +09:00
sexp.c Was unintentionally using the same name 'sexp_types' for the sexp 2009-06-23 11:49:26 +09:00
VERSION switching to data-driven sexp_mark 2009-06-15 17:34:26 +09:00

                             Chibi-Scheme
                            --------------
                                   
    Minimal Scheme Implementation for use as an Extension Language

              http://synthcode.com/wiki/chibi-scheme/


Chibi-Scheme is a very small but mostly complete R5RS Scheme
implementation using a reasonably fast custom VM.  Chibi-Scheme tries
as much as possible not to trade its small size by cutting corners,
and provides full continuations, both low and high-level hygienic
macros based on syntactic-closures, string ports and exceptions.
Chibi-Scheme is written in highly portable C and supports multiple
simultaneous VM instances to run.

To build, just run "make".  This will provide a shared library
"libchibi-scheme", as well as a sample "chibi-scheme" command-line
repl.  The "chibi-scheme-static" make target builds an equivalent
static executable.

You can edit the file config.h for a number of settings, mostly
disabling features to make the executable smaller.  You can specify
standard options directly as arguments to make, for example

  make CFLAGS=-Os

to optimize for size, or

  make LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include

to compile against a library installed in /usr/local.

By default Chibi uses a custom, precise, non-moving GC.  You can link
against the Boehm conservative GC by editing the config file, or
directly from make with:

  make USE_BOEHM=1

See the file main.c for an example of using chibi-scheme as a library.
The essential functions to remember are:

  sexp_make_context(NULL, NULL, NULL)
    returns a new context

  sexp_eval(context, expr)
    evaluates an s-expression

  sexp_eval_string(context, str)
    reads an s-expression from str and evaluates it