GraalVM For Crystal + Ruby

From what I gather, many come from Ruby to Crystal concerned with two issues: efficiency and support. People go the route of manually re-implementing particularly large monolithic apps, in lack of definitive inter-op or transpilation solutions. Integrating this legacy ecosystem is clearly highly desired.

GraalVM for Ruby, although still experimental, is very promising just in the Ruby department alone. But being GraalVM, you can compound it with other languages and runtimes. This includes anything transformed into LLVM bitcode, which sounds to me like Crystal.

So I wonder if this might present a solution for interoperating with old Ruby, along with putting it up with native speeds. I’d like to explore this further, so please let me know your impressions.

Cheers!

1 Like

Probably the hardest issue to solve is memory management and multi-threading. But that said, it is an interesting land to explore.

The design of Kotlin Native (as part of KMM) prioritizes multiplatform libraries. This practically enforces a Kotlin subset.
I’ve not looked into it extensively, for GraalVM there’s this docAnother suggests multithreaded Ruby is supported.

The fact that Graal is an Oracle product I think repels most. For me some creative uses of Graal spark optimism.

GraalVM looks like amazing technology that is poisonous for Oracle reasons.

Say you build a nice business on GraalVM, then a decade later Oracle comes around “nice business you have there, shame if something were to happen to it. How much cash you got?”, They already did something similar with the JVM. At least with the JVM you can switch to OpenJDK as long as you are not dependent on the JVM performance.

Yes, we all don’t like Oracle.

If you mean port code from Ruby to Crystal, rubocop can help a lot, e.g. set rules for compatible with Crystal, and run rubycop -a.

there is another project create by me. port_ruby_to_crystal, will continue to improve, may reduce the friction a lot.

Anyway, i don’t consider mix Ruby with Crystal is a good idea.

2 Likes