From e3eed8acd748eb1eba2d50321cc0caf941912c11 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Thu, 1 Oct 2020 14:00:21 -0500 Subject: [PATCH] Update README and powershell script to improve onboarding --- README.md | 38 ++++++++++--------------------- scripts/symlinks-to-hardlinks.ps1 | 3 +++ 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index cd743819c..cf2a9484e 100644 --- a/README.md +++ b/README.md @@ -24,18 +24,19 @@ RustPython requires Rust latest stable version (e.g 1.43.0 at May 24th 2020). To check Rust version: `rustc --version` If you wish to update, `rustup update stable`. -To test RustPython, do the following: +To build RustPython locally, do the following: $ git clone https://github.com/RustPython/RustPython $ cd RustPython - # if you're on windows: + # if you're on windows: $ powershell scripts\symlinks-to-hardlinks.ps1 - $ cargo run demo.py + # --release is needed (at least on windows) to prevent stack overflow + $ cargo run --release demo.py Hello, RustPython! Or use the interactive shell: - $ cargo run + $ cargo run --release Welcome to rustpython >>>>> 2+2 4 @@ -74,7 +75,7 @@ cargo build --release --target wasm32-wasi --features="freeze-stdlib" > Note: we use the `freeze-stdlib` to include the standard library inside the binary. -### JIT(Just in time) compiler +### JIT (Just in time) compiler RustPython has an **very** experimental JIT compiler that compile python functions into native code. @@ -107,12 +108,11 @@ Then `examples/hello_embed.rs` and `examples/mini_repl.rs` may be of some assist ## Disclaimer -RustPython is in a development phase and should not be used in production or a -fault intolerant setting. +RustPython is in development, and while the interpreter certainly can be used +in interesting use cases like running Python in WASM and embedding into a Rust +project, do note that RustPython is not totally production-ready. -Our current build supports only a subset of Python syntax. - -Contribution is also more than welcome! See our contribution section for more +Contribution is more than welcome! See our contribution section for more information on this. ## Conference videos @@ -124,7 +124,8 @@ Checkout those talks on conferences: ## Use cases -Allthough rustpython is a very young project, it is already used in the wild: +Although RustPython is a fairly young project, a few people have used it to +make cool projects: - [pyckitup](https://github.com/pickitup247/pyckitup): a game engine written in rust. @@ -174,21 +175,6 @@ methods are often the simplest and easiest way to contribute. You can also simply run `./whats_left.sh` to assist in finding any unimplemented method. -## Using a different standard library - -As of now the standard library is under construction. You can change a standard -library by setting the RUSTPYTHONPATH environment variable. - -To do this, follow this method: - -```shell -$ export RUSTPYTHONPATH=./Lib # this is same as the default value -$ cargo run -- -c 'import xdrlib' -``` - -You can play around with other standard libraries for python. For example, the -[ouroboros library](https://github.com/pybee/ouroboros) or CPython Lib. - ## Compiling to WebAssembly [See this doc](wasm/README.md) diff --git a/scripts/symlinks-to-hardlinks.ps1 b/scripts/symlinks-to-hardlinks.ps1 index 77ffe0d61..9ec79de4e 100644 --- a/scripts/symlinks-to-hardlinks.ps1 +++ b/scripts/symlinks-to-hardlinks.ps1 @@ -1,4 +1,7 @@ #!/usr/bin/env powershell + +Set-Location -Path $(Split-Path -Parent $PSScriptRoot) + git ls-files -s | Select-String '^120000' | ConvertFrom-String -PropertyNames Get-Content,Hash,_,Path | ForEach-Object { $symlink = $_.Path