mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
This makes debuggers (or rust-gdb, at least) more pleasant to use, since you don't have to manually cast `PyRef<T>.obj.ptr as `*const PyObjectView<T>` Also get rid of PyGenericObject, since it's vestigial
RustPython
A Python-3 (CPython >= 3.8.0) Interpreter written in Rust.
WARNING: this project is still in a pre-alpha state!
Using this in a production project is inadvisable. Please only do so if you understand the risks.
Usage
Check out our online demo running on WebAssembly.
Goals
- Full Python-3 environment entirely in Rust (not CPython bindings)
- A clean implementation without compatibility hacks
Quick Documentation
pyEval(code, options?);
code: string: The Python code to run
options:
vars?:{ [key: string]: any }: Variables passed to the VM that can be accessed in Python with the variablejs_vars. Functions do work, and receive the Python kwargs as thethisargument.stdout?:"console" | ((out: string) => void) | null: A function to replace the native print function, and it will beconsole.logwhen givingundefinedor "console", and it will be a dumb function when giving null.
License
This project is licensed under the MIT license.