From c9fdc68937bd2ddabcf1cfb6200b835cd5192ed4 Mon Sep 17 00:00:00 2001 From: rmliddle Date: Sun, 23 Sep 2018 16:25:48 +1000 Subject: [PATCH 1/3] readme and example change --- README.md | 20 +++++------ demo.py | 2 +- demo2.py | 1 - demo99.py => demo_closures.py | 0 vm/README.md | 64 ----------------------------------- 5 files changed, 11 insertions(+), 76 deletions(-) delete mode 100644 demo2.py rename demo99.py => demo_closures.py (100%) delete mode 100644 vm/README.md diff --git a/README.md b/README.md index 8a45c2425..419c0a370 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ 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) -# 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 +19,9 @@ Or use the interactive shell: >>>>> 2+2 4 -Or use pip to install extra modules: + # Goals @@ -30,12 +30,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 - From 4035f4da1619ab0fe611ad61f3ddd91b87e1561a Mon Sep 17 00:00:00 2001 From: rmliddle Date: Sun, 23 Sep 2018 16:31:36 +1000 Subject: [PATCH 2/3] highlighting on code org --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 419c0a370..e1b158561 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,12 @@ Or use the interactive shell: # 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 From 0f4aeeb4cf85cdc50947b1d0fb8e3cca1779a6f4 Mon Sep 17 00:00:00 2001 From: rmliddle Date: Sun, 23 Sep 2018 16:38:26 +1000 Subject: [PATCH 3/3] Added license badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e1b158561..2f528377b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ 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