Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Vision for WebAssembly Support in Swift #2590

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

MaxDesiatov
Copy link
Contributor

No description provided.

@MaxDesiatov MaxDesiatov marked this pull request as draft October 16, 2024 11:40
@MaxDesiatov MaxDesiatov marked this pull request as ready for review October 21, 2024 16:43
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.
Copy link
Member

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

visions/webassembly.md Outdated Show resolved Hide resolved
visions/webassembly.md Outdated Show resolved Hide resolved
visions/webassembly.md Outdated Show resolved Hide resolved
(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
Copy link
Member

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)

Copy link
Contributor Author

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.

Copy link
Member

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

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.

@rjmccall rjmccall added vision Prospective vision document PSG Contains topics under the domain of the Platform Steering Group labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PSG Contains topics under the domain of the Platform Steering Group vision Prospective vision document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants