Call Rust code from Python (WASM and PythonMonkey)

Published: 24 July 2023
on channel: Will Pringle
601
15

Use PythonMonkey to load WebAssembly modules from Rust into Python and execute Rust functions from a Rust library.

Follow along with this GitHub repository:
https://github.com/Distributive-Netwo...

View the medium post for this video
  / executing-rust-in-python-using-webassembly  

This tutorial covers
Compiling a Rust library to WebAssembly using wasm-bindgen and wasm-pack
Executing WASM code from Python

If you're interested in PythonMonkey or WebAssembly check these out
PythonMonkey Documentation: https://docs.pythonmonkey.io/
Checkout PythonMonkey here: https://pythonmonkey.io/
Calling C WASM from Python    • How to execute C from Python (Using WebAss...  

Test PythonMonkey on Google Colab:
https://colab.research.google.com/dri...

0:00 Intro & Overview
0:14 PythonMonkey
0:57 Installing Rust and Python
2:33 Writing a sample Rust Library
5:28 Rewriting nodejs in Python (temporary)
9:03 Calling Rust from Python
9:50 Fixing an error
10:33 Compiling with ./build.sh
11:30 Adding a function to our rust library
13:37 Conclusion


On this page of the site you can watch the video online Call Rust code from Python (WASM and PythonMonkey) with a duration of hours minute second in good quality, which was uploaded by the user Will Pringle 24 July 2023, share the link with friends and acquaintances, this video has already been watched 601 times on youtube and it was liked by 15 viewers. Enjoy your viewing!