Swiftpack.co - Package - shareup/wasm-interpreter-apple


WasmInterpreter is a small Swift wrapper around CWasm3, which packages wasm3 inside of a Swift package while adding a few minor conveniences on top. The overriding goal of WasmInterpreter is to provide a clean, Swift-y interface to wasm3.

The core class inside of WasmInterpreter is, naturally, WasmInterpreter. This class is initialized with a stack size (default: 512 KB) and a Wasm module. WasmInterpreter takes care of initializing the WebAssembly environment, runtime, and module, and exposes a clean interface for calling Wasm functions, importing native functions into Wasm modules, and extracting data from the runtime's heap. You can find examples for all of these things by looking at the tests.


To use WasmInterpreter with the Swift Package Manager, add a dependency to your Package.swift file:

dependencies: [
  package(name: "WasmInterpreter", url: "https://github.com/shareup/wasm-interpreter-apple.git", .upToNextMinor(from: "0.2.3")),


The license for WasmInterpreter is the standard MIT license. You can find it in the LICENSE file.


Stars: 0

Used By

Total: 0


0.2.3 -

Update Synchronized.

0.2.2 -

Update CWasm3.

0.2.1 -

Update CWasm3.

0.2.0 -

Add WasmInterpreter.heap() function to access the contents of a module's memory directly.

0.1.0 -

Initial release.