-
Notifications
You must be signed in to change notification settings - Fork 2.4k
A Vision for WebAssembly Support in Swift #2590
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
Co-authored-by: Ben Barham <b.n.barham@gmail.com>
Co-authored-by: Alex Hoppen <alex@ateamer.de>
Co-authored-by: Alex Hoppen <alex@ateamer.de>
Co-authored-by: Hamish Knight <hamish_github@mediocremail.com>
Co-authored-by: Alastair Houghton <ahoughton@apple.com>
Preliminary support for WIT has been implemented in | ||
[the `wit-tool` subcommand](https://github.com/swiftwasm/WasmKit/blob/0.0.3/Sources/WITTool/WITTool.swift) of the | ||
WasmKit CLI. Users of this tool can generate `.wit` files from Swift declarations, and vice versa: Swift bindings from | ||
`.wit` files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great introduction, thanks @MaxDesiatov
(2) The new [shared-everything-threads](https://github.com/WebAssembly/shared-everything-threads) proposal is still | ||
in the early stages, but is expected to be the future of multi-threading in Wasm. | ||
|
||
Swift currently supports two threading models in Wasm: single-threaded (`wasm32-unknown-wasi`) and multi-threaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aside: should we consider changing the wasm triple to match other languages? (specifically rust's changes here would also make sense for swift https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was partially done by @kateinoigakukun, at least for the threads triple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. "Officialization" would be a good opportunity to rename the target name.
Co-authored-by: Danielle <dani@builds.terrible.systems>
cooperation from the WebAssembly toolchain side or different memory layout in Swift metadata to support 64-bit linear | ||
memory support in WebAssembly. | ||
|
||
### Shared libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few of us recently hashed out a design for supporting a more dynamic approach to shared libraries in the component model. Based on that sketch, I think it's reasonable to assume that we'll have something similarly expressive as traditional dlopen
for shared libraries in the component model.
No description provided.