Skip to content
A high performance implementation of the Ruby programming language. Built on the GraalVM by Oracle Labs.
Ruby Java C Yacc Jsonnet Makefile
Branch: master
Clone or download

Latest commit

eregon [GR-14806] Update specs.
PullRequest: truffleruby/1657
Latest commit 984a0a6 May 31, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bench Fix commands in benchmark comments May 29, 2020
bin Update bin scripts to match format expected by rubygems installer Jan 14, 2020
doc [GR-23767] Document how to update the parser from JRuby. May 26, 2020
lib Implement rb_str_cat_cstr May 27, 2020
logo Add file with attribution details for CC Mar 20, 2017
mx.truffleruby Update to latest Native Image to get a JVM_* symbol linking fix on macOS May 29, 2020
spec Add tag for hanging spec May 31, 2020
src [GR-18163] Fix indentation for squiggly heredoc with single quotes (#… May 29, 2020
test Update locked puma version in ecosystem tests May 29, 2020
tool [GR-17457] Update locked puma version in ecosystem tests. May 29, 2020
.gitattributes Fixups following the move from lib/ruby/gems/2.6.0 to lib/gems Jul 9, 2019
.gitignore migrate hello-world gem test from ecosystem spec to truffle spec May 7, 2020
.reek.yml Document how to run static analysis tools Jan 25, 2019
.rubocop.yml add rubocop config for spaces inside and before blocks Apr 20, 2020
.ruby-version Update Ruby version Jan 7, 2020
.travis.yml Fix JAVA_HOME in TravisCI Apr 24, 2020
3rd_party_licenses.txt Update FFI version in the documentation Mar 25, 2020
CHANGELOG.md [GR-18163] Fix indentation for squiggly heredoc with single quotes (#… May 29, 2020
CONTRIBUTING.md Update CONTRIBUTING.md Mar 25, 2020
LICENCE.md Update the license from EPL 1.0/GPL 2/LGPL 2.1 to EPL 2.0/GPL 2/LGPL 2.1 Oct 12, 2019
README.md Highlight nightly builds in the README May 19, 2020
SECURITY.md add SECURITY.md May 18, 2020
ci.jsonnet Adapt benchmarks since the default inlining changed May 15, 2020
common.json Update to latest Native Image to get a JVM_* symbol linking fix on macOS May 29, 2020
utils.libsonnet Fix sulong vs graal and svm ordering and ensure it remains that way Mar 8, 2018
versions.json [GR-23185] Inline the Ruby version and revision directly as constants… May 11, 2020

README.md

TruffleRuby logo

TruffleRuby is the GraalVM high-performance implementation of the Ruby programming language built by Oracle Labs.

Getting started

There are three ways to install TruffleRuby releases and nightly builds:

  • Via GraalVM, which includes support for other languages such as JavaScript, R and Python and supports both the native and JVM configurations. Inside GraalVM will then be a bin/ruby command that runs TruffleRuby. We recommend that you use a Ruby manager to use TruffleRuby inside GraalVM.

  • Via your Ruby manager/installer (RVM, rbenv, chruby, ruby-build, ruby-install). This contains only TruffleRuby, in the native configuration, making it a smaller download. It is meant for users just wanting a Ruby implementation and already using a Ruby manager.

  • Using the standalone distribution as a simple binary tarball.

We recommend trying TruffleRuby nightly builds which contain the latest fixes and improvements:

RVM:    $ rvm install truffleruby-head
rbenv:  $ rbenv install truffleruby-dev
chruby: $ ruby-build truffleruby-dev ~/.rubies/truffleruby-dev

See the Ruby installers documentation for more details.

Testing TruffleRuby in CI is easy: on TravisCI, you can use:

language: ruby
rvm:
  - truffleruby # or truffleruby-head

And on GitHub Actions:

- uses: ruby/setup-ruby@v1
  with:
    ruby-version: truffleruby # or truffleruby-head

See Testing TruffleRuby in CI for more details and other CIs.

You can use gem and bundle to install Gems as normal.

Please report any issue you might find on GitHub.

Aim

TruffleRuby aims to:

  • Run idiomatic Ruby code faster
  • Run Ruby code in parallel
  • Boot Ruby applications in less time
  • Execute C extensions in a managed environment
  • Add fast and low-overhead interoperability with languages like Java, JavaScript, Python and R
  • Provide new tooling such as debuggers and monitoring that work across languages
  • All while maintaining very high compatibility with the standard implementation of Ruby

TruffleRuby Runtime Configurations

There are two main runtime configurations of TruffleRuby: Native and JVM which make different trade-offs.

Configuration: Native (--native, default) JVM (--jvm)
Time to start TruffleRuby about as fast as MRI startup slower
Time to get to peak performance faster slower
Peak performance (also considering GC) good best
Java host interoperability needs reflection configuration just works

To find out which runtime configuration is used, run ruby --version on the command line or check the value of RUBY_DESCRIPTION or TruffleRuby.native? in Ruby code. Runtime configurations are further detailed in Deploying TruffleRuby.

System compatibility

TruffleRuby is actively tested on these systems:

  • Oracle Linux 7
  • Ubuntu 18.04 LTS
  • Ubuntu 16.04 LTS
  • Fedora 28
  • macOS 10.14 (Mojave)
  • macOS 10.15 (Catalina)

You may find that TruffleRuby will not work if you severely restrict the environment, for example by unmounting system filesystems such as /dev/shm.

Dependencies

  • make and gcc for building C and C++ extensions.
  • libssl for the openssl C extension
  • zlib for the zlib C extension

Without these dependencies, many libraries including RubyGems will not work. TruffleRuby will try to print a nice error message if a dependency is missing, but this can only be done on a best effort basis.

You may also need to set up a UTF-8 locale.

See the contributor workflow document if you wish to build TruffleRuby from source.

Current status

We recommend that people trying TruffleRuby on their gems and applications get in touch with us for help.

TruffleRuby is progressing fast but is currently probably not ready for you to try running your full Rails application on. However it is ready for experimentation and curious end-users to try on their gems and smaller applications, and to send us reports of issues they find.

Migration from MRI

TruffleRuby should in most cases work as a drop-in replacement for MRI, but you should read about our compatibility.

Migration from JRuby

For many use cases TruffleRuby should work as a drop-in replacement for JRuby. However, our approach to integration with Java is different to JRuby so you should read our migration guide.

Documentation

Extensive user documentation is available in doc/user.

See our source code repository and contributor documentation to contribute to TruffleRuby. In particular, see the contributor workflow document for how to build and run TruffleRuby.

Contact

The best way to get in touch with us is to join the channel #truffleruby of the GraalVM Slack. You can also Tweet to @TruffleRuby, or email benoit.daloze@oracle.com.

Please report security vulnerabilities via the process outlined at reporting vulnerabilities guide, rather than by something public such as a GitHub issue or a Gitter conversation.

Mailing list

Announcements about GraalVM, including TruffleRuby, are made on the graal-dev mailing list.

Authors

The main authors of TruffleRuby ordered by first contribution are: Chris Seaton, Benoit Daloze, Kevin Menard, Petr Chalupa, Brandon Fish, Duncan MacGregor, Christian Wirth, Rafael França, Alan Wu, Nicolas Laurent, Carol Chen.

Security

See SECURITY.md for how to report security vulnerabilities to Oracle. For known vulnerabilities in Ruby, please refer to the known-cves.md file.

Licence

TruffleRuby is copyright (c) 2013-2019 Oracle and/or its affiliates, and is made available to you under the terms of any one of the following three licenses:

  • Eclipse Public License version 2.0, or
  • GNU General Public License version 2, or
  • GNU Lesser General Public License version 2.1.

See LICENCE.md, 3rd_party_licenses.txt and doc/legal/legal.md.

Attribution

TruffleRuby is a fork of JRuby, combining it with code from the Rubinius project, and also containing code from the standard implementation of Ruby, MRI.

You can’t perform that action at this time.