From 39e3f8faff6906166006499b398e0c7f2e377d9f Mon Sep 17 00:00:00 2001 From: Jeong Yunwon Date: Sun, 8 May 2022 15:23:29 +0900 Subject: [PATCH] Add document for wasi --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 2175389d6..1b10986ae 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,17 @@ this isn't officially supported and may be out of date: You can compile RustPython to a standalone WebAssembly WASI module so it can run anywhere. +Build +```shell +$ cargo build --target wasm32-wasi --no-default-features --features freeze-stdlib,stdlib --release +``` + +Run by wasmer +```shell +$ wasmer run --dir . target/wasm32-wasi/release/rustpython.wasm extra_tests/snippets/stdlib_random.py +``` + +Run by wapm ```shell $ wapm install rustpython $ wapm run rustpython