BrandonDyer64 / bevy_wasm

Mod Bevy games with WASM
Apache License 2.0
94 stars 4 forks source link

`println!` and `panic!` support #2

Open BrandonDyer64 opened 1 year ago

BrandonDyer64 commented 1 year ago

Currently, mods made using target wasm32-unknown-unknown cannot call println!. We could use wasm32-wasi instead, but this drastically increases binary size.

Perhaps some kind of #![no_std] support could be added, or a trick for making wasi binaries smaller.

togetherwithasteria commented 1 year ago

Currently, mods made using target wasm32-unknown-unknown cannot call println!. We could use wasm32-wasi instead, but this drastically increases binary size.

Perhaps some kind of #![no_std] support could be added, or a trick for making wasi binaries smaller.

Hiii!

Yes, I think we could make a simple stream API (something that for the client side interface/mod interface implements Write trait) and reimplement println!() and print!()

Then on the host the user could log them to something like bevy-console or stdout instead!