Swiftpack.co - swiftwasm/WasmTransformer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by swiftwasm.
swiftwasm/WasmTransformer 0.5.0
A Swift package for reading, writing, and transformation of WebAssembly binaries
⭐️ 34
🕓 52 weeks ago
.package(url: "https://github.com/swiftwasm/WasmTransformer.git", from: "0.5.0")

WasmTransformer

Test

A package which provides transformation operation for WebAssembly binary. Inspired by Rust implementation

Available transformations

lowerI64Imports

public func lowerI64Imports(_ input: [UInt8]) throws -> [UInt8]

Inserts trampoline functions for imports that have i64 params or returns. This is useful for running Wasm modules in browsers that do not support JavaScript BigInt -> Wasm i64 integration. Especially in the case for i64 WASI Imports.

stripCustomSections

public func stripCustomSections(_ input: [UInt8]) throws -> [UInt8]

Strip all custom sections from input WebAssembly binary.

Testing

  1. Set environment variable SWIFT_TOOLCHAIN to the path to your SwiftWasm toolchain. e.g. $HOME/Library/Developer/Toolchains/swift-wasm-5.7.3-RELEASE.xctoolchain/usr
  2. Set up testing fixtures by: (cd ./Fixtures/ && npm install && npm run build && make all)
  3. Run swift test

GitHub

link
Stars: 34
Last commit: 52 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.4.1
1 year ago

This release fixes build issues with Swift 5.7.

What's Changed

Full Changelog: https://github.com/swiftwasm/WasmTransformer/compare/0.4.0...0.4.1

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics