loading...

Anybody keeping up with TruffleRuby?

Ben Halpern on November 20, 2019

oracle / truffleruby A high performance implementation of the Ruby programmin... [Read Full]
markdown guide
 

As a long time Oracle practitioner, I find it very intriguing that they're engaged with this. They've never been very Ruby-ish as an organisation, so it's interesting to speculate on their strategy in supporting this.

There's a lot of really smart technical people at Oracle though, so I have high hopes.

 

I'm not really tracking what TruffleRuby is doing in the day to day but it's an interesting project.

I wonder if, with the work around Ruby 3x3 and Ruby's JIT, it will be still as interesting for the late adopters and companies that don't want to deal with possible incompatibilies with the regulary CRuby ecosystem. We'll see.

There's definitely a need there, especially with long running processes like Rails apps.

Run idiomatic Ruby code faster

Yes! I guess it's also the 3x3 + JIT goal, though AOT compilation and the creation of a binary sounds sweeet and TruffleRuby uses a different technique.

According to Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby is a lot faster in benchmarks. I want to see it with a Rails app though :)

Run Ruby code in parallel

Since it doesn't use CRuby, it doesn't have the GIL, so threads in memory can run in parallel. Should indirectly create an ecosystem of libs to do numerical computation and derivatives. Not sure how much it would benefit I/O bound frameworks like Rails+Puma or Sidekiq. We'll see :D

Boot Ruby applications in less time

Yeah! Rails startup is slow, even with bootstrap.

Execute C extensions in a managed environment
Add fast and low-overhead interoperability with languages like Java, JavaScript, Python and R

This is probably the most interesting part to me.
Someone said WebAssembly :D ?

Very interesting project indeed.

 

It is definitely close to be production-ready. And it is probably single most exciting thing happening in Ruby. I can't wait to try it out in production.

 

I've run a few things on it to see if its performance claims are real. They really are. It's terrifyingly fast for some things — almost as fast as Crystal for the same benchmarks.

I'd love to see a web service run on it to see what the performance looks like in a real-world app. Unfortunately, it doesn't quite seem to be ready for Rails, but I bet you could run Roda or Sinatra just fine.

 

To those thinking Ruby JIT will be as fast, GraalVM and Truffle Ruby is literally hundreds of million dollar investment from Oracle over the past few years and more. I seriously doubt Ruby JIT will be anywhere close, and it is not a fair comparison anyway.

TruffleRuby has been aiming to run Rails for two years now, so it is close, but like any project the last 20% bits and pieces tends to take as much time as the first 80%.

They are trying to be a drop in replacement for MRI, with Sulong you can execute C, and other programming languages ( Including Javascript ) that can be transformed to LLVM bitcode on GraalVM. Unfortunately C extensions are hard to get right. So they had to even go and fix the C extension themselves.

I think they do need a bit more help from the Rails communities, unfortunately it seems everyone is avoiding anything from Oracle like plague. While Oracle might not be a companies to trust, they have been a very decent Java Stewards for many years now, and there is nothing stopping you from forking the entire project which is open sources.

Chris Seaton twitter.com/chrisgseaton is now working in Shopify, although he did said he is not trying to get Rails inside Shopify to be running on TuffleRuby yet.

 

I try to keep up :) I think it could be a future of Ruby especially now when Shopify invested in truffle-ruby. It is not great running Rails yet, but that could change. For me it is a breath of "fresh" air in the ruby ecosystem.

Also, I think that Oracle vision with truffle and GraalVM is extremley interesting, I found this video a great start if you want to lean more: youtu.be/TQMKPRc6cbE

 

I know the Truffle languages are built for GraalVM, a new polyglot Java Virtual Machine. It's pretty sweet.

 

First time I hear about it ... :-)

So is this sort of a JRuby? (GraalVM is a Java VM/JDK)

code of conduct - report abuse