Yesterday I finally announced what I was working on since some time:
https://github.com/roastedroot/chicory-redline
Under the cover we are translating Chicory IR to Cranelift IR and generating ASM, performance are, as expected, fully comparable to wasmtime.
forgot the link to the blog post: https://chicory.dev/blog/chicory-redline/ :sweat_smile:
this is super-cool! and I love the integration work with Cranelift running as a .wasm itself so you have no native code blobs to ship with your JAR. Very very slick
One minor friction point I found is that trap lowers to ud2/udf, but it's the JVM that handles signals, so it crashes the entire process.
At the moment we avoid using it by emitting bounds checks etc. that catch the condition earlier.
Would it be a viable change to make trap lowering configurable (e.g., call a configurable function instead)?
I suppose you could generate a call instruction instead of a trap instruction? (You're doing the Wasm-to-CLIF translation yourself? Or are you borrowing wasmtime's code for this?) This is more or less what we do when signals-based traps are disabled in Wasmtime
yes I'm doing the Wasm-to-CLIF translation, but have to manually handle every single trap site, with trap lowering configurable, any missed site would safely call an handler
see https://github.com/bytecodealliance/wasmtime/blob/main/crates/cranelift/src/trap.rs where we change the CLIF instructions we are translating wasm traps to based on whether we can rely on signal handlers / virtual memory or not
nothing major though, if this is the expected usage I'm fine with it :slight_smile:
you would need to just do the same thing
Last updated: May 03 2026 at 22:13 UTC