Skip to content

Mec-iS/rust-wasm-python-101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A basic example of calling Rust from Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published