I am slightly disappointed by Helix. They pushed an alpha version, made a good and extensive blog post on it and everything it's going to bring to the table, and got us all excited.
More than a month later there are obviously some bug reports and pull requests that have been opened. There hasn't been a single answer or acknowledgement from the team behind Helix. Not a single commit either.
I get that this is open source software and that they might suddenly not have any time to put on it, but at least an acknowledgement of the situation somewhere or getting some help from contributors would have been appreciated.
Looks like the repo hasn't been updated in over a month. This project looks interesting. Anyone know if this is still being developed?
In fact, every crate I can find in this category (Helix, ruru, rurust, mrusty, and ruby-sys) is looking a little abandoned. rurust was updated 25 days ago, and that's the most recent.
I think ruby-sys was originally built into ruru, then separated out. Based on comments in PRs, I think the -sys convention is for Rust crates that map 1-to-1 to other languages C apis. Then, packages such as ruru create something more easy to consume and program against.
I wonder how it handles memory management. I just wrote an article about how memory management is handled with Ruby C extensions. It involves some gnarly platform-specific tricks like scanning the C stack looking for "VALUE" pointers (ie. C pointers to Ruby objects). Also Ruby makes you implement a "mark" function to trace references the Ruby interpreter doesn't know about.
Probably a lot of work. It would bring the same things that most rewrites do: Cleaner code in most places and probably some performance due to understanding problems better the second time around. If you were doing the rewrite for performance, it wouldn't be worth it. If you were doing the rewrite for a more modern language to attract more contributors, it might be worth it.
I don't think Ruby as a language has had many issues in the space that Rust tends to solve (safety related to memory). Ruby is garbage collected. I don't know what (if any) performance boost the VM would get by being converted to LLVM IR. It's mostly the semantics of Ruby the language that make it hard to make fast. It seems most of the recent efforts to make Ruby faster have been by making the runtime do less allocations.
We do this to run Ruby C extensions on the JVM - compile the extension to LLVM IR instead of native code, then JIT compile the IR using the JVM's JIT. It's fast!
Well yes but at some point in the pipeline the byte code is long gone. So you can use it for anything by using just the parts beyond that point.
But really we don't directly compile the IR. We have an interpreter for IR, and we JIT compile the interpreter, sort of constant folded with the IR. It achieves the same thing without getting more technical.
This is both anecdotal on observations and subjective on the assertion that rust is better than C for MRI. Also rust adoption is yet to bear out and speculation at best that rust would bring more contributors. A good comparison point might be Rubinius or JRuby to see what a non-C approach does for contribution.
In case you are thinking it would make Ruby significantly faster, I don't see how it would. Ruby is slow due to a lack of caching and dynamic compilation and optimisation, not due to basic interpreter code being slow because it's written in C.
I can't see how Rust's parallelism model would help either.
Maybe it would prevent some bugs that Ruby currently has? I don't see Ruby as having a problem with bugs though - certainly not that would make it worthwhile to do a translation.
Which is not a parallelism model itself, but is more about how rust's data model lends itself to implementing different kinds of parallelism in a reliable way.
A lot of time and probably breaking every native extension. It would probably give us a less buggy VM and GC, but I'm not sure it would be worth the effort to essentially rewrite the entirety of ruby in rust.
Likely because people in the Ruby community tend to favor solutions that allow them to continue writing Ruby. In the context of the OP, Rust is being used only to augment Ruby, to complement it, not to outright replace it. Adopting Swift or Crystal would involve rewriting much more code from Ruby into the new language.
Look at it this way: for these programmers, the choice isn't between Rust and Crystal, it's between Rust and C. And for people who've never written systems code before, Rust is enormously friendlier.
> Swift as well as Crystal can be used in here too
Can you elaborate? I don't know of any way to compile Swift or Crystal code into a library that exposes a C-compatible ABI, and I can find no documentation as such.
https://github.com/rustbridge/helix