3 ms·
It is interesting the discussion of Rust and Zig, which is the opposite spectrum of programming. It make sense if Ruby Cores are interested to develop / move to
by ksec 5y ago
It is interesting the discussion of Rust and Zig, which is the opposite spectrum of programming. It make sense if Ruby Cores are interested to develop / move to a new Ruby VM towards Rust. Not surprising considering Love2Code ( along with many other Ruby VM dev ) have complained over the years for CRuby's complexity. The Ruby Spec is a fairly recent thing done mostly by JRuby and TruffleRuby folks ( Correct me if am wrong ). If not, Zig on the other hand just works a lot better with old C code. One could argue Rust is Progressive and Zig is conservative.
Unfortunately it is still way too early for Zig.
I also wonder what is happening to TruffleRuby inside Shopify. And where is TenderJIT :)
- shellac 5y agoRuby spec has been going for a long time. It came from rubinius originally.
- pjmlp 5y agoTo me it looks like looking for new toys. My C complaints are well known, yet I don't see the need to make the build system even more complex, dropping platform support, for the benefit of yet another language, regardless of Rust or Zig winning in the end. Then they shouldn't have merged the JIT to start with and just do their own Ruby implementation instead.
- byroot 5y ago> just do their own Ruby implementation instead "just"... Several other Ruby JIT projects (Rubinius, JRuby, TruffleRuby, etc) have poured tons of resources, and while they perform very well, the adoption is still very low because keeping up with the main implementation takes tons of effort. On the other hand YJIT managed to speedup real world codebases with pretty much 100% compatibility in under a year of development by a fairly small team. Shopify already invest quite a lot in TruffleRuby, that's the new implementation moonshot you call for, YJIT is the more grounded, shorter term hedge.
- pjmlp 5y agoI am fully aware of it, and spending now several months rewriting YJIT into Rust/Zig is supposed to get back that money (developer hours x $ per hour) exactly how?
- byroot 5y ago> spending now several months rewriting YJIT I think you overestimate the size of the YJIT codebase. It's a very dense codebase in term on developer hours, translating it is far cheaper than it was to develop it from scratch. It also doesn't come from out of nowhere, Alan already spent time experimenting on this idea with good results. > is supposed to get back that money (developer hours x $ per hour) exactly how? It's explained in the ticket, the goal is to have a better velocity once it's done. You say you're fully aware of it but just the comment above you were advocating for something that took years to other VMs. Maybe have a little more faith in the YJIT team?
- weatherlite 5y ago> I think you overestimate the size of the YJIT codebase. So is it worth the hassle of introducing a new language? I like the enthusiasm argument, but tbh I don't see many Rust devs become interested developing core Ruby just because a small part of it is written in Rust. My gut feeling is saying better to just keep it in C. But anyway super excited about what the Shopify guys are doing, I want them to succeed no matter what approach they choose.
- byroot 5y ago> So is it worth the hassle of introducing a new language? Just because it's small in term of line of code, doesn't mean it isn't tricky to maintain and extend. It's all explained on the ticket.
- maxime_cb 5y agoWe aren't dropping support for any platforms. The Rust version of YJIT will work on all the platforms the C version was working on before, and eventually new platforms it wasn't working on before. > Then they shouldn't have merged the JIT to start with and just do their own Ruby implementation instead. See the thing is, building a new Ruby implementation from scratch would actually have been easier because we could have more of a clean room design. The problem is the compatibility. Making your new Ruby implementation 100% compatible with CRuby and the many Ruby gems found in the wild is extremely hard.
- pjmlp 5y agoI respect your work a lot, still remember the days on D forums, however my experience in rewriting projects in consultancy hasn't been exactly that great. Well, it was great for the money we got out of it, even though it set back the client for all the issues that came out of the process until they could proceed with the same velocity as before the rewrite took place. Hence why I usually don't see the value in rewrites of any sort, and advocate for new language adoption to always go the clean room path. So any tier 2+ platform for Ruby now needs to wait for Rust/Zig support before considering joining the YJIT effort, maybe a compromise the Ruby team is happy with given their replies, but it does have an impact nonetheless.