SIOF (Scheme In One File)
SIOF is an interpreter for the Scheme programming language.
Scheme Compatibility
SIOF is mostly compatible with R7RS-small standard, but it has the following known limitations and deviations from the standard:
- fixnums are 30 bit long, flonums are doubles
- no support for bignums/rational/complex numbers
- no support for Unicode; strings are 8-bit clean, use system locale
- source code literals cannot be circular (R7RS allows this)
Some features of the R7RS-Small standard are not yet implemented or implemented in a simplified or non-conforming way:
readprocedure is always case-sensitive (all ports operate in no-fold-case mode)#!fold-caseand#!no-fold-casedirectives are not supportedincludeandinclude-ciforms are not supportedget-environment-variableis implemented, butget-environment-variablesis notcurrent-jiffyandjiffies-per-secondreturn inexact integerscurrent-secondis defined as Cdifftime(time(0), 0)+37- macroexpander treats
_as a regular identifier, not match-all pattern - macroexpander does not support
(... escaped)pattern escapes - macroexpander does not support patterns with internal ellipsis and improper tail variable
Here are some details on SIOF's interactive Read-Eval-Print-Loop (REPL) and evaluation/libraries support:
readsupports R7RS notation for circular structures, but bothevalandloadreject them- all supported R7RS-small forms are available in the built-in
(sharpf base)library -Lcommand-line option extends library search path; initial path is./cond-expandchecks against(features)and available librariesenvironmentdynamically fetches library definitions from.sldfiles- non-standard
expandis available (macroexpands the argument) eval,load, andexpandaccept optional environment argument- command-line file arguments are dynamically loaded
- both
importanddefine-libraryforms can be entered interactively into REPL featuresprocedure returns(r7rs exact-closed siof siof-1.0.2)
Please note that SIOF's interaction environment exposes bindings for all supported R7RS-small procedures and syntax forms directly, so there is no need to use import. In order to use import forms and environment procedure with R7RS-small libraries, you will need to copy the scheme folder with .sld files for the libraries from here to your local file system and make sure SIOF can locate it (its library search path contains current directory by default and can be extended with the help of -L command line option).
Origins
SIOF's original code is written in #F, a language for building Scheme-like systems. Please see SIOF github repository for more information about the project.