TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the
gu utility.More information is available on the website: http://www.graalvm.org/ruby/
Changelog
New features:
- New
TruffleRuby::ConcurrentMapdata structure for use inconcurrent-ruby(#2339, @wildmaples).
Bug fixes:
- Fix of different values of self in different scopes.
Truffle::POSIX.selectwas being redefined repeatedly (#2332).
- Fix the
--backtraces-raiseand--backtraces-rescueoptions in JVM mode (#2335).
- Fix
File.{atime, mtime, ctime}to include nanoseconds (#2337).
- Fix
Array#[a, b] = "frozen string literal".freeze(#2355).
rb_funcall()now releases the C-extension lock (similar to MRI).
- Fix
rb_str_modify_expandto preserve existing bytes (#2392).
- Fix
Marshal.loadof multipleSymbolswith an explicit encoding (#1624).
- Fix
String#scrubwhen replacement is frozen (#2398, @LillianZ).
Compatibility:
- Updated to Ruby 2.7.3. The
resolvstdlib was not updated (resolvin 2.7.3 has bugs).
- Make interpolated strings frozen for compatibility with Ruby 2.7 (#2304, @kirs).
require 'socket'now also requires'io/wait'like CRuby (#2326).
- Support precision when formatting strings (#2281, @kirs).
- Make rpartition compatible with Ruby 2.7 (#2320, @gogainda).
- Include the type name in exception messages from
rb_check_type(#2307).
- Fix
Hash#rehashto remove duplicate keys after modifications (#2266, @MattAlp)
- Only fail
rb_check_typefor typed data, not wrapped untyped structs (#2331).
- Decide the visibility in
Module#define_methodbased onselfand the default definee (#2334).
- Configure
mandirvalue inRbConfig::CONFIGandRbConfig::MAKEFILE_CONFIG(#2315).
- TruffleRuby now supports the Truffle polyglot Hash interop API.
- Implement
Fiber#raise(#2338).
- Update
File.basenameto return newStringinstances (#2343).
- Allow
Fiber#raiseafterFiber#transferlike Ruby 3.0 (#2342).
- Fix
ObjectSpace._id2reffor Symbols and frozen String literals (#2358).
- Implemented
Enumerator::Lazy#filter_map(#2356).
- Fix LLVM toolchain issue on macOS 10.13 (#2352, oracle/graal#3383).
- Implement
IO#set_encoding_by_bom(#2372, pawandubey).
- Implemented
Enumerator::Lazy#with_index(#2356).
- Implement
rb_backref_set.
- Fix
Float#<=>when comparingInfinityto other#infinite?values.
- Implement
datelibrary as a C extension to improve compatibility (#2344).
- Update
rb_str_modifyandrb_str_modify_expandto raise aFrozenErrorwhen given a frozen string (#2392).
Performance:
- Make
#digiterative to make it faster and compile better for calls with 3+ arguments (#2301, @chrisseaton, @jantnovi).
- Make
Struct#digfaster in interpreter by avoiding exceptions (#2306, @kirs).
- Reduce the number of AST nodes created for methods and blocks (#2261).
- Fiber-local variables are much faster now by using less synchronization.
- Improved the performance of the exceptional case of
String#chr(#2318, @chrisseaton).
- Improved the performance of
IO#read_nonblockwhen no data is available to be read.
TruffleSafepointis now used instead of custom logic, which no longer invalidates JITed code for guest safepoints (e.g.,Thread#{backtrace,raise,kill},ObjectSpace, etc)
- Significantly improved performance of
Time#strftimefor common formats (#2361, @wildmaples, @chrisseaton).
- Faster solution for lazy integer length (#2365, @lemire, @chrisseaton).
- Speedup
rb_funcallv*()by directly unwrapping the C arguments array instead of going through a RubyArray(#2089).
Changes:
rb_iterate()(deprecated since 1.9) no longer magically passes the block torb_funcall(), userb_block_call()instead.
Security:
- Updated to Ruby 2.7.3 to fix CVE-2021-28965 and CVE-2021-28966.