Expand description
§Grift REPL
A Read-Eval-Print-Loop for the Grift R7RS-compliant Scheme interpreter.
§Features
- Rich error display with stack traces
- Line editing with arrow keys (via rustyline)
- GC commands and statistics
- Help system
- Output callback for side effects during macro expansion
- Integrated
StdIoProviderfromgrift_stdfor port-based I/O (stdin, stdout, stderr, and dynamic string ports)
§Usage
use grift_repl::run_repl;
run_repl::<10000>();Structs§
- Arena
- Fixed-size arena allocator with O(1) allocation.
- Arena
Index - Index into the arena.
- Display
Value - A wrapper that enables
core::fmt::Displayfor Lisp values. - Eval
Error - Evaluation error with context - optimized for minimal size.
- Evaluator
- The Lisp evaluator with full trampolined TCO.
- GcStats
- Statistics returned by garbage collection.
- Lisp
- A Lisp execution context wrapping an arena
- Parse
Error - Parser error with location
- Repl
- The REPL structure (for API convenience)
- Source
Loc - Source location for error reporting
- Stack
Frame - A stack frame for error reporting
Enums§
- Arena
Error - Errors that can occur during arena operations.
- Builtin
- Built-in functions (optimization to avoid symbol lookup)
- Error
Kind - Error kind enumeration
- Parse
Error Kind - StdLib
- Standard library functions (stored in static memory, not arena)
- Value
- A Lisp value
Traits§
- Trace
- Trait for types that can be traced by the garbage collector.
Functions§
- eval_
to_ string - Evaluate a string and return the result as a string
- format_
error - Format an evaluation error with full context
- format_
value - Format a Lisp value as a string
- is_
only_ comments_ and_ whitespace - Check if a string contains only comments and whitespace.
- parse
- Parse a string into a Lisp expression
- run_
repl - Run a REPL session
- value_
to_ string - Convert a Lisp value to a string
Type Aliases§
- Arena
Result - Result type for arena operations.
- Eval
Result - Result type for evaluation