-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Add an interactive TUI (terminal user interface) REPL for santa-lang with enhanced editing and visualization features.
Description
Create a terminal-based REPL that goes beyond a simple line-by-line input, providing a rich interactive environment for exploring and experimenting with santa-lang code.
Proposed Features
Enhanced Input
- Multi-line editing with proper cursor movement
- Syntax highlighting as you type
- Auto-indentation for blocks and nested expressions
- Parenthesis/bracket matching and highlighting
- History navigation with search (Ctrl+R)
Auto-completion
- Built-in function names
- User-defined variables and functions in scope
- Keyword completion (let, match, if, etc.)
Output Display
- Pretty-printed results with syntax highlighting
- Truncated output for large data structures with expand option
- Type information display (optional)
Additional Features
:helpcommand for built-in documentation:type <expr>to show expression type:clearto reset the environment:load <file>to load and evaluate a file:save <file>to save session history
Example Session
santa> let numbers = [1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
santa> numbers
|> map(|x| x * 2)
|> filter(|x| x > 4)
[6, 8, 10]
santa> :type numbers
List<Integer>
santa> :help map
map(fn, list) - Transforms each element in a list using the provided function
Implementation Considerations
- Use a TUI library (e.g., ratatui for Rust, blessed/ink for Node)
- Maintain REPL state/environment across inputs
- Handle Ctrl+C gracefully (cancel current input, not exit)
- Support terminal resizing
- Consider vi/emacs keybinding modes
References
- ipython - Enhanced Python REPL
- evcxr - Rust REPL with rich features
- nushell - Modern shell with TUI features
Metadata
Metadata
Assignees
Labels
No labels