finds.dev← search

// the find

matz/spinel

★ 1,667 · C · MIT · updated Jul 2026

Spinel is an ahead-of-time Ruby compiler that translates Ruby source to native executables via whole-program type inference and C codegen. It targets the subset of Ruby that can be fully typed statically, producing standalone binaries with no runtime dependency beyond libc. The 7.8x geometric mean speedup over CRuby+YJIT on compute benchmarks is real and honestly presented, including the two cases where YJIT is within 2.5x.

The single-binary pipeline is genuinely well-designed: parse, infer, emit C, and invoke cc all happen in one process with a shared in-memory model — no serialization, no chained helpers, hermetic builds by construction. Value-type promotion (small immutable classes become C stack structs, eliminating GC entirely for common patterns) is a clever optimization that shows up in the benchmarks as a real 40x+ win on allocation-heavy microbenchmarks. The spin project tool takes the 'single Ruby file as a native binary' idea to a usable place — cargo-style dependency resolution with source-compiled packages and snapshot testing against CRuby as the oracle is the right workflow. The benchmark table is honest: it shows YJIT within 2.4x on tarai/tak and explains why, which is the opposite of most compiler project READMEs.

No threads and no dynamic metaprogramming (send, method_missing, define_method) are the two cuts that rule out most real Ruby code. Any gem that uses DSL patterns — which is most of the ecosystem — won't compile. The packages/ directory has six entries; the entire gem ecosystem is effectively gone, and the compatibility survey (rubocop_spinel, spin-packages) is community-maintained and almost certainly incomplete. Integer overflow defaults to raise rather than Bignum promotion, which is a silent semantic break for any code that does arithmetic near INT64_MAX without expecting it — the --int-overflow flag exists but the incompatibility isn't flagged loudly enough. Windows users are told to use WSL, which undermines the 'ship a native binary' story for a tool whose main pitch is distribution without runtime dependencies.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →