A Python interpreter made in Rust.
- collections.deque: Native Rust implementation using
VecDequewith support forappend,appendleft,pop,popleft,maxlen, and iteration. - os.environ: Mutable mapping backed by
std::envwith support forgetenv,putenv, andunsetenv. - math: Native Rust implementations of
sqrtandfloor. - time: Native Rust implementation of
time.time().
- Python 3.10+ syntax: AST structures for
match/casestatements (parsing support, runtime raisesNotImplementedError).
- threading.Thread: Basic implementation using
std::threadwithstart()andjoin()methods. - Global Interpreter Lock (GIL) for thread safety.
cargo build# Interactive mode
cargo run
# Execute a Python file
cargo run -- file.pycargo testIntegration tests are available in the tests/ directory and run serially to ensure thread safety.
Thank you so much to @MerovingioOps for giving me some starter code!