walrus-macro
Internal macros used by the `walrus` crate, not for public consumption.
0.26.0
14M downloads/mo
#2572 most downloaded on crates.io
rustwasm/walrus
What this package is like to depend on
Last release 5 months ago
25 Mar 2026
Ships unpredictably
gaps range from 2 weeks to 3.4 years
Most releases are documented
notes for 18 of 24 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
24 releases · first in 2019
3 releases in the last 12 months
see the full history below
Release timeline
24 releases · Feb 2019 to Mar 2026Releases
latest 24-
0.26.025 Mar 2026Release notes
Open source →What's Changed
- feat: Full support for GC extension by @logan-gatlin in #304
- feat: wide arithmetic proposal by @logan-gatlin in #306
- feat: memory64 support by @logan-gatlin in #305
Full Changelog: 0.25.2...0.26.0
-
0.25.012 Feb 2026Release notes
Open source →What's Changed
- fix: dfs_pre_order_mut not visiting inside catch and catchall blocks by @logan-gatlin in #297
- Fix: set correct wasm-encoder instr for
i64.atomic.rmw8.xchg_u(fixes #299) by @aaronmunsters in #300 - GC Proposal by @logan-gatlin in #298
- Update gimli by @guybedford in #301
New Contributors
- @logan-gatlin made their first contribution in #297
- @aaronmunsters made their first contribution in #300
Full Changelog: 0.24.4...0.25.0
-
0.24.022 Oct 2025Nothing published for this version
-
0.22.025 Sep 2024Nothing published for this version
-
0.19.015 Apr 2021Nothing published for this version
-
0.18.014 Jul 2020Nothing published for this version
-
0.17.018 May 2020Nothing published for this version
-
0.16.005 May 2020Nothing published for this version
-
0.15.003 Feb 2020 -
0.14.002 Dec 2019 -
0.13.024 Oct 2019 -
0.12.010 Sep 2019Release notes
Open source →Released 2019-09-10.
Added
-
Added support for multi-value Wasm!
-
Added
ModuleExports::get_exported_{func, table, memory, global}helper functions to get an export by the id of the thing that it is exporting (if any). -
Added fuzz testing with libFuzzer and
cargo fuzz.
Changed
-
No longer using the "derive" feature from
failure, which should result in slimmer dependency graphs and faster builds. -
Module::emit_wasmis no longer fallible. It never actually did ever return anErrand now the type signature reflects that.
-
-
0.11.013 Aug 2019Release notes
Open source →Released 2019-08-13.
Added
walrus::Module::write_graphviz_dot: You can now render a whole Wasm module as a GraphViz Dot file (previously you could only do one function at a time) and it will also show the relationships between all the various Wasm structures (previously it only showed the relationships between instructions).
Changed
-
The intermediate representation for instructions (
walrus::ir::*) has been overhauled.Exprhas been renamed toInstr, and an operator no longer points to its operands as nested children in the AST. Instead of representing every instruction as a node in an AST, now there is a tree of instruction sequences. An instruction sequence is a vector ofInstrs that relate to each other implicitly via their effect on the stack. A nestedblock ... end,loop ... end, orif ... else ... endform new nested instruction sequences. -
The
VisitorandVisitorMuttraits and traversing the IR has also been overhauled:-
Visitors are no longer recursive, and should never recursively call
self.visit_foo()from insideself.visit_bar(). Not in the default provided trait methods and not in any user-written overrides of those trait methods. -
There are now traversal functions which take a visitor, a
LocalFunction, and a startInstrSeqId, and then perform some kind of traversal over the function's IR from the given start sequence. These traversal functions are not recursive, and are implemented with explicit work lists and while loops. This avoids blowing the stack on deeply nested Wasm inputs. Although we can still OOM, we leave fixing that to future PRs. Right now there are only two traversals, because that is all we've needed so far: an in-order DFS for immutable visitors (needs to be in-order so we can encode instructions in the right order) and a pre-order DFS for mutable visitors (pre-order is the easiest traversal to implement iteratively). We can add more traversals as we need them.
-
Removed
-
The
Dottrait has been made internal. Use the newwalrus::Module::write_graphviz_dotmethod instead. -
The
Visittrait is no longer exported in the public API, and has been made internal. Use the new traversal functions instead (walrus::ir::dfs_in_orderandwalrus::ir::dfs_pre_order_mut).
-
0.10.030 Jul 2019 -
0.9.029 Jul 2019 -
0.8.005 Jun 2019Release notes
Open source →Released 2019-06-05.
Added
-
Added
ModuleExports::iter_mutfor iterating over exclusive references to a module's exports. -
Added a
ModuleConfig::on_parsehook, which has access to a map from indices in the original Wasm binary to the newly assigned walrus IDs. This is a good time to parse custom sections that reference functions or types or whatever by index. -
The
TableKindenum now has variousunwrap_*helpers to get a particular variant's inner data or else panic. -
Added
ModuleFunctions::by_nameto get a function ID by function name.
Changed
- The
CustomSection::datatrait method now has a new parameter: a map from walrus IDs to their indices in the new wasm binary we are emitting. This is useful for custom sections that reference functions or types or whatever by index.
-
-
0.7.017 May 2019Release notes
Open source →Released 2019-05-17.
Added
-
Added the
walrus::ModuleCustomSectionsAPI for working with arbitrary custom sections, including and especially custom sections thatwalrusitself has no special knowledge of. This is exposed as thecustomsfield of awalrus::Module. -
Added the
Module::with_configconstructor method to create a default, empty module that uses the given configuration.
Removed
- The
walrus::Module::customvector of raw custom modules has been removed and is superceded by the newwalrus::ModuleCustomSectionsAPI. If you were using this and the oldCustomSectiontype, switch to use theRawCustomSectiontype withModuleCustomSections.
-
-
0.6.002 May 2019Release notes
Open source →Released 2019-05-02.
Added
ModuleConfig::parse_fileandModule::parse_file_with_confighelper functions to easily parse a Wasm file from disk with a given configuration.
Changed
ModuleConfig::parsetakes&selfinstead of&mut selfnow. This was just an oversight / copy-past error before.
-
0.5.006 Mar 2019 -
0.4.019 Feb 2019 -
0.3.019 Feb 2019Release notes
Open source →Released 2019-02-19.
Added
- Added support for the reference types wasm proposal. #50
- Can finish a
FunctionBuilderwith the relevant&mutparts of a module, rather than a whole&mut Module. This is useful when some parts of the module are mutably borrowed elsewhere. #56 - Can get a
FunctionBuilderfrom an existingLocalFunctionso you can build new expressions for the function. #54 - Added the ability to delete functions, imports, exports, etc. Usually it is easier to just let the builtin GCing emit only the necessary bits of the wasm binary, but manually deleting will remove the item from iterators over the module's parts. If you delete a thing, you are responsible for ensuring that nothing else is referencing it (eg there are no remaining calls to a function that you are deleting, etc). #58
- Added an
idgetter forImports. #59 - Added a mutable iterator for tables in a module. #59
- Added a convenience function for getting the main function table for a module. #57
Changed
- The
WithSideEffectsexpression variant can have arbitrary stack-neutral side effects before its value now, in addition to after its value. #55
-
0.2.114 Feb 2019Release notes
Open source →Released 2019-02-14.
Added
- Added configuration options for controlling emission of the producers section
-
0.2.014 Feb 2019Release notes
Open source →Released 2019-02-14.
Added
- Added configuration options for controlling emission of the DWARF and name custom sections.
Changed
- Changed the synthetic naming option from "generate_names" to "generate_synthetic_names_for_anonymous_items" to more accurately reflect what it does.
-
0.1.012 Feb 2019