SLED: A Scheme-Inspired Lisp Interpreter for DOS Environments
2 min read
SLED, short for Schemy Lisp en DOS, is a Lisp interpreter designed specifically for DOS operating systems such as FreeDOS and MS-DOS, as well as DOS emulators like DOSBox. Inspired by Scheme and derived from Kilo Lisp, SLED offers a streamlined Lisp experience by omitting some features like macros while enhancing others. It is classified as an Ur-Lisp and operates as a purely symbolic Lisp processor.
The system supports two primary data types: pairs and atoms. Atoms include symbols, closures (functions), and special symbols such as nil, which represents the empty list. Symbols in SLED are case-insensitive by default and can include a limited set of characters, with escape sequences allowing additional ASCII characters.
SLED uses S-expressions both as data and code, consistent with Lisp traditions. Unlike many Lisp dialects, it does not natively support numeric types but emulates natural numbers using list structures known as tally numerals. Core Lisp constructs such as bindings, closures, and function applications are supported, with eager evaluation of function arguments.
Recursion is central to SLED's programming model, supported by features like tail-call optimization and a trampoline evaluator to manage deep recursive calls safely. The interpreter includes a set of built-in functions and a standard library loaded at startup, which is immutable during runtime.
SLED operates as a DOS application with typical DOS constraints, including limits on heap size and symbol table capacity. It supports command-line arguments for loading scripts, batch execution, and error handling modes. The interpreter provides a read-eval-print loop (REPL) for interactive use, with commands for help, exiting, and error management.
The system is built using Microsoft C Compiler or Open Watcom and can be run on various platforms through DOS emulation. SLED is licensed under the Zero-Clause BSD license, making it freely available for use and modification.
This Lisp implementation is particularly relevant for developers and enthusiasts working with legacy DOS environments or those interested in minimalist Lisp interpreters that emphasize symbolic computation and recursion within constrained systems.