TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
More information is available on the website: http://www.graalvm.org/ruby/
TruffleRuby comes in two standalone modes, native and jvm, for both Oracle GraalVM and Community Edition.
See the documentation for which release asset corresponds to what.
Changelog
New features:
- Updated to Ruby 3.2.2 (#3039, @eregon, @andrykonchin).
- TruffleRuby Native on Oracle GraalVM on Linux now uses the G1 garbage collector which is much faster (@eregon).
Bug fixes:
- Fix
Dir.globreturning blank string entry with leading**/in glob andbase:argument (@rwstauner). - Fix class lookup after an object's class has been replaced by
IO#reopen(@itarato, @nirvdrum, @eregon). - Fix
Marshal.loadand raiseArgumentErrorwhen dump is broken and is too short (#3108, @andrykonchin). - Fix
supermethod lookup for unbounded attached methods (#3131, @itarato). - Fix
Module#define_method(name, Method)to respectmodule_functionvisibility (#3181, @andrykonchin). - Fix stack overflow with
Kernel.requireandzeitwerk(#3224, @eregon). - Reimplement
IO.selectwithpoll(2)to support file descriptors >= 1024 (#3201, @eregon).
Compatibility:
- Fix
Hash#shiftwhen Hash is empty but has initial default value or initial default proc (#3039, @itarato). - Make
Array#shuffleproduce the same results as CRuby (@rwstauner). - Add
Process.argv0method (@andrykonchin). - Add support for array pattern matching. This is opt-in via
--pattern-matchingsince pattern matching is not fully supported yet. (#2683, @razetime). - Fix
Array#[]withArithmeticSequenceargument when step is negative (#3039, @itarato). - Fix
Range#sizeand returnnilfor beginningless Range when end isn't Numeric (#3039, @rwstauner). - Alias
String#-@toString#dedup(#3039, @itarato). - Fix
Pathname#relative_path_fromto convert string arguments to Pathname objects (@rwstauner). - Add
String#bytesplice(#3039, @itarato). - Add
String#byteindexandString#byterindex(#3039, @itarato). - Add implementations of
rb_proc_call_with_block,rb_proc_call_kw,rb_proc_call_with_block_kwandrb_funcall_with_block_kw(#3068, @andrykonchin). - Add optional
timeoutargument toThread::Queue#pop(#3039, @itarato). - Add optional
timeoutargument toThread::SizedsQueue#pop(#3039, @itarato). - Handle
long longand aliases inFiddle(#3128, @eregon). - Add
Module#refinements(#3039, @itarato). - Add
Refinement#refined_class(#3039, @itarato). - Add
rb_hash_new_capafunction (#3039, @itarato). - Fix
Encoding::Converter#primitive_convertand raiseFrozenErrorwhen a destination buffer argument is frozen (@andrykonchin). - Add
Module#undefined_instance_methods(#3039, @itarato). - Add
Thread.each_caller_location(#3039, @itarato). - Add
timeoutargument toThread::SizedQueue#push(#3039, @itarato). - Add
rb_syserr_newfunction (@rwstauner). - Add
Enumerator#product(#3039, @itarato). - Add
Module#const_added(#3039, @itarato). - Show the pointer size information (if available) in
FFI::Pointer#inspect(@nirvdrum). - Implement performance warnings (
Warning[:performance]) like in CRuby 3.3 (@eregon). - The output of
Marshal.dumpis now compatible with CRuby forRationalandComplexinstances (#3228, @eregon).
Performance:
- Improve
Truffle::FeatureLoader.loaded_feature_pathby removing expensive string ops from a loop. Speeds up feature lookup time (#3010, @itarato). - Improve
String#-@performance by reducing unnecessary data copying and supporting substring lookups (@nirvdrum) - Specialize
Array#<<and related methods appending elements per call site to have a single array storage strategy in the inline cache for most cases (@eregon).
Changes:
gu install $LANGUAGEis replaced bytruffleruby-polyglot-get $LANGUAGE, available in the TruffleRuby JVM standalone (@eregon).- The TruffleRuby
ScriptEngineimplementation is removed in favor of the generic ScriptEngine in GraalVM docs (@eregon).