Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.04 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.04 KB

rust-wasm-python-101

A basic example of calling Rust from Python used as example in the blogposts:

Setup

Ensure that you have both Rust and Python3 installed.

Update to the latest version of Rust

rustup update

Add the Wasm target:

rustup target add wasm32-unknown-unknown

Install Rust dependencies:

cargo build --release --target wasm32-unknown-unknown

Install wasmer for Python:

python3.6 -m pip install wasmer
# Or, on some systems:
pip3 install wasmer

Run it!

cd pywasm
python3 run_wasm_with_python.py
python3 run_flask_bench.py

If everything is working correctly, you should see output that take timing of the functions run using python-ext-wasm and pure Python.