chibi-scheme(1)
π chibi-scheme β a tiny Scheme interpreter π
okay bestie, gather round, because this is the manual page for chibi-scheme(1) from the General Commands Manual section, and it's literally the cutest little Scheme interpreter you'll ever meet. sit down, grab a boba, and let's get into it β¨
πΈ SYNOPSIS πΈ
chibi-scheme [-qQrRfTV] [-I path ] [-A path ] [-D feature ] [-m module ]
[-x module ] [-l file ] [-e expr ] [-p expr ] [-t module.id ] [-d image-
file ] [-i image-file ] [--] [ script argument ... ]
π¦ DESCRIPTION π¦
chibi-scheme is a sample interactive Scheme interpreter for the chibi-scheme library. it's basically the "here's how you embed chibi-scheme in your own apps" demo, and honestly? it's also just genuinely useful on its own for writing scripts and doing interactive development. main character energy fr π
when a script is given, that script gets loaded with SRFI-22 semantics β meaning it calls the procedure main (if it's defined) with a single parameter: a list of the command-line arguments, starting with the script name. and yes, this works exactly how you'd expect with shell #! semantics. she's a shebang girlie π
otherwise, if no script is given and no -e or -p options are given, you drop into an interactive repl β reading, evaluating, then printing expressions until EOF is reached. now, real talk: the repl it gives you is very minimal. if you want readline completion you're gonna want to wrap it with the rlwrap(1) program. and it doesn't catch signals either β to handle keyboard interrupts you can use the (chibi process) module. for a more sophisticated REPL with readline support, signal handling, module management and smarter read/write, you want the (chibi repl) module. and you can launch that automatically with:
chibi-scheme -R .
for convenience, the default language is the (scheme small) module, which includes every library in the R7RS small standard, plus transitively some other dependencies. that's actually a LOT β like, quite large β so if you want a more minimal startup language you'll want the -x module option described below. want a mostly R5RS-compatible language? use chibi-scheme -xscheme.r5rs. want just the core language used for bootstrapping? use chibi-scheme -xchibi, or its shortcut chibi-scheme -q. easy β¨
β¨ OPTIONS β¨
first up, two lil house rules, bestie:
- space is optional between options and their arguments.
- options without arguments may not be chained together.
and to reduce the need for shell escapes, options with module arguments (-m, -x and -R) are written in dot notation, so the module (foo bar) gets written as foo.bar. iykyk π
-Vβ prints the version information and exits. bye! π-qβ "Quick" load, shortcut forchibi-scheme -xchibi. this is a slightly different language from(scheme base), which may load faster, and is guaranteed not to load any additional shared libraries.-Qβ extra "quick" load, shortcut forchibi-scheme -xchibi.primitive. the resulting environment will only contain the core syntactic forms and primitives coded in C. this is very fast and guaranteed not to load any external files, but it's also very limited. no cap.-r[main]β run the"main"procedure when the script finishes loading, as in SRFI-22.-R[module]β loads the given module and runs the"main"procedure it defines (which need not be exported) with a single argument of the list of command-line arguments, as in SRFI-22. the name"main"can be overridden with the-roption.[module]may be omitted, in which case it defaults tochibi.repl. sochibi-scheme -Ris the recommended means to get the advanced REPL π-sβ strict mode, escalating warnings to fatal errors. she does not play π-fβ change the reader to case-fold symbols as in R5RS.-Tβ disables tail-call optimization. this can be useful for debugging in some cases, but it also makes it very likely to overflow the stack. be careful, bestie.-hsize[/max_size]β specifies the initial size of the heap, in bytes, optionally followed by the maximum size the heap can grow to. size can be any integer value, optionally suffixed by"K"for kilobytes,"M"for megabytes, or"G"for gigabytes. β οΈ-hmust be specified before any options which load or evaluate Scheme code.-Ipathβ inserts path on the front of the load path list.-Apathβ appends path to the load path list.-Dfeatureβ adds feature to the feature list, useful for cond-expanding different library code.-mmoduleβ (see-xmodulebelow, they're a duo π«Ά)-xmoduleβ imports module as though(import module)were evaluated. if the-xversion is used, then module replaces the current environment instead of being added to it.-lfileβ loads the Scheme source from the file file, searched for in the default load path.-eexprβ evaluates the Scheme expression expr.-pexprβ evaluates the Scheme expression expr then prints the result to stdout. β¨-tmodule.idβ enables tracing for the given identifier id in the module module.-dimage-fileβ dumps the current Scheme heap to image-file and exits. this feature is still experimental.-iimage-fileβ loads the Scheme heap from image-file instead of compiling the init file on the fly. this feature is also still experimental.-bβ makes stdio nonblocking (blocking by default). only available when lightweight threads are enabled.
π ENVIRONMENT π
CHIBI_MODULE_PATHβ a colon separated list of directories to search for module files, inserted before the system default load paths.chibi-schemesearches for modules in directories in the following order:- directories included with the
-Ipath option - directories included from
CHIBI_MODULE_PATH - system directories
- directories included with
-Apath option
- directories included with the
if CHIBI_MODULE_PATH is unset, the directories "./lib" and "." are searched in order. set it to empty to only consider -I, system directories and -A.
CHIBI_IGNORE_SYSTEM_PATHβ if set to anything but"0", system directories (as listed above) are not included in the search paths. π
π AUTHORS π
Alex Shinn (alexshinn @ gmail . com) β the icon, the legend π
π SEE ALSO π
more detailed information can be found in the manual included in doc/chibi.scrbl, included in the distribution.
the chibi-scheme home-page: https://github.com/ashinn/chibi-scheme/ πΈ
and that's the whole vibe check, bestie β this page is from the 4th Berkeley Distribution and it's chibi-scheme(1), so go forth and interpret some Scheme fr fr πβ¨π¦
π¦ where this page comes from
- alpine 3.24: chibi-scheme-doc 0.12-r0 Β· BSD-3-Clause
- fedora 43: chibi-scheme 0.10.0-8.fc43 Β· BSD-3-Clause AND MIT
- fedora 43: chibi-scheme 0.10.0-8.fc43 Β· BSD-3-Clause AND MIT
- fedora 44: chibi-scheme 0.10.0-10.fc44 Β· BSD-3-Clause AND MIT
- fedora 44: chibi-scheme 0.10.0-10.fc44 Β· BSD-3-Clause AND MIT
- nixos 26.05: chibi-scheme 0.12
- nixpkgs unstable: chibi-scheme 0.12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms