Skip to content

Commit

Permalink
Re-organize README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Jul 1, 2024
1 parent d30a1de commit 663fcfa
Showing 1 changed file with 39 additions and 10 deletions.
49 changes: 39 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
<img alt="WAKit Icon" src="https://raw.github.com/wiki/akkyie/wakit/images/wakit_icon.png" width="100px">
<img alt="WasmKit Icon" src="https://raw.github.com/wiki/akkyie/wakit/images/wakit_icon.png" width="100px">

# WasmKit

A WebAssembly runtime written in Swift. Originally developed and maintained by [@akkyie](https://github.com/akkyie).

Implements all of WebAssembly 2.0 binary parsing and execution core spec, with an exclusion of SIMD instructions. The validation and text format parts of the spec are not implemented yet.

It also has rudimentary support for [WASI](https://wasi.dev) with only a few WASI imports implemented currently, with a goal of eventual full support for `wasi_snapshot_preview1`. See `WASI` module for more details.
**WasmKit** is a standalone WebAssembly runtime written in Swift.

## Usage

### Command Line Tool

WasmKit provides a command line tool to run WebAssembly binaries compliant with WASI.

```sh
$ # Usage: wasmkit-cli run <path> <functionName> [<arguments>] ...
$ swift run wasmkit-cli run Examples/wasm/fib.wasm fib i32:10
[I32(89)]
$ git clone https://github.com/swiftwasm/WasmKit.git
$ cd WasmKit
$ swift run wasmkit-cli run ./Examples/hello.wasm
Hello, World!
```

### As a Library

#### Swift Package Manager

Add the URL of this repository to your `Package.swift` manifest. Then add the `WasmKit` library product as dependency to the target you'd like to use it with.
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:

```swift
dependencies: [
.package(url: "https://github.com/swiftwasm/WasmKit.git", from: "0.0.5"),
],
```

You can find API documentation on the [Swift Package Index](https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit).


## Implementation Status

| Category | Feature | Status |
|----------|---------|--------|
| WebAssembly MVP | Parsing binary format | ✅ Implemented |
| | Parsing text format (WAT) | ❌ Not implemented |
| | Execution | ✅ Implemented |
| | Validation | 🚧 Partially implemented |
| WebAssembly Proposal | [Reference types](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md) | ✅ Implemented |
| | [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md) | ✅ Implemented |
| | [Mutable globals](https://github.com/WebAssembly/mutable-global/blob/master/proposals/mutable-global/Overview.md) | ✅ Implemented |
| | [Sign-extension operators](https://github.com/WebAssembly/spec/blob/master/proposals/sign-extension-ops/Overview.md) | ✅ Implemented |
| | [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/main/proposals/nontrapping-float-to-int-conversion/Overview.md) | ✅ Implemented |
| WASI | WASI Preview 1 | ✅ Implemented |


## Testing

Expand All @@ -41,3 +65,8 @@ $ python3 -m pip install -r ./Vendor/wasi-testsuite/test-runner/requirements.txt
# Run WASI spec tests
$ make wasitest
```


## Acknowledgement

This project is originally developed by [@akkyie](https://github.com/akkyie), and now maintained by the community.

0 comments on commit 663fcfa

Please sign in to comment.