Code Monkey home page Code Monkey logo

rustpython's Introduction

RustPython

A Python interpreter written in Rust

Installation

bash init_env.sh

Run

./test.sh <path/to/file.py> # compile and run
./test.sh <path/to/file.py> --bytecode # print the bytecode in JSON
./test.sh <path/to/file.py> --dis # Run python -m dis

Manual

Given a python file test.py

python compile_code.py test.py > test.bytecode

cd RustPython
cargo run ../test.bytecode 

Testing & debugging

./test_all.sh # Run all tests under tests/
  • If a test is expected to fail or raise exception, add xfail_* prefix to the filename.

Logging

RUST_LOG=debug ./tests_all.sh

TODOs

  • Native types => Partial
  • Control flow => if(v)
  • assert => OK
  • Structural types (list, tuple, object)
  • Strings
  • Function calls => Blocked by bytecode serializer
  • Modules import
  • Generators

Goals

  • Support all builtin functions

  • Runs the pybenchmark benchmark test

  • Run famous/popular python modules (which?)

  • Compatible with CPython 3.6

Rust version

rustc 1.20.0-nightly

rustpython's People

Contributors

shinglyu avatar wangyu190810 avatar 0x326 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.