Skip to content

Commit 595c4f5

Browse files
authored
README.md: Clarify Swift version and SwiftPM instructions (#203)
Added new SwiftPM CLI commands for adding dependencies. List of supported platforms was updated to include the broader support matrix. While some of these newly mentioned Linux distributions aren't directly tested by WasmKit CI, they are tested indirectly on ci.swift.org, as all Swift toolchain Linux jobs build WasmKit as a dependency. Assorted wording refinements and helpful links for beginners are also included.
1 parent 1e1c7ea commit 595c4f5

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
# WasmKit
44

5-
**WasmKit** is a standalone and embeddable WebAssembly runtime implementation written in Swift.
5+
**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.
66

77
## Usage
88

9-
The best way to learn how to use WasmKit is to look at the [Examples](./Examples) directory.
9+
You can find introductory examples and API documentation on the [Swift Package Index documentation page](https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit).
1010

1111
### Command Line Tool
1212

13-
WasmKit provides a command line tool to run WebAssembly binaries compliant with WASI.
13+
WasmKit provides a command line tool to run WebAssembly binaries compatible with [WASI](https://wasi.dev).
1414

1515
```sh
1616
$ git clone https://github.com/swiftwasm/WasmKit.git
@@ -23,16 +23,32 @@ Hello, World!
2323

2424
#### Swift Package Manager
2525

26-
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:
26+
To use WasmKit in your package, add it as a [Swift Package Manager](https://www.swift.org/documentation/package-manager/) dependency.
27+
28+
Run the following commands in the same directory as your `Package.swift` manifest to add the dependency:
29+
30+
```
31+
swift package add-dependency https://github.com/swiftwasm/WasmKit --up-to-next-minor-from 0.1.6
32+
swift package add-target-dependency WasmKit <your-package-target-name> --package WasmKit
33+
```
34+
35+
You can also add the following snippet manually instead to your `Package.swift` file:
2736

2837
```swift
2938
dependencies: [
30-
.package(url: "https://github.com/swiftwasm/WasmKit.git", from: "0.1.0"),
39+
// ...other dependencies
40+
.package(url: "https://github.com/swiftwasm/WasmKit.git", .upToNextMinor(from: "0.1.6")),
3141
],
42+
// ...other package configuration
43+
targets: [
44+
// ...other targets
45+
.target(
46+
name: "<your-package-target-name>",
47+
dependencies: [.product(name: "WasmKit", package: "WasmKit")],
48+
)
49+
]
3250
```
3351

34-
You can find API documentation on the [Swift Package Index](https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit).
35-
3652
## Features
3753

3854
- [Reasonably fast](./Documentation/RegisterMachine.md#performance-evaluation)
@@ -42,16 +58,17 @@ You can find API documentation on the [Swift Package Index](https://swiftpackage
4258
- Compact and embeddable
4359
- Debug build complete in 5 seconds[^1]
4460
- Batteries included
45-
- WASI support, WAT parser, etc.
61+
- WASI support, WAT (WebAssembly text format) parser/assembler, etc.
4662

4763

4864
## Supported Platforms
4965

50-
WasmKit engine works on all major platforms supported by Swift. It is continuously tested on macOS, Ubuntu, and Windows,
66+
WasmKit engine works on all major platforms supported by Swift. It is continuously tested on macOS, Ubuntu, Amazon Linux 2, Android, and Windows,
5167
and should work on the following platforms:
5268

5369
- macOS 10.13+, iOS 12.0+, tvOS 12.0+, watchOS 6.0+
54-
- Ubuntu 20.04+
70+
- Amazon Linux 2, Debian 12, Ubuntu 22.04+, Fedora 39+
71+
- Android [API Level 30](https://developer.android.com/tools/releases/platforms)
5572
- Windows 10+
5673

5774
## Implementation Status
@@ -70,12 +87,12 @@ and should work on the following platforms:
7087
| | [Memory64](https://github.com/WebAssembly/memory64/blob/main/proposals/memory64/Overview.md) | ✅ Implemented |
7188
| | [Tail call](https://github.com/WebAssembly/tail-call/blob/master/proposals/tail-call/Overview.md) | ✅ Implemented |
7289
| | [Threads and atomics](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md) | 🚧 Parser implemented |
73-
| WASI | WASI Preview 1 | ✅ Implemented |
90+
| WASI | WASI Preview 1 | 🚧 [Majority of syscalls implemented](https://github.com/swiftwasm/WasmKit/blob/d9b56a7b3f979a72682c0d37f6cc71b3493dae65/Tests/WASITests/IntegrationTests.swift#L31) |
7491

7592

7693
## Minimum Supported Swift Version
7794

78-
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/).
95+
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/).
7996

8097
## Testing
8198

0 commit comments

Comments
 (0)