News for hackers. Stuff that matters.
Re:Wasm2Mpy: Compiling WASM to MicroPython so it can run on ... by jononor on Tuesday September 24, 2024 @06:05PM (#41641462)
.mpy modules can contain MicroPython bytecode and/or native machine code. In this case, WASM is compiled (via C) to native code. So the performance is very good, much better than interpreting either MicroPython bytecode or WASM bytecode.

The conventional way of creating native modules for MicroPython is to write them in C. This work allows to use any language that supports WASM output target.

Re:Wasm2Mpy: Compiling WASM to MicroPython so it can run on ... by 01HNNWZ0MV43FF on Tuesday September 24, 2024 @06:47PM (#41641794)
Oh, I didn't know MicroPython was fully AOT. I'm surprised, since vanilla Python is typically interpreted with maybe a bytecode cache, right?
Re:Wasm2Mpy: Compiling WASM to MicroPython so it can run on ... by dbcurtis on Tuesday September 24, 2024 @08:32PM (#41642442)
It isn’t fully AOT, but support for AOT modules is excellent.
Re:Wasm2Mpy: Compiling WASM to MicroPython so it can run on ... by zorgmonkey on Wednesday September 25, 2024 @01:35AM (#41643994)
Thanks for the explanation this project makes so much more sense now. If people want a little more detail, they have a brief how it works section in readme https://github.com/vshymanskyy/wasm2mpy?tab=readme-ov-file#h...