diff --git a/README.md b/README.md index 8a45c2425..2f528377b 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,16 @@ A Python Interpreter written in Rust :snake: :scream: :metal:. [![Build Status](https://travis-ci.org/RustPython/RustPython.svg?branch=master)](https://travis-ci.org/RustPython/RustPython) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -# Usage (Not implemented yet) +# Usage To test RustPython, do the following: $ git clone https://github.com/RustPython/RustPython $ cd RustPython $ cargo run demo.py - 42 + Hello, RustPython! Or use the interactive shell: @@ -19,9 +20,9 @@ Or use the interactive shell: >>>>> 2+2 4 -Or use pip to install extra modules: + # Goals @@ -30,12 +31,12 @@ Or use pip to install extra modules: # Code organization - - `parser`: python lexing, parsing and ast - - `vm`: python virtual machine - - `src`: using the other subcrates to bring rustpython to life. - - `docs`: documentation (work in progress) - - `py_code_object`: CPython bytecode to rustpython bytecode convertor (work in progress) - - `tests`: integration test snippets +- `parser`: python lexing, parsing and ast +- `vm`: python virtual machine +- `src`: using the other subcrates to bring rustpython to life. +- `docs`: documentation (work in progress) +- `py_code_object`: CPython bytecode to rustpython bytecode convertor (work in progress) +- `tests`: integration test snippets # Community diff --git a/demo.py b/demo.py index e7e089613..2ea6ef9e6 100644 --- a/demo.py +++ b/demo.py @@ -1,2 +1,2 @@ -print(42) +print("Hello, RustPython!") diff --git a/demo2.py b/demo2.py deleted file mode 100644 index 816fea865..000000000 --- a/demo2.py +++ /dev/null @@ -1 +0,0 @@ -print(2 + 3) diff --git a/demo99.py b/demo_closures.py similarity index 100% rename from demo99.py rename to demo_closures.py diff --git a/vm/README.md b/vm/README.md deleted file mode 100644 index 34bbf14b5..000000000 --- a/vm/README.md +++ /dev/null @@ -1,64 +0,0 @@ -RustPython -============== - -A Python interpreter written in Rust - -# Installation - -``` -bash init_env.sh -``` - -# Run - -``` -./test.sh # compile and run -./test.sh --bytecode # print the bytecode in JSON -./test.sh --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](https://pybenchmarks.org/) benchmark test -* Run famous/popular python modules (which?) - -* Compatible with CPython 3.6 - -# Rust version -rustc 1.20.0-nightly -