As WebAssembly support has been developed by the Swift community and significantly improved over the years, I would like to put up a pitch for a vision describing WebAssembly support in Swift. Your feedback would be highly appreciated! Full vision text is included below, while the corresponding PR is also available on GitHub. Introduction WebAssembly (abbreviated Wasm) is a virtual machine instruction set focused on portability, security, and high performance. It is vendor-neutral, designed and developed by W3C. An implementation of a WebAssembly virtual machine is usually called a WebAssembly runtime. One prominent spec-compliant implementation of a Wasm runtime in Swift is WasmKit. It is available as a Swift package, supports multiple host platforms, and has a simple API for interaction with guest Wasm modules. An application compiled to a Wasm module can run on any platform that has a Wasm runtime available. Despite its origins in the browser, it is a general-purpose technology that has use cases in client-side and server-side applications and services. WebAssembly support in Swift makes the language more appealing in those settings, and also brings it to the browser where it previously wasn't available at all. It facilitates a broader adoption of Swift in more environments and contexts. The WebAssembly instruction set has useful properties from a security perspective, as it has no interrupts or peripheral access instructions. Access to the underlying system is always done by calling explicitly imported functions, implementations for which are provided by an imported WebAssembly module or a WebAssembly runtime itself. The runtime has full control over interactions of the virtual machine with the outside world. WebAssembly code and data live in completely separate address spaces, with all executable code in a given module loaded and validated by the runtime upfront. Combined with the lack of "jump to address" and a limited set of control flow instructions that req...
First seen: 2025-04-05 15:08
Last seen: 2025-04-06 17:15