Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swiftwasm/WasmKit
WebAssembly Runtime written in Swift
https://github.com/swiftwasm/WasmKit
swift swiftwasm webassembly webassembly-runtime
Last synced: 7 days ago
JSON representation
WebAssembly Runtime written in Swift
- Host: GitHub
- URL: https://github.com/swiftwasm/WasmKit
- Owner: swiftwasm
- License: mit
- Created: 2017-07-20T15:57:49.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-04-07T16:06:26.000Z (3 months ago)
- Last Synced: 2024-04-13T10:08:11.651Z (3 months ago)
- Topics: swift, swiftwasm, webassembly, webassembly-runtime
- Language: Swift
- Homepage: https://swiftpackageindex.com/swiftwasm/WasmKit/main/documentation/wasmkit
- Size: 699 KB
- Stars: 107
- Watchers: 7
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-stars - swiftwasm/WasmKit - WebAssembly Runtime written in Swift (Swift)
README
# 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.
## Usage
### Command Line Tool
```sh
$ # Usage: wasmkit-cli run [] ...
$ swift run wasmkit-cli run Examples/wasm/fib.wasm fib i32:10
[I32(89)]
```### 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.
## Testing
To run the core spec test suite run this:
```sh
# Checkout the core spec test suite
$ ./Vendor/checkout-dependency spectest
# Prepare core spec tests and check their assertions with WasmKit
$ make spectest# Checkout WASI spec test suite
$ ./Vendor/checkout-dependency wasi-testsuite
# Install Python dependencies for running WASI spec tests
$ python3 -m pip install -r ./Vendor/wasi-testsuite/test-runner/requirements.txt
# Run WASI spec tests
$ make wasitest
```