Open migueldeicaza opened 6 months ago
There are a few updates shared on Slack.
There is some discussion on how this got started using --triple wasm32-unknown-none-wasm
and https://github.com/apple/swift-for-wasm-examples
Talk on Swift for WASM that might be relevant: https://youtu.be/cX5pITN0uFM?si=G7yNZL-HCP5WPbcJ
This comment might be a correction over our previous assumptions:
swift doesn’t use the WASI api if you don’t ask it to. You can specify either --triple wasm32-unknown-none-wasm which works with emscripten ( I have linked these and ran them with a godot game ), or you can target the WASI api with the wasi triple
We would like to make it so that developers that want to use SwiftGodot can target Wasm, a popular platform for Godot to be deployed to.
This issue is intended to keep track of the various findings, it will be edited as we find out more information, so this text will change.
Here is roughly where we stand right now:
While SwiftWASM only supports the executable target, it seems that in the Wasm world, even regular executables can be treated as libraries, so we would need to figure out a way of stitching those together. One possible problem with this approach is that currently we might assume that the extension and Godot share the same memory address space so this could be a problem.
Things that we could also consider:
Discussion links
Initial discussion on using SwiftWasm for Godot: https://discord.com/channels/780838335798706197/802944960881098752/1208500336671854662
Recent discussion:
https://discord.com/channels/780838335798706197/790246707648135229/1225627478471610398
Resoures
Setting up Swift for WASM: https://book.swiftwasm.org/getting-started/setup.html
SwiftGodot without Macros dependency, useful to prototype, courtesy of @PadraigK: https://github.com/PadraigK/SwiftGodotLite/tree/main