// the find
tenderlove/fisk
A pure Ruby assembler
Aaron Patterson's pure Ruby x86-64 assembler, built as substrate for early YJIT prototyping. The instruction set is generated via metaprogramming from an XML spec, giving unusually broad coverage for a 311-star project. The audience is narrow: people writing JIT compilers or runtime internals in Ruby, not general application developers.
The instruction coverage is genuinely wide — SSE2, AES-NI, BMI1/BMI2, AVX, and even AVX-512 mask register operations (kaddb, kxorw, etc.) are all present, generated from spec rather than hand-coded, so encoding correctness is consistent. The block DSL reads close to real Intel syntax with minimal ceremony. The JIT execution path via Fiddle actually works end-to-end — this is an assembler you can run inside a Ruby process, not just one that writes bytes to a file. It was used for real work on early YJIT, so the core integer and control-flow paths have been exercised against a live Ruby VM.
x86-64 only with no ARM64 support — on Apple Silicon or AWS Graviton this is a non-starter. The register allocator raises an exception the moment you exhaust your register pool with no spilling, which means it's unusable for any codegen that needs to handle arbitrary expression depth. Forward label resolution for loops and conditionals is not documented anywhere in the README, and basic_block.rb exists but isn't explained — you'd need to read source to figure out branching. YJIT moved to Rust for production and the last commit was April 2023, so the upstream motivation that kept this honest is gone and nobody is likely fixing edge cases.