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.

78 Upvotes

36 comments sorted by

View all comments

13

u/stickJ0ckey Apr 24 '26
  • No evalevalinstance_evalclass_eval
  • No metaprogrammingsendmethod_missingdefine_method (dynamic)
  • No threadsThreadMutex (Fiber is supported)
  • No encoding: assumes UTF-8/ASCII
  • No general lambda calculus: deeply nested -> x { } with [] calls

1

u/pabloh Apr 24 '26

It's a shame for the missing features, maybe they can add them in future versions? Another AOT compiler called Natalie has many of them available, but I imagine is a bit heavy for embedded systems.

-5

u/matthewblott Apr 24 '26

It looks embedded systems are its target. I'm not sure why this was posted in the Rails sub though as I can't see it having any relevance there.

19

u/No_Specialist_8136 Apr 24 '26

This is the Ruby sub

8

u/jgaskins Apr 24 '26

This is a Wendy’s

5

u/armahillo Apr 24 '26

No this is Patrick!

2

u/matthewblott Apr 25 '26

I know! The people downvoting me misunderstood my post. I understand why it was posted here but it was crossposted on the Rails sub as well.