Hacking on clif-util is a bit annoying:
String for error types, which requires annoying conversions and formatting to provide context.clap usage to build up CLI arguments and subcommands is a bit tedious.We can address (1) with anyhow, which is used extensively throughout the rest of the project and provides easy error conversions, backtraces, and addition of context.
We can address (2) with structopt, which is also used in wasmtime and is a derive for creating CLI arguments from structs and enums. It is more concise and moves us towards better idioms (eg functions taking an options struct rather than fifteen parameters).
I don't expect any controversy around these proposed changes, but I did want to make sure that there wasn't any hidden issues with this stuff due to the firefox+cranelift integration.
cc @Dan Gohman @Benjamin Bouvier @Chris Fallin @Julian Seward
+1 from me at least; it sounds like this won't affect the codegen or wasm crates at all (that's all we use in SpiderMonkey)?
+1 from me. String was once common as an error type in Cranelift, but anyhow is better in every way
Great, I'll get started on this then. Thanks!
Last updated: Dec 06 2025 at 06:05 UTC