Scheme (experimental)
Experimental. rontolisp reads a subset of R7RS-small -- (scheme base),
(scheme write), (scheme read), (scheme char), (scheme inexact), (scheme cxr), (scheme lazy),
(scheme case-lambda), (scheme process-context)'s exit, (scheme eval), (scheme repl) and (scheme file) -- just large
enough to run a
Scheme program on every backend. Conformance is partial by design and nothing here is a
compatibility promise. Use it to try a Scheme program on the JVM or WebAssembly; write
Common Lisp for anything you need to keep working.
A .scm file is read as Scheme; --source-language scheme says so for any other file.
The language is picked per file, so one program may mix the two.
rontolisp hello.scm # interpreter
rontolisp hello.scm -o Hello.class && java Hello # JVM
rontolisp hello.scm -o hello.wasm && wasmtime run hello.wasm
rontolisp hello.scm -o hello-c.wasm --component && wasmtime run hello-c.wasm
rontolisp prog.txt --source-language scheme # any extension
--no-gc is refused: that backend has no pairs, symbols or closures.
The examples in this section run in your browser: Run runs each one as a program of its own, on a fresh interpreter. The playground reads Scheme when you pick it under language.
(0 1 4 9 16)
(3 true #f "s")
This section
- REPL -- the interactive session and script-runner mode.
- Standards --
--scheme-standard: this implementation's dialect or strict R7RS. - Syntax -- the reader, special forms and
import. - Libraries -- the twelve importable R7RS libraries and what each provides.
- Structure and Interpretation of Computer Programs (SICP) Compatibility -- the
MIT/SICP names visible with no
import. - eval --
(eval datum env)and the environments it accepts. - Deviations -- where this front end departs from R7RS, then what is not implemented yet.
- Mixing with Common Lisp -- calling a Scheme procedure from a Common Lisp file, and back.
- Reference -- one page per procedure, constant and syntactic keyword.