-
Notifications
You must be signed in to change notification settings - Fork 92
Description
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:
- Godot seems to use the Emscripten ABI
- Swift/Wasm seems to use the WASI API, and these are different
- We use a lot of Macros, and SwiftWasm does not currently support it, but there is a patch coming soon Support macros when cross-compiling swiftlang/swift-package-manager#7118
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:
- Compiling Godot as a library
- Have our build system link Godot with the SwiftGodot target, like SwiftGodotKit in a way.
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