I find the current documentation difficult to understand. This is a problem I see with many ruby projects. How would I reword this? Well, first thing, after stating what spinel is, I would show a simple example. Ideally a standalone .rb file or something like that, that can be downloaded (or whatever other format). Yes, the README shows this, but believe it or not, I have realised that I am usually below average when…
Spinel: Ruby AOT Native Compiler
71–80 of 93 posts
Re: Spinel: Ruby AOT Native Compiler
#72Curious why "no threads" when the ruby scheduler and underlying pthread implementation should work fine in C land. I guess to be "zero dependency"? Seems an odd trade-off to me, unless optional "extensions" are planned / omitted for later implementation etc.
I don’t see anywhere that it’s something they specifically decided not to support. Probably they just haven’t gotten around to it yet? Multithreading is notoriously difficult to get right.
Re: Spinel: Ruby AOT Native Compiler
#73This is really cool, I've been looking for an AOT compiler for ruby for a long time. The lack of eval/meta-programming fallbacks is a shame though, but I guess they kept the focus on a small, performant subset. It would be nice to have gems compiled with this AOT compiler that can interact well with MRI. When it comes to packaging/bundling more standard ruby (including gems) we'll still need tebako, kompo, ocran – an…
Re: Spinel: Ruby AOT Native Compiler
#74Limitations - No eval: eval, instance_eval, class_eval - No metaprogramming: send, method_missing, define_method (dynamic) - No threads: Thread, Mutex (Fiber is supported) - No encoding: assumes UTF-8/ASCII - No general lambda calculus: deeply nested -> x { } with [] calls Assuming UTF-8/ASCII isn’t, IMO, a huge limitation, but some of the others likely are, for quite a few programs. Removing them also will require s…
This removes a large portion of the magic of Ruby.
Re: Spinel: Ruby AOT Native Compiler
#75I will eat the downvotes to say what I actually think. Unless this gets back eval, metaprogramming and threads this isn't all that interesting as an actual language. There are plenty of compiled languages out there. Metaprogramming is what makes Ruby interesting and expressive. I know that this is just an experiment, but I've seen plenty of cases where stuff exactly like this gets forced into use in production becaus…
Spinel would be more interesting if this compiled subset could run side by side with interpreted Ruby, like Pallene does for (slightly modified) Lua.
Re: Spinel: Ruby AOT Native Compiler
#76While obviously super-impressive, it is clearly not maintanable without AI agent. It has spinel_codegen.rb is 21k lines of code with up to 15 levels of nesting in some methods. Compilers code was never pretty, but even by those standard, I feel like it is a very-very hard to maintain code by humans.
But I am not sure that huge files are easy for the AI to work with. I try to restrict the files to 300 lines. My thinking is that if it's easy for a human to understand the code, it will be easy for coding agents, too.
Re: Spinel: Ruby AOT Native Compiler
#77Earlier quoted context omitted.
> 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
#78Re: Spinel: Ruby AOT Native Compiler
#79For 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.
Re: Spinel: Ruby AOT Native Compiler
#80If it wasn't built by Matz I'd have severe doubts, but it's clearly defined and I presume he knows all limitations of the Ruby semantics well. My thesis work (back when EcmaScript 5 was new) was an AOT JS compiler, it worked but there was limitations with regards to input data that made me abandon it after that since JS developers overall didn't seem to aware of how to restrict oneself properly (JSON.parse is inheren…