SigScheme is a R5RS and R7RS small Scheme interpreter for embedded use.
It features low memory consumption (2-words per cons cell), multibyte characters handling (UTF-8, EUCs and Shift_JIS) and more.
It is mainly developed to be the Scheme interpreter of uim.
- Homepage: https://github.com/uim/sigscheme
- Git repository:
git clone https://github.com/uim/sigscheme.git
See following files for further information.
doc/spec.txt: specifications of SigScheme
Please report us if you find a problem.
- Conforms to R5RS basically (not fully)
- Conforms to R7RS small basically (not fully) with the
r7rsfeature- Libraries:
define-library,importand the standard libraries - Bytevectors and binary ports
- Libraries:
- R5RS hygienic macros with R7RS extensions
- Inexact real numbers (flonums) with the
realfeature - Unicode character properties and case mappings with the
unicodefeature - Supports Following SRFIs
- SRFI-0: Feature-based conditional expansion construct
- SRFI-1: List Library
- SRFI-2:
AND-LET*: an AND with local bindings, a guardedLET*special form - SRFI-6: Basic String Ports
- SRFI-8: receive: Binding to multiple values
- SRFI-9: Defining Record Types
- SRFI-22: Running Scheme Scripts on Unix (partial)
- SRFI-23: Error Reporting Mechanism
- SRFI-28: Basic Format Strings
- SRFI-34: Exception Handling for Programs
- SRFI-38: External Representation for Data with Shared Structure (partial)
- SRFI-43: Vector library
- SRFI-48: Intermediate Format Strings
- SRFI-55: require-extension
- SRFI-60: Integer as Bits (partial)
- SRFI-64: A Scheme API for test suites
- SRFI-69: Basic hash tables
- SRFI-95: Sorting and Merging
- SRFI-180: JSON
- R6RS: R6RS characters (partial and preliminary)
- Multibyte character encodings support
define-macrolet-optionals*for optional argument processing
See doc/spec.txt and doc/design.txt for further information.
SigScheme can be built with Meson or GNU Autotools. Meson is recommended. GNU Autotools is still supported for compatibility but it will be removed in the future.
Meson 1.1.0 or later and Ninja are required to build with Meson.
Run meson setup with some options at the top directory.
meson setup [-Dconf=CONF] [-Ddefault_encoding=ENCODING] buildThis specifies a base configuration set. Select one from the list below suitable for your purpose.
full: compile with full features but broken onesregular: (default) compile with typically needed featuresr5rs: compile with strict R5RS conformancesr7rs: compile with R7RS featuresdev: developer-friendly configurationuim: configure for uim
SigScheme normally selects UTF-8 as default encoding. You can change it by this option as follows.
meson setup -Ddefault_encoding=eucjp buildFollowing encodings can be specified.
utf8euccneucjpeuckrsjis
In addition to -Ddefault_encoding=ENCODING, you can enable other
optional and switchable character encodings.
meson setup -Ddefault_encoding=eucjp -Deucjp=true -Dsjis=true buildSigScheme uses BDWGC (8.3.0 or later) or libgcroots to find GC
roots. By default (-Dgc=auto), system BDWGC is used if it
exists. Otherwise system libgcroots is used if it exists. Otherwise
the bundled libgcroots is used. You can choose one explicitly as
follows.
bdwgc: use system BDWGCgcroots: use system libgcroots or the bundled libgcrootstiny-subst: use tiny substitution insrc/gcroots
Use --force-fallback-for=gcroots to always use the bundled
libgcroots.
meson setup -Dgc=gcroots --force-fallback-for=gcroots buildMeson's built-in options are also available. For example, use
--buildtype=release for an optimized build and -Db_ndebug=true to
disable assertions.
See meson_options.txt or meson configure build for all
options. Each --enable-FEATURE/--disable-FEATURE option of
configure is available as -DFEATURE=true/-DFEATURE=false. Note
that - in FEATURE is replaced with _ and --enable-debug is
-Ddebug_mode=true.
Then run meson compile.
meson compile -C buildGNU make is required to build.
Run ./configure with some options at the top directory.
./configure [--enable-conf=CONF] [--enable-default-encoding=ENCODING]Options are the same as Meson's ones: --enable-conf=CONF,
--enable-default-encoding=ENCODING, --enable-ENCODING and so on.
Then type make at the top directory.
makemeson test -C buildor
make checkSigScheme can be built and tested with AddressSanitizer.
meson setup -Db_sanitize=address build
meson test -C build-Db_lundef=false is also needed with Clang.
libgcroots 0.3.8 or later is required when system libgcroots is
used. The bundled libgcroots and -Dgc=tiny-subst can also be used.
The GC scans the stack that has uninitialized locations. Valgrind
reports it as a use of an uninitialized value. The reports are
suppressed when SigScheme is built with valgrind/memcheck.h. It's
used by default if it exists. -Dvalgrind=enabled requires it. The
option is also used for the bundled libgcroots.
meson setup -Dvalgrind=enabled buildmeson install -C buildor
make installTo run SigScheme in interactive mode, type as follows.
sscmTo execute a Scheme script, specify it as argument.
sscm <filename>To load files before the script or the interactive mode, specify them
with --load. They are loaded in the specified order.
sscm --load <filename> [--load <filename> ...] [<filename>]git clone --recursive https://github.com/uim/sigscheme.git
cd sigscheme
./setup.sh
meson setup <YOUR_BUILD_OPTIONS> build
meson compile -C buildor
git clone --recursive https://github.com/uim/sigscheme.git
cd sigscheme
./setup.sh
./autogen.sh
./configure --enable-maintainer-mode <YOUR_BUILD_OPTIONS>
make -j$(nproc)Some parts of this software had been funded by IPA (http://www.ipa.go.jp/)