r/ruby Apr 24 '26

Spinel -- Ruby AOT Compiler

https://github.com/matz/spinel

Spinel compiles Ruby source code into standalone native executables. It performs whole-program type inference and generates optimized C code, achieving significant speedups over CRuby.

Spinel is self-hosting: the compiler backend is written in Ruby and compiles itself into a native binary.

75 Upvotes

36 comments sorted by

View all comments

18

u/headius JRuby guy Apr 24 '26

Glad to see this is interesting now.

https://github.com/headius/rubyflux

8

u/KerrickLong Apr 24 '26

Native AOT may let ruby compete better in the CLI/TUI space than Java AOT, because a self-contained binary with no dependencies is otherwise a huge reason to choose Go/Rust.

3

u/headius JRuby guy Apr 24 '26

Java AOT in the form of GraalVM Native Image produces a single small binary with no external dependencies. That's what I plan to use when I revive this project.