TruffleRuby is a high-performance implementation of the Ruby programming language. It aims to be fully compatible with the standard implementation of Ruby, MRI.
More information is available at https://github.com/oracle/truffleruby/blob/master/README.md.
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:
- Run C extensions marked as
rb_ext_ractor_safe()
orrb_ext_thread_safe()
in parallel (without the C extension lock) (#2136, @eregon).
Bug fixes:
- Fix
Range#cover?
on begin-less ranges and non-integer values (@nirvdrum, @rwstauner). - Fix
Time.new
with String argument and handle nanoseconds correctly (#3836, @andrykonchin). - Fix a possible case of infinite recursion when implementing
frozen?
in a native extension (@nirvdrum). - Fix parameters forwarding to a method call executed with
Kernel#eval
(@andrykonchin). - Fix segfaults in native extensions when the reference processing thread is interrupted and would
longjmp()
incorrectly (#3903, @eregon).
Compatibility:
- Support Timezone argument to
Time.{new,at}
andTime#{getlocal,localtime}
(#1717, @patricklinpl, @manefz, @rwstauner). - Updated to Ruby 3.3.7 (@andrykonchin).
- Implement
StringScanner#{peek_byte,scan_byte,scan_integer,named_captures}
methods (#3788, @andrykonchin). - Support String patterns in
StringScanner#{exist?,scan_until,skip_until,check_until,search_full}
methods (@andrykonchin). - Implement
ObjectSpace::WeakKeyMap
(#3681, @andrykonchin). - Fix
String#slice
called with negative offset (@andrykonchin). - Fix explicitly inherited
Struct
subclasses and don't provide#members
method (#3802, @andrykonchin). - Support Digest plugins (#1390, @nirvdrum).
- Joni has been updated from 2.2.1 to 2.2.6 (@andrykonchin).
- Fix numeric coercing when
#coerce
method is not public (#3848, @andrykonchin). - Fix
Kernel#raise
and don't overridecause
at exception re-raising (#3831, @andrykonchin). - Return a pointer with
#type_size
of 1 forPointer#read_pointer
(@eregon). - Fix
rb_str_locktmp()
andrb_str_unlocktmp()
to raiseFrozenError
when string argument is frozen (#3752, @andrykonchin). - Fix Struct setters to raise
FrozenError
when a struct is frozen (#3850, @andrykonchin). - Fix
Struct#initialize
when mixed positional and keyword arguments (#3855, @andrykonchin). - Fix
Integer.sqrt
for large values (#3872, @tompng). - Fix
Data#inspect
when data contains a recursive attribute (#3847, @andrykonchin). - Fix
StringIO#{gets,readline}
when it is called with both separator and limit to truncate the separator if the limit is exceeded (#3856, @andrykonchin). - Implement
rb_error_frozen_object
for the google-protobuf gem (@nirvdrum). - Adjust a
FrozenError
's message and add a receiver when a frozen module or class is modified (e.g. by defining or undefining an instance method or by defining a nested module (@andrykonchin). - Fix
Kernel#sprintf
and%p
format specification to produce"nil"
fornil
argument (#3846, @andrykonchin). - Reimplement
Data#with
to not callData.new
that can be removed or redefined (#3890, @andrykonchin).