Live data from Hacker News

Spinel: Ruby AOT Native Compiler

github.com

31–40 of 93 posts

Re: Spinel: Ruby AOT Native Compiler

#31
post #27
post #10

For some context, just presented by Matz at RubyKaigi 2026. It’s experimental but he built it with help from Claude in about a month. Successful live demo. It’s named after his new cat, which is named after a cat in Card Captor Sakura, which is the partner to another character named Ruby.

> It’s experimental but he built it with help from Claude in about a month. We talk a lot about AI building programs from soup to nuts. But I think people overlook the more likely scenario. AI will turn 10x programmers into 100x programmers. Or in Matz’s case maybe 100x programmers into 500x programmers.

AI is the function f(x) = x • |x|. It turns 10x into 100x, 1x into 1x, and -10x into -100x.

Re: Spinel: Ruby AOT Native Compiler

#32

> No eval: eval, instance_eval, class_eval > No metaprogramming: send, method_missing, define_method (dynamic) > No threads: Thread, Mutex (Fiber is supported) Speaking as someone who has written a lot of Ruby code over the years, utilizing every single one of these features of Ruby, I have to say this is the version of Ruby I've evolved to want: simpler and easier to understand but with the aesthetic beauty of Ruby…

I'd agree that lack of eval is "for the best", but lacking threads and mutexes isn't. Lack of define_method makes a lot of sense as well given the use case.

However, send/method_missing is in common use in preexisting libraries and it shouldn't be particularly difficult to implement (via in memory lookup tables at "compile" (to c) time etc), so either they're ommitted for the reasons you say, or he just hasn't gotten around to it yet. I'm hoping the latter, but only for compatibility sake as I won't be able to use it for any real work at least in the short term otherwise.

Re: Spinel: Ruby AOT Native Compiler

#33

> No eval: eval, instance_eval, class_eval > No metaprogramming: send, method_missing, define_method (dynamic) > No threads: Thread, Mutex (Fiber is supported) Speaking as someone who has written a lot of Ruby code over the years, utilizing every single one of these features of Ruby, I have to say this is the version of Ruby I've evolved to want: simpler and easier to understand but with the aesthetic beauty of Ruby…

What about Crystal? If it's just the aesthetic beauty you want then it might be a good fit as it's similar syntax yet statically typed which leads into more efficient compiled code.

Requiring static type annotations is likely a dealbreaker for many. I wish Matz had gone the route of python3 and allowed _optional_ inline type annotations instead of the mess that is RBS.

Re: Spinel: Ruby AOT Native Compiler

#34

> No eval: eval, instance_eval, class_eval > No metaprogramming: send, method_missing, define_method (dynamic) > No threads: Thread, Mutex (Fiber is supported) Speaking as someone who has written a lot of Ruby code over the years, utilizing every single one of these features of Ruby, I have to say this is the version of Ruby I've evolved to want: simpler and easier to understand but with the aesthetic beauty of Ruby…

What about Crystal? If it's just the aesthetic beauty you want then it might be a good fit as it's similar syntax yet statically typed which leads into more efficient compiled code.

Crystal is great and I think it nailed statically typing in a Ruby like language, but I've always been wary of day job use of the language because it doesn't have a significant user base.

Re: Spinel: Ruby AOT Native Compiler

#35
post #15
post #7

Earlier quoted context omitted.

Crystal has an explicit static type system and is actually optimized at the language level for AOT compilation. These features are pretty much required for compiling and maintaining large programs. This is for a limited subset of Ruby - almost no popular Ruby gems would run under it. It's more like PreScheme [1] (ie. a subset of a language oriented at C compilation). I don't think these compete in the same niches rig…

It's a similar subset to mruby, and it might well end up influencing mruby, which does have its users. But it's almost a different language in some ways.

> It's a similar subset to mruby...

This is what I've been wondering after only a cursory glance ("It...generates optimized C code" from the OP). Interesting that mruby itself got a major version update around the same time (in just the past few days) https://github.com/mruby/mruby/blob/master/doc/mruby4.0.md

Re: Spinel: Ruby AOT Native Compiler

#36

Earlier quoted context omitted.

What about Crystal? If it's just the aesthetic beauty you want then it might be a good fit as it's similar syntax yet statically typed which leads into more efficient compiled code.

Crystal is great and I think it nailed statically typing in a Ruby like language, but I've always been wary of day job use of the language because it doesn't have a significant user base.

I agree, it's a network effect problem and I wouldn't use it for professional use, only personal.

Re: Spinel: Ruby AOT Native Compiler

#37
I see this being useful in infrastructure tools. Imagine a statically compiled bundler that can also do the job of RVM and friends (installing Ruby) but it is still written in Ruby.

The classic Ruby buildpack is written in Ruby but we have to bootstrap it with bash and it's annoying and has edge cases. The CNB is written in rust to not have that problem and the idea that you can ship a single binary with no dependencies is really powerful.

Re: Spinel: Ruby AOT Native Compiler

#38

> No eval: eval, instance_eval, class_eval > No metaprogramming: send, method_missing, define_method (dynamic) > No threads: Thread, Mutex (Fiber is supported) Speaking as someone who has written a lot of Ruby code over the years, utilizing every single one of these features of Ruby, I have to say this is the version of Ruby I've evolved to want: simpler and easier to understand but with the aesthetic beauty of Ruby…

The benefit of meta programming was never having less code to write.

It was having less code to read.

Re: Spinel: Ruby AOT Native Compiler

#39

Earlier quoted context omitted.

What about Crystal? If it's just the aesthetic beauty you want then it might be a good fit as it's similar syntax yet statically typed which leads into more efficient compiled code.

Crystal is great and I think it nailed statically typing in a Ruby like language, but I've always been wary of day job use of the language because it doesn't have a significant user base.

This subset of Ruby doesn’t either.
Post reply on HN