Add shims for wasm32-freestanding compilation #1

Merged
kelton.halbert merged 4 commits from freestanding into main 2026-05-30 21:53:53 +00:00

This PR adds shims so that ZFP can be compiled for WASM32-freestanding targets.

Freestanding builds are nice because they don't require loading the WASI runtime, which has some bloat, performance hits, and browser support nuances that make it less than ideas. This makes it much easier to create a ZFP WASM binding that operates purely on compressed/decompressed bytes.

This also means that any need for Emscripten can be bypassed entirely, relying purely on Zig to compile to the webassembly target.

This PR adds shims so that ZFP can be compiled for WASM32-freestanding targets. Freestanding builds are nice because they don't require loading the WASI runtime, which has some bloat, performance hits, and browser support nuances that make it less than ideas. This makes it much easier to create a ZFP WASM binding that operates purely on compressed/decompressed bytes. This also means that any need for Emscripten can be bypassed entirely, relying purely on Zig to compile to the webassembly target.
renamed shim to libc from stdlib
All checks were successful
CI Build / build (ubuntu-latest) (pull_request) Successful in 43s
f0417e71e3
kelton.halbert left a comment

LGTM

LGTM
added testing so that freestanding is covered by CI
All checks were successful
CI Build / build (ubuntu-latest) (pull_request) Successful in 55s
df48f501de
generalized target to include wasm64
All checks were successful
CI Build / build (ubuntu-latest) (pull_request) Successful in 44s
01f3bdb85e
Sign in to join this conversation.
No description provided.