oxur-repl
REPL implementation with three-tier execution for optimal performance.
Architecture
Three-Tier Execution
-
Tier 1 - Interpreter (<1ms)
- Direct interpretation for simple expressions
- Fast startup, good for interactive exploration
-
Tier 2 - Cached (~0ms)
- Previously compiled functions
- Just function call overhead
-
Tier 3 - JIT (50-200ms first time, cached after)
- Full compilation for complex code
- Native performance after first run
Protocol
The REPL uses a simple request/response protocol:
Eval- Evaluate an expressionLoad- Load a fileReset- Clear REPL stateStatus- Get execution statisticsShutdown- Stop the server
Usage
use ReplServer;
let mut server = new;
let response = server.handle;