Earlier quoted context omitted.
There exists tooling already to compile for wasm from static languages (rust, C++, and so on) and there exists tooling to run this WASM on a raspberry pi (wasmer, etc). That makes me feel the end goal here is not what's described ("make wasm so it can run on a raspberry"), but rather "make wasm run in micropython". Am I missing something?
Yes, we're talking about Raspberry Pi Pico (RP2040) here. Not the Linux-based SBCs (Single Board Computers)
Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
31–40 of 41 posts
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#32Earlier quoted context omitted.
Yes, we're talking about Raspberry Pi Pico (RP2040) here. Not the Linux-based SBCs (Single Board Computers)
Curious if you've seen the WAMR runtime which is explicitly designed to be lightweight enough for freestanding embedded systems on some higher end microcontrollers (Cortex-M4F).
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#33Author here, ready to answer any questions.
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#34Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#35Earlier quoted context omitted.
Actually in my case I need a VM, because I want users to be able to upload "extension plugins" in real-time, without reuploading firmware In that case which approach / library would you recommend to embedd a WASM VM?
This is exactly what wasm2mpy does for MicroPython: Dynamically loaded, AOT-compiled WASM modules
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#36Earlier quoted context omitted.
Actually in my case I need a VM, because I want users to be able to upload "extension plugins" in real-time, without reuploading firmware In that case which approach / library would you recommend to embedd a WASM VM?
This is exactly what wasm2mpy does for MicroPython: Dynamically loaded, AOT-compiled WASM modules
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#37Earlier quoted context omitted.
There exists tooling already to compile for wasm from static languages (rust, C++, and so on) and there exists tooling to run this WASM on a raspberry pi (wasmer, etc). That makes me feel the end goal here is not what's described ("make wasm so it can run on a raspberry"), but rather "make wasm run in micropython". Am I missing something?
Yes, we're talking about Raspberry Pi Pico (RP2040) here. Not the Linux-based SBCs (Single Board Computers)
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#38Earlier quoted context omitted.
This is exactly what wasm2mpy does for MicroPython: Dynamically loaded, AOT-compiled WASM modules
would you say that using wasm2mpy is better suited for my needs than having a wasm runtime like the one of bytecodealliance? What would be the advantage in this case?
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#39Earlier quoted context omitted.
tools/mpy_ld.py: https://github.com/micropython/micropython/blob/master/tools... tools/mpy-tool.py lists opcodes: https://github.com/micropython/micropython/blob/master/tools... Can the same be done with .pyc files; what are the advantages of MicroPython native modules? Why does it need wasm2c?
I don't think .pyc files can contain native code, but .mpy can! And that's exactly what I'm using here: - compile any language to wasm - translate wasm to C99 - use the native target toolchain to compile C99 to .mpy - run that on the device
But that doesn't solve for WASM on a MicroPython device.
And that is why smart contracts without costed opcodes could not be built on Python.
Re: Wasm2Mpy: Compiling WASM to MicroPython so it can run on Raspberrys
#40Earlier quoted context omitted.
would you say that using wasm2mpy is better suited for my needs than having a wasm runtime like the one of bytecodealliance? What would be the advantage in this case?
Yes, for these microcontroller-type chips, ahead-of-time compilation would be definitely more suitable. WAMR probably supports it, but you can also to it via WASM2C, easily. I prefer not depending on WAMR, it is very bloated