mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 06:39:17 +02:00
Official chibi-scheme repository
Notably no longer converting from function pointers <-> void*. Remaining --pedantic warnings: * ISO C90 does not support 'long long' * ISO C90 does not support the 'z' printf length modifier * ISO C90 does not support flexible array members * ISO C90 forbids mixed declarations and code * ISO C90 forbids specifying subobject to initialize * anonymous variadic macros were introduced in C99 * invalid use of structure with flexible array member The first one is only used when optional bignums are enabled, and I have no intention of supporting bignums on systems w/o long long (although it's not guaranteed two words fit in a long long - I need to fix this). The 'z' modifier is necessary for long types (you'd get warnings the other way without it). The next 4 are intentional - they make the code cleaner, and all of these extensions are supported by Plan 9. The last one is tricky. I think it refers to the fact that not only am I using flexible array members, but I'm using them as non-final alternates in a union. I'll have to double check the semantics of this. |
||
---|---|---|
include/chibi | ||
opt | ||
tests | ||
.hgignore | ||
debug.c | ||
eval.c | ||
gc.c | ||
init.scm | ||
main.c | ||
Makefile | ||
mkfile | ||
opcodes.c | ||
README | ||
sexp.c | ||
VERSION |
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