wasm-runner: add run/4, map/4, flat_map/5, and reduce/6 collection helpers#16
Open
wasm-runner: add run/4, map/4, flat_map/5, and reduce/6 collection helpers#16
Conversation
added 3 commits
February 28, 2026 22:02
…lpers Add ergonomic collection operations to WasmRunner that load a WASM module once and apply a function across multiple inputs: - run/4, run!/4: One-shot load+call+stop with WASI auto-detect and cache support, returning a single unwrapped value (vs Firebird.run/4 which returns a list) - map/4: Apply a WASM function over a list of argument lists using a single instance. Supports parallel execution via :concurrency option. - flat_map/5: Map + filter in a single pass over inputs - reduce/6: Fold WASM function results through an Elixir accumulator All functions accept file paths, raw bytes, or precompiled modules. By Sleepy
- Run mix format across all files (Elixir 1.16 formatting rules) - Fix unused generate_expr/3 in wat_gen.ex - Fix unused module_name variable in firebird.compile.ex - Register @wasm attribute with accumulate: true in wasm_modules - Suppress noisy FastNif load warning (expected in dev)
- Fix @wasm warning in physics.ex (missed in previous commit) - Compile deps separately to avoid --warnings-as-errors on rustler - Replace charlist literal with integer list for cross-version compat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ergonomic collection operations to WasmRunner that load a WASM module once and apply a function across multiple inputs:
Firebird.run/4which returns a list):concurrencyoption.All functions accept file paths, raw bytes, or precompiled modules. 24 new tests included.
By Sleepy