For Python, we implement a multiply function. The multiply function multiplies two floats and returns a float result. It also logs the multiplication operation.
Install the latest version of Python. Python 3.10 is the minimum required version for componentize-py
.
Activate a virtual environment using the method of your choosing and install the dependencies:
pip install -r requirements.txt
Build using componentize-py
:
componentize-py -d ../wit -w multiplication componentize app -o output/multiply.wasm
The -d
option is the directory with our WIT definitions and -w
is the multiplication
world we are building.
The componentize
operation targets app.py
and outputs a Wasm component to the output
directory.