A high performance implementation of the Ruby programming language, built on GraalVM
open sourceEPL-2.0 OR GPL-2.0-only OR LGPL-2.1-onlyfree
TruffleRuby is a high-performance implementation of Ruby built on GraalVM and the Truffle framework, aiming at full compatibility with the standard implementation (MRI). It has no global interpreter lock, so Ruby code and thread-safe C extensions run in parallel, runs most C extensions out of the box, and reaches high peak performance with its JIT after a warmup. It comes as a Native Standalone (fast startup) or a JVM Standalone with fast interoperability with Java, JavaScript, Python and WebAssembly, and installs with the usual Ruby managers (rbenv, ruby-build, asdf, mise, RVM, ruby-install), ruby/setup-ruby in CI, or Docker. TruffleRuby AB.C.D aims at compatibility with CRuby A.B. Licensed under EPL-2.0, GPL-2.0 or LGPL-2.1.
Problems it solves
- make my CPU-heavy Ruby code run much faster without rewriting it
- run Ruby threads in parallel without a global interpreter lock
- call Java, JavaScript or Python libraries from Ruby code
- a faster Ruby that still runs Rails and gems with C extensions
- try an alternative Ruby implementation in my CI matrix
Features
- no global interpreter lock: Ruby code and thread-safe C extensions run in parallel
- most C extensions work out of the box, including database drivers
- Native Standalone with fast startup, JVM Standalone with best peak performance
- interoperability with Java, JavaScript, Python and WebAssembly
- profiler, debugger and VisualVM support
- passes around 98% of ruby/spec
- installs with rbenv, ruby-build, asdf, mise, RVM or ruby-install, and in CI with ruby/setup-ruby
Limitations
- Not yet 100% compatible with MRI 4.01
- Needs a fair amount of warmup to reach peak performance1
- Runs on Linux (x86_64 and AArch64) and macOS on AArch64 only1
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what TruffleRuby does.
- JRuby The Ruby programming language on the JVM
- Fullstaq Ruby A server-optimised Ruby distribution: precompiled MRI packages built with jemalloc and malloc_trim.
