GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mxgordon/RustyPython: The python interpreter implemented in Rust (WIP)

BranchesTags
Open more actions menu

Latest commit

 

History

42 Commits
42 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 
benchmarker.py
benchmarker.py
 
 
flamegraph.svg
flamegraph.svg
 
 
profile.json.gz
profile.json.gz
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 

Repository files navigation

RustyPython

RustyPython is a Python interpreter written in Rust.

It is a work in progress and is not yet ready for use.

About

I am building the Python interpreter in Rust to learn more about both languages. The performance of the interpreter is also of great priority, ideally, I want to beat the current RustPython interpreter in terms of run speed. I am taking a different approach to this interpreter than they did. Mine is structured far more like the CPython interpreter, while also trying to maintain simplicity.

Instructions

Rust makes this real simple. Just clone the repo and compile like so.

cargo build --release

Speed

Currently, this is looking about 2-3x slower than CPython. This is not so bad, heading in the right direction. However, it is also about 3-4x faster than RustPython. This is a good sign.

Tests

Currently working on developing a testing suite. I copied some of the simpler tests from the RustPython repo into /tests/from_rustpython and am working on getting them to pass.

For the tests I have written, they are mostly testing the existence and correct implementation of various basic features rather than edge cases yet. Once the assert and method definition is added, more sophisticated tests will be written. However, for now this is the state of the testing system.

Test Name Status Notes
test_object ✔️
test_simple ✔️ should include more int operations
test_addition ✔️ optimized 😎
test_deep_for_loop ✔️ optimized 😎
test_while_add ✔️ optimized 😎
test_simple_if_for ✔️ optimized 😎
test_primatives 🚧 need to add all the primatives
test_control_flow ❌ need to add if, strings & indexing
test_tuple ❌ need tuples and tuple unpacking

Supported Features

Feature Supported Notes
User-defined Variables ✔️
Print Function ✔️
Operator overloading ✔️
For Loops ✔️ Doesn't support tuple unpacking (yet)
Comments ✔️
If/if-else Statements ✔️
While Loops ✔️ Close to CPython speeds!
Keyword: assert ✔️
Basic Math Operations 🚧 still needs % and //
Math Assign Operations 🚧 still needs //=, @=, **=, no support for in-pace methods yet
Primatives 🚧 int, float, bool, None (limited implementation)
Built in types 🚧 range only
Match Statements ❌
User-defined Functions ❌
User-define classes ❌
User-define modules ❌
Error Handling ❌
Generators ❌
Importing modules ❌
Typeing ❌
Keyword: with ❌
Keyword: global ❌
Keyword: del ❌
Async ❌

About

The python interpreter implemented in Rust (WIP)

Topics

interpreted-programming-languagepythonpython-implementationrustrustpython

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.