You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TinyWasmModule::from_twasm portable across architectures? #31
That isn't a supported use case? I am not sure where the issue lies, as far I understand rkyv should be stable across architectures (https://rkyv.org/format.html)?
If that isn't supported by rkyv maybe using postcard as an alternative format would work too?
By itself when not having to include tinywasm::parser::Parser my program is like ~15kB with is freaking amazing, but having to include the parser blows it up to like 350kB :/
Just did a quick test adding serde to all TinyWasmModule types, used postcard on my pc to save that struct to a pwasm file, loaded it into stm32, deseralized with postcard and it did work 🤔!
The final binary for my program ended up with ~147kB right now with is much better the using Parser. And interesting the pwasm file is even smaller then wat:
I think I've had similar issues when the twasm bytes weren't aligned to 4 bytes. I've changed it to show the actual rkyv error now, but I've been thinking of switching to something else anyways (rkyv has some weird limitations around enum sizes and some other things...) and postcard looks pretty nice
I am fine with making a PR for that, do you prefer having postcard directly in tinywasm-types or just limit to serde (with is what I did currently and used postcard outside it)?
If you already have some code that would be great 👍 I'd love to do some rough performance benchmarking before committing to the switch though. Probably would keep the API in tinywasm types the same.
Activity
dragonnn commentedon Jan 16, 2025
Just did a quick test adding serde to all TinyWasmModule types, used postcard on my pc to save that struct to a pwasm file, loaded it into stm32, deseralized with postcard and it did work 🤔!
The final binary for my program ended up with ~147kB right now with is much better the using Parser. And interesting the pwasm file is even smaller then wat:
That looks like a pretty viable option to me!
explodingcamera commentedon Jan 16, 2025
I think I've had similar issues when the twasm bytes weren't aligned to 4 bytes. I've changed it to show the actual rkyv error now, but I've been thinking of switching to something else anyways (rkyv has some weird limitations around enum sizes and some other things...) and postcard looks pretty nice
dragonnn commentedon Jan 16, 2025
I am fine with making a PR for that, do you prefer having postcard directly in tinywasm-types or just limit to serde (with is what I did currently and used postcard outside it)?
explodingcamera commentedon Jan 17, 2025
If you already have some code that would be great 👍 I'd love to do some rough performance benchmarking before committing to the switch though. Probably would keep the API in tinywasm types the same.
feat: use postcard for new twasm format