diff --git a/README.md b/README.md index 82ee24f5..b8f78b60 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ # WasmKit -**WasmKit** is a standalone and embeddable WebAssembly runtime implementation written in Swift. +**WasmKit** is a standalone and embeddable [WebAssembly](https://webassembly.org) runtime (virtual machine) implementation and related tooling written in Swift. Starting with Swift 6.2, WasmKit CLI executable is included in [Swift toolchains distributed at swift.org](https://swift.org/install) for Linux and macOS. ## Usage -The best way to learn how to use WasmKit is to look at the [Examples](./Examples) directory. +You can find introductory examples and API documentation on the [Swift Package Index documentation page](https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit). ### Command Line Tool -WasmKit provides a command line tool to run WebAssembly binaries compliant with WASI. +WasmKit provides a command line tool to run WebAssembly binaries compatible with [WASI](https://wasi.dev). ```sh $ git clone https://github.com/swiftwasm/WasmKit.git @@ -23,16 +23,32 @@ Hello, World! #### Swift Package Manager -You can use WasmKit as a [Swift Package Manager](https://www.swift.org/documentation/package-manager/) dependency by adding the following to your `Package.swift` file: +To use WasmKit in your package, add it as a [Swift Package Manager](https://www.swift.org/documentation/package-manager/) dependency. + +Run the following commands in the same directory as your `Package.swift` manifest to add the dependency: + +``` +swift package add-dependency https://github.com/swiftwasm/WasmKit --up-to-next-minor-from 0.1.6 +swift package add-target-dependency WasmKit --package WasmKit +``` + +You can also add the following snippet manually instead to your `Package.swift` file: ```swift dependencies: [ - .package(url: "https://github.com/swiftwasm/WasmKit.git", from: "0.1.0"), + // ...other dependencies + .package(url: "https://github.com/swiftwasm/WasmKit.git", .upToNextMinor(from: "0.1.6")), ], +// ...other package configuration +targets: [ + // ...other targets + .target( + name: "", + dependencies: [.product(name: "WasmKit", package: "WasmKit")], + ) +] ``` -You can find API documentation on the [Swift Package Index](https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit). - ## Features - [Reasonably fast](./Documentation/RegisterMachine.md#performance-evaluation) @@ -42,16 +58,17 @@ You can find API documentation on the [Swift Package Index](https://swiftpackage - Compact and embeddable - Debug build complete in 5 seconds[^1] - Batteries included - - WASI support, WAT parser, etc. + - WASI support, WAT (WebAssembly text format) parser/assembler, etc. ## Supported Platforms -WasmKit engine works on all major platforms supported by Swift. It is continuously tested on macOS, Ubuntu, and Windows, +WasmKit engine works on all major platforms supported by Swift. It is continuously tested on macOS, Ubuntu, Amazon Linux 2, Android, and Windows, and should work on the following platforms: - macOS 10.13+, iOS 12.0+, tvOS 12.0+, watchOS 6.0+ -- Ubuntu 20.04+ +- Amazon Linux 2, Debian 12, Ubuntu 22.04+, Fedora 39+ +- Android [API Level 30](https://developer.android.com/tools/releases/platforms) - Windows 10+ ## Implementation Status @@ -70,12 +87,12 @@ and should work on the following platforms: | | [Memory64](https://github.com/WebAssembly/memory64/blob/main/proposals/memory64/Overview.md) | ✅ Implemented | | | [Tail call](https://github.com/WebAssembly/tail-call/blob/master/proposals/tail-call/Overview.md) | ✅ Implemented | | | [Threads and atomics](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md) | 🚧 Parser implemented | -| WASI | WASI Preview 1 | ✅ Implemented | +| WASI | WASI Preview 1 | 🚧 [Majority of syscalls implemented](https://github.com/swiftwasm/WasmKit/blob/d9b56a7b3f979a72682c0d37f6cc71b3493dae65/Tests/WASITests/IntegrationTests.swift#L31) | ## Minimum Supported Swift Version -The minimum supported Swift version of WasmKit is 5.8, which is the version used to bootstrap the Swift toolchain in [ci.swift.org](https://ci.swift.org/). +The minimum supported version is Swift 6.0, which is the version used to bootstrap the Swift toolchain on [ci.swift.org](https://ci.swift.org/). ## Testing