SwiftͰΓ͍ͨ͜ͱ
Run Swift anywhere
• WebϒϥβͰಈ͘Swift
• AndroidͰಈ͘Swift
• ΫϥυϓϥοτϑΥʔϜͰಈ͘Swift
• SwiftͰॻ͚ΔϢʔβϓϥάΠϯ (e.g. VSCode Extension)
6
Slide 7
Slide 7 text
WebAssembly is a game changer
A binary instruction format for a stack-based machine
Designed to be
• Portable
• Size- and Load-time efficient
• Secure by Sandbox
7
Upstreaming patches
• 44 patches for apple/swift
• 16 patches for apple/swift-corelibs-foundation
• 14 patches for apple/swift-package-manager
• 4 patches for LLVM
They are made by only 2 people!
36
Slide 37
Slide 37 text
Swift Concurrency on Wasm
JavaScriptKit provides a global executor implementation based on
JS event-loop
import JavaScriptEventLoop
import JavaScriptKit
JavaScriptEventLoop.installGlobalExecutor()
func printZen() async throws {
let fetch = JSObject.global.fetch.function!
let response = try await JSPromise(fetch("https://api.github.com/zen").object!)!.value
let text = try await JSPromise(response.text().object!)!.value
print(text)
}
37