Skip to content

TruffleRuby - GraalVM Community Edition 22.3.0

Compare
Choose a tag to compare
@ezzarghili ezzarghili released this 25 Oct 11:02
· 3380 commits to master since this release

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:

  • Foreign strings now have all methods of Ruby String. They are treated as #frozen? UTF-8 Ruby Strings (@eregon).
  • Add Java.add_to_classpath method to add jar paths at runtime (#2693, @bjfish).
  • Add support for Ruby 3.1's Hash shorthand/punning syntax (@nirvdrum).
  • Add support for Ruby 3.1's anonymous block forwarding syntax (@nirvdrum).
  • Added the following keyword arguments to Polyglot::InnerContext.new: languages, language_options, inherit_all_access, code_sharing (@eregon).

Bug fixes:

  • Fix StringIO to set position correctly after reading multi-byte characters (#2207, @aardvark179).
  • Update Process methods to use module_function (@bjfish).
  • Fix File::Stat's #executable? and #executable_real? predicates that unconditionally returned true for a superuser (#2690, @andrykonchin).
  • The strip option --keep-section=.llvmbc is not supported on macOS (#2697, @eregon).
  • Disallow the marshaling of polyglot exceptions since we can't properly reconstruct them (@nirvdrum).
  • Fix String#split missing a value in its return array when called with a pattern of " " and a limit value > 0 on a string with trailing whitespace where the limit hasn't been met (@nirvdrum).
  • Fix Kernel#sleep and Mutex#sleep for durations smaller than 1 millisecond (#2716, @eregon).
  • Fix IO#{wait,wait_readable,wait_writable} with a timeout > INT_MAX seconds (@eregon).
  • Use the compatible encoding for String#{sub,gsub,index,rindex} (#2749, @eregon).

Compatibility:

  • Fix Array#fill to raise TypeError instead of ArgumentError when the length argument is not numeric (#2652, @andrykonchin).
  • Warn when a global variable is not initialized (#2595, @andrykonchin).
  • Fix escaping of / by Regexp#source (#2569, @andrykonchin).
  • Range literals of integers are now created at parse time like in CRuby (#2622, @aardvark179).
  • Fix IO.pipe - allow overriding IO.new that is used to create new pipes (#2692, @andrykonchin).
  • Fix exception message when there are missing or extra keyword arguments - it contains all the missing/extra keywords now (#1522, @andrykonchin).
  • Always terminate native strings with enough \0 bytes (#2704, @eregon).
  • Support #dup and #clone on foreign strings (@eregon).
  • Fix Regexp.new to coerce non-String arguments (#2705, @andrykonchin).
  • Fix Kernel#sprintf formatting for %c when used non-ASCII encoding (#2369, @andrykonchin).
  • Fix Kernel#sprintf argument casting for %c (@andrykonchin).
  • Implement the rb_enc_strlen function for use by native extensions (@nirvdrum).
  • Match tag values used by rb_protect and rb_jump_tag for the tk gem (#2556, @aardvark179).
  • Implement rb_eval_cmd_kw to support the tk gem (#2556, @aardvark179).
  • Fix rb_class2name to call inspect on anonymous classes like in CRuby (#2701, @aardvark179).
  • Implement rb_ivar_foreach to iterate over instance and class variables like in CRuby (#2701, @aardvark179).
  • Fix the absolute path of the main script after chdir (#2709, @eregon).
  • Fix exception for Fiddle::Handle.new with a missing library (#2714, @eregon).
  • Fix arguments implicit type conversion for BasicObject#instance_eval, Module#class_eval, Module#module_eval, Module#define_method (@andrykonchin).
  • Raise ArgumentError unconditionally when Proc.new is called without a block argument (@andrykonchin).
  • Fix UnboundMethod#hash to not depend on a module it was retrieved from (#2728, @andrykonchin).

Performance:

  • Replace a call of -"string" with frozen string literal at parse time (@andrykonchin).
  • Report polymorphism inside Hash#[] to recover performance (@aardvark179).
  • Improved interpreter performance by optimizing for better host inlining (@eregon).
  • Use poll instead of select for simple IO waiting to reduce overheads (#1584, @aardvark179).
  • TruffleString is now used to represent Ruby Strings which is faster can be shared with no overhead between languages (see details) (#2663, @eregon, @nirvdrum, @wildmaples, @andrykonchin).

Changes:

  • No more conversion between Java Strings and Ruby Strings at the interop boundary (@eregon).
  • Removed Truffle::Interop.{import_without_conversion,export_without_conversion} (use Polyglot.{import,export} instead).
  • Removed Truffle::Interop.members_without_conversion (use Truffle::Interop.members instead).
  • Refactored internals of rb_sprintf to simplify handling of VALUEs in common cases (@aardvark179).
  • Refactored sharing of array objects between threads using new SharedArrayStorage (@aardvark179).

Security:

  • The native access permission is now properly checked before any native pointer (e.g. Truffle::FFI::Pointer) is created (@eregon).