Skip to content

Power-Trip-Labs/RustPython-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

RustPython v2

Static Badge Static Badge

A Python interpreter made in Rust.

Features

Standard Library Modules

  • collections.deque: Native Rust implementation using VecDeque with support for append, appendleft, pop, popleft, maxlen, and iteration.
  • os.environ: Mutable mapping backed by std::env with support for getenv, putenv, and unsetenv.
  • math: Native Rust implementations of sqrt and floor.
  • time: Native Rust implementation of time.time().

Language Features

  • Python 3.10+ syntax: AST structures for match/case statements (parsing support, runtime raises NotImplementedError).

Threading

  • threading.Thread: Basic implementation using std::thread with start() and join() methods.
  • Global Interpreter Lock (GIL) for thread safety.

Building

cargo build

Running

# Interactive mode
cargo run

# Execute a Python file
cargo run -- file.py

Testing

cargo test

Integration tests are available in the tests/ directory and run serially to ensure thread safety.

Credits

Thank you so much to @MerovingioOps for giving me some starter code!

About

A python interpreter made in Rust.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Contributors 2

  •  
  •  

Languages