Skip to content

Releases: oracle/truffleruby

TruffleRuby - GraalVM Community 23.0.0-preview1

28 Apr 12:51
Compare
Choose a tag to compare

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/

Changelog

New features:

  • Updated to Ruby 3.1.3 (#2733, @andrykonchin, @eregon).
  • foreign_object.is_a?(foreign_meta_object) is now supported (@eregon).
  • Foreign big integers are now supported and work with all Numeric operators (@eregon).

Bug fixes:

  • Ensure every parse node has a source section and fix the source section for ensure (#2758, @eregon).
  • Fix spawn(..., fd => fd) on macOS, it did not work due to a macOS bug (@eregon).
  • Fix rb_gc_register_address()/rb_global_variable() to read the latest value (#2721, #2734, #2720, @eregon).
  • Synchronize concurrent writes to the same StringIO (@eregon).
  • Fix StringIO#write(str) when str is of an incompatible encoding and position < buffer size (#2770, @eregon).
  • Fix rb_thread_fd_select() to correctly initialize fdset copies and handle the timeout (@eregon).
  • Fix TracePoint#inspect when it's called outside of a callback (@andrykonchin).
  • Fix Signal.trap when signal argument is not supported (#2774, @andrykonchin).
  • Fix Dir.mkdir and convert permissions argument to Integer (#2781, @andrykonchin).
  • Fix String#dump and use \u{xxxx} notation (with curly brackets) for characters that don't fit in \uxxxx (#2794, @andrykonchin).
  • Fix Marshal.dump when big Integer (that cannot be expressed with 4 bytes) is serialized (#2790, @andrykonchin).
  • Fix Array#pack and accept Numeric values when Float is expected (#2815, @andrykonchin).
  • Fix \P{} matching in regular expressions (#2798, @andrykonchin).
  • Fix constants lookup when BasicObject#instance_eval method is called with a String (#2810, @andrykonchin).
  • Don't trigger the method_added event when changing a method's visibility or calling module_function (@paracycle, @nirvdrum).
  • Fix rb_time_timespec_new function to not call Time.at method directly (@andrykonchin).
  • Fix StringIO#write to transcode strings with encodings that don't match the StringIO's external_encoding. (#2839, @flavorjones)
  • Fix processing of proc rest arguments located at the beginning if there are no actual arguments (#2921, @andrykonchin).
  • Fix Monitor#exit to raise ThreadError when monitor not owned by the current thread (#2922, @andrykonchin).
  • Fix MatchData#[] to support negative length argument (#2929, @andrykonchin).
  • Fix IO line reading calls when using a multi-byte delimiter (IO#{each,gets,readline,readlines,etc.}) (#2961, @vinistock, @nirvdrum).
  • Fix the exception type raised when type coercion raises a NoMethodError (#2903, @paracycle, @nirvdrum).
  • Fix Method and Proc #parameters method to return _ parameter name without synthetic suffix when there are multiple _ parameters (@paracycle).
  • Fixed errors in IRB when attempting to navigate beyond bounds in singleline mode (@rwstauner).

Compatibility:

  • Fix MatchData#[] when passed unbounded Range (#2755, @andrykonchin).
  • Updated rb_define_class, rb_define_class_under, and rb_define_class_id_under to allow class names that aren't valid in Ruby (#2739, @nirvdrum).
  • Fixed rb_gv_get so that it no longer implicitly creates global variables (#2748, @nirvdrum).
  • Added implementations of rb_gvar_val_getter and rb_define_virtual_variable (#2750, @nirvdrum).
  • Implement rb_warning_category_enabled_p to support the syntax_tree gem (#2764, @andrykonchin).
  • Fix desctructuring of a single block argument that implements #to_ary dynamically (#2719, @andrykonchin).
  • Fix Kernel#Complex and raise exception when an argument is formatted incorrectly (#2765, @andrykonchin).
  • Add #public?, #private? and #protected? methods for Method and UnboundMethod classes (@andrykonchin).
  • Add optional argument to Thread::Queue.new (@andrykonchin).
  • Support a module as the second argument of Kernel#load (@andrykonchin).
  • Improve argument validation in Struct#valies_at - raise IndexError or RangeError when arguments are out of range (#2773, @andrykonchin).
  • Fix MatchData#values_at and handling indices that are out of range (#2783, @andrykonchin).
  • Add support for %-z (UTC for unknown local time offset, RFC 3339) to Time#strftime (@andrykonchin).
  • Add support for UTC and A-Z utc offset values, as well as +/-HH, +/-HHMM, +/-HHMMSS (without :) (@andrykonchin).
  • Treat time with UTC, Z and -00:00 utc offset as UTC time (@andrykonchin).
  • Raise FrozenError when Time#localtime, Time#utc and Time#gmtime is called on a frozen time object (@andrykonchin).
  • Validate a microseconds argument used to create a time object (@andrykonchin).
  • Support accessing dmark and dfree fields for RData (#2771, @eregon).
  • Implement rb_enc_nth() (#2771, @eregon).
  • Support offset keyword argument for String#unpack and String#unpack1 (@andrykonchin).
  • Fix Process.detach and cast pid argument to Integer (#2782, @andrykonchin).
  • rb_to_id() should create a static ID, used by RMagick (@eregon).
  • Resolve the current user home even when $HOME is not set (#2784, @eregon)
  • Fix IO#lineno= and convert argument to Integer more strictly (#2786, @andrykonchin).
  • Fix argument implicit convertion in IO#pos= and IO#seek methods (#2787, @andrykonchin).
  • Warn about unknown directive passed to Array#pack in verbose mode (#2791, @andrykonchin).
  • Added constants IO::SEEK_DATE and IO::SEEK_HOLE (#2792, @andrykonchin).
  • Fix StringIO.new to accept keyword arguments (#2793, @andrykonchin).
  • Process#spawn should call #to_io on non-IO file descriptor objects (#2809, @jcouball).
  • Add constants IO::SEEK_DATE and IO::SEEK_HOLE (#2792, @andrykonchin).
  • Add Class#subclasses method (#2733, @andrykonchin).
  • Implement Coverage.running? method (@andrykonchin).
  • Fix arguments implicit type conversion for Enumerable#zip and Array#zip (#2788, @andrykonchin).
  • Fix Array#unshift to not depend on Array#[]= and allow overriding #[]= in a subclass (#2772, @andrykonchin).
  • Fix syntactic check for void value expression (#2821, @eregon).
  • Fix Range#step with no block and non-Numeric values (#2824, @eregon).
  • Fix execution order of END blocks and at_exit callbacks (#2818, @andrykonchin).
  • Fix String#casecmp? for empty strings of different encodings (#2826, @eregon).
  • Implement Enumerable#compact and Enumerator::Lazy#compact (#2733, @andrykonchin).
  • Implement Array#intersect? (#2831, @nirvdrum).
  • Record the source location in the constant for the module/class keywords (#2833, @eregon).
  • Fix File.open and support flags option (#2820, @andrykonchin).
  • Support writing to RData.dfree for native extensions (#2830, #2732, #2165, @eregon).
  • Fix IO#write and support multiple arguments with different encodings (#2829, @andrykonchin).
  • Fix Array methods reject, reject!, inject, map, select, each_index and handle a case when array is modified by a passed block like CRuby does (#2822, andrykonchin, @eregon).
  • Fix EncodingError exception message when Symbol has invalid encoding (#2850, @andrykonchin).
  • Raise EncodingError at parse time when Hash literal contains a Symbol key with invalid encoding (#2848, @andrykonchin).
  • Fix Array methods reject, reject!, inject, map, select, each_index and handle a case when array is modified by a passed block like CRuby does (#2822, @andrykonchin, @eregon).
  • Fix Array methods select! and keep_if and handle a case when exception is raised in a passed block properly (@andrykonchin).
  • Fix Enumerable methods each_cons and each_slice to return receiver (#2733, @horakivo)
  • Module methods #private, #public, #protected, #module_function now returns their arguments like in CRuby 3.1 (#2733, @horakivo)
  • Kernel#exit!, killing Fibers and internal errors do not run code in ensure clauses anymore, the same as CRuby (@eregon).
  • Implement UnboundMethod#original_name (@paracycle, @nirvdrum).
  • Implement Thread#native_thread_id method (#2733, @horakivo).
  • Modify Struct#{inspect,to_s} to match MRI when the struct is nested inside of an anonymous class or module (@st0012, @nirvdrum).
  • Fiber.current and Fiber#transfer are available without require 'fiber' like in CRuby 3.1 (#2733, @eregon).
  • Add freeze keyword argument to Marshal.load (#2733, @andrykonchin).
  • Add Integer.try_convert (#2733, @moste00, @eregon).
  • Support optional :in keyword argument for Time.now and Time.new (#2733, @andrykonchin).
  • Add optional Hash argument to Enumerable#tally (#2733, @andrykonchin).
  • Update $LOAD_PATH.resolve_feature_path to return nil instead of raising LoadError when feature isn't found (#2733, @andrykonchin).
  • Add objspace/trace file (#2733, @andrykonchin).
  • Add Process._fork (#2733, @horakivo).
  • Update to JCodings 1.0.58 and Joni 2.1.44 (@eregon).
  • Add MatchData#match and MatchData#match_length (#2733, @horakivo).
  • Add StructClass#keyword_init? method (#2377, @moste00).
  • Support optional level argument for File.dirname method (#2733, @moste00).
  • Add Thread::Backtrace.limit method (#2733, @andrykonchin).
  • Deprecate rb_gc_force_recycle and make it a no-op function (#2733, @moste00).
  • Add Refinement#import_methods method and add deprecation warning for Refinement#include and Refinement#prepend (#2733, @horakivo).
  • Upgrading UNICODE version to 13.0.0 and EMOJI version to 13.1 (#2733, @horakivo).
  • Add rb_io_maybe_wait_readable, rb_io_maybe_wait_writable and rb_io_maybe_wait functions (#2733, @andrykonchin).
  • StringIO#set_encoding should coerce the argument to an Encoding (#2954, @eregon).
  • Implement ch...
Read more

TruffleRuby - GraalVM Community Edition 22.3.1

24 Jan 15:53
Compare
Choose a tag to compare

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

Bug fixes:

  • Fix rb_thread_fd_select() to correctly initialize fdset copies and handle the timeout (@eregon).
  • Fix Marshal.dump when big Integer (that cannot be expressed with 4 bytes) is serialized (#2790, @andrykonchin).

TruffleRuby - GraalVM Community Edition 22.3.0

25 Oct 11:02
Compare
Choose a tag to compare

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).

TruffleRuby - GraalVM Community Edition 22.2.0

26 Jul 11:30
Compare
Choose a tag to compare

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:

Bug fixes:

  • Fix rb_id2name to ensure the native string will have the same lifetime as the id (#2630, @aardvark179).
  • Fix MatchData#[] exception when passing a length argument larger than the number of match values (#2636, @nirvdrum).
  • Fix MatchData#[] exception when supplying a large negative index along with a length argument (@nirvdrum).
  • Fix capacity computation for huge Hash (#2635, @eregon).
  • Fix aliased methods to return the correct owner when method is from a superclass (@bjfish).
  • Fix String#[Regexp, Integer] when the capture group exists but is not matched (@eregon).
  • Fix File.open mode string parsing when binary option is the third character (@bjfish).
  • Fix rb_scan_args_kw macro to avoid shadowing variables (#2649, @aardvark179).
  • Fix String#unpack("Z") to not advance after the null byte, like CRuby (#2659, @aardvark179).
  • Fix Float#round to avoid losing precision during the rounding process (@aardvark179).
  • Fix String#insert to not call a subclassed string method (@bjfish).
  • Fix rb_obj_call_init to pass any block argument to the initialize method (#2675, @aardvark179).
  • Fix issue with feature loading not detecting a previously loaded feature (#2677, @bjfish).
  • Fix /#{...}/o to evaluate only once per context when splitting happens (@eregon).
  • Fix Kernel#sprintf formatting of floats to be like CRuby (@aardvark179).
  • Fix Process.egid= to accept Strings (#2615, @ngtban)
  • Fix optional assignment to only evaluate index arguments once (#2658, @aardvark179).

Compatibility:

  • Updated to Ruby 3.0.3. The 3 CVEs did not affect TruffleRuby, this is to bring the stdlib and gem updates (@eregon).
  • Fix Marshal.dump to raise an error when an object has singleton methods (@bjfish).
  • Exception#full_message now defaults the order to :top like CRuby 3+ (@eregon).
  • Fix Process.wait2 to return nil when the WNOHANG flag is given and the child process is still running (@bjfish).
  • Disable most nokogiri C extension patches when system libraries are not being used (#2693, @aardvark179).
  • Implement rb_gc_mark_maybe and rb_global_variable to ensure VALUE stay live in C extensions (@aardvark179).
  • Implement rb_imemo_tmpbuf allocation for ripper (@aardvark179).
  • Implement inherit argument for Module#class_variables (#2653, @bjfish).
  • Fix Float#/ when dividing by Rational (@bjfish).
  • Process.euid= should accept String (#2615, @ngtban).
  • Fix instance_variable_get and instance_variable_set for immutable objects (@bjfish).
  • Thread#raise(exc, message) now calls exc.exception in the target thread like CRuby (@eregon).
  • Define Process::{CLOCK_BOOTTIME,CLOCK_BOOTTIME_ALARM,CLOCK_REALTIME_ALARM} (#1480, @eregon).
  • Improve support of :chomp keyword argument in IO and StringIO methods (#2650, @andrykonchin).
  • Implement specializations for immutable ruby objects for ObjectSpace methods (@bjfish).
  • Use $PAGER for --help and --help*, similar to CRuby (#2542, @Strech).
  • Ensure all headers are warnings-free (#2662, @eregon).
  • All IO instances should have T_FILE as their rb_type(), not only File instances (#2662, @eregon).
  • Make rb_fd_select retry on EINTR (#1584, @aardvark179).

Performance:

  • Reimplement Float#to_s for better performance (#1584, @aardvark179).
  • Improve reference processing by making C object free functions and other finalizers more lightweight (@aardvark179).
  • Improve performance of RSTRING_PTR for interned strings (@aardvark179).
  • Cache constant argument formats used with rb_scan_args_kw (@aardvark179).

Changes:

  • -Werror=implicit-function-declaration is now used for compiling C extensions to fail more clearly and earlier if a function is missing, like CRuby 3.2 (#2618, @eregon).
  • Disable thread pool for Fibers as it causes correctness issues (#2551, @eregon).

TruffleRuby - GraalVM Community Edition 22.1.0

26 Apr 10:34
Compare
Choose a tag to compare

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 exceptions are now fully integrated and have most methods of Exception (@eregon).
  • Foreign exceptions can now be rescued with rescue Polyglot::ForeignException or rescue foreign_meta_object (#2544, @eregon).

Bug fixes:

  • Guard against unterminated ranges in file matching patterns (#2556, @aardvark179).
  • Fixed rb_proc_new to return a proc that will pass all required arguments to C (#2556, @aardvark179).
  • Fixed String#split to return empty array when splitting all whitespace on whitespace (#2565, @bjfish).
  • Raise RangeError for Time.at(bignum) (#2580, @eregon).
  • Fix Integer#{<<,>>} with RHS bignum and long (@eregon).
  • Fix a resource leak from allocators defined in C extensions (@aardvark179).
  • SIGINT/Interrupt/Ctrl+C now shows the backtrace and exits as signaled, like CRuby (@eregon).
  • Update patch feature finding to prefer the longest matching load path (#2605, @bjfish).
  • Fix Hash#{to_s,inspect} for keys whose #inspect return a frozen String (#2613, @eregon).
  • Fix Array#pack with x* to not output null characters (#2614, @bjfish).
  • Fix Random#rand not returning random floats when given float ranges (#2612, @bjfish).
  • Fix Array#sample for [] when called without n and a Random is given (#2612, @bjfish).
  • Fix Module#const_get to raise a NameError when nested modules do not exist (#2610, @bjfish).
  • Ensure native VALUEs returned from C are unwrapped before the objects can be collected (@aardvark179).
  • Fix Enumerator::Lazy#with_index to start with new index for multiple enumerations (@bjfish).
  • Fix rb_id2name to ensure the native string will have the same lifetime as the id (#2630, @aardvark179).
  • Fix MatchData#[] exception when passing a length argument larger than the number of match values (#2636, @nirvdrum).
  • Fix MatchData#[] exception when supplying a large negative index along with a length argument (@nirvdrum).
  • Fix Integer#fdiv and Rational#to_f for large Integer values (#2631, @bjfish).

Compatibility:

  • Implement full Ruby 3 keyword arguments semantics (#2453, @eregon, @chrisseaton).
  • Implement ruby_native_thread_p for compatibility (#2556, @aardvark179).
  • Add rb_argv0 for the tk gem. (#2556, @aardvark179).
  • Implement more correct conversion of array elements by Array#pack(#2503, #2504, @aardvark179).
  • Implement Pathname#{empty?, glob} (#2559, @bjfish)
  • Fixed Rational('') to raise error like MRI (#2566, @aardvark179).
  • Freeze instances of Range but not subclasses, like CRuby (#2570, @MattAlp).
  • When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. (#2532, @gogainda).
  • Use #to_a for converting list in rescue *list (#2572, @eregon).
  • Implement 'rb_str_buf_append' (@bjfish).
  • Add patch for digest so that TruffleRuby implementation is not overridden (@bjfish).
  • Handle encoding conversion errors when reading directory entries (@aardvark179).
  • Follow symlinks when processing */ directory glob patterns. (#2589, @aardvark179).
  • Set @gem_prelude_index variable on the default load paths (#2586 , @bjfish)
  • Do not call IO#flush dynamically from IO#close (#2594, @gogainda).
  • Implement rb_str_new_static for C extensions that use it (@aardvark179).
  • Rewrote ArrayEachIteratorNode and re-introduced each specs for MRI parity when mutating arrays whilst iterating, rather than crashing (#2587, @MattAlp)
  • Update String#rindex to only accept Regexp or objects convertable to String as the first parameter (#2608, @bjfish).
  • Update String#<< to require one argument (#2609, @bjfish).
  • Update String#split to raise TypeError when false is given (#2606, @bjfish).
  • Update String#lstrip! to remove leading null characters (#2607, @bjfish).
  • Update File.utime to return the number of file names in the arguments (#2616, @bjfish).
  • Update Dir.foreach to accept an encoding parameter (#2627, @bjfish).
  • Update IO.readlines to ignore negative limit parameters (#2625 , @bjfish).
  • Update Math.sqrt to raise a Math::DomainError for negative numbers (#2621, @bjfish).
  • Update Enumerable#inject to raise an ArgumentError if no block or symbol are given (#2626, @bjfish).
  • Fix Marshal.dump to raise an error when an object has singleton methods (@bjfish).

Performance:

  • Increase dispatch limit for string library to handle mutable, immutable and non-strings (@aardvark179)
  • Switch to Arrays.mismatch() in string comparison for better performance (@aardvark179).
  • Removed extra array allocations for method calls in the interpreter to improve warmup performance (@aardvark179).
  • Optimize Dir[] by sorting entries as they are found and grouping syscalls (#2092, @aardvark179).
  • Reduce memory footprint by tracking VALUEs created during C extension init separately (@aardvark179).
  • Rewrote ArrayEachIteratorNode to optimize performance for a constant-sized array and reduce specializations to 1 general case (#2587, @MattAlp)
  • Reduce conversion of VALUEs to native handle during common operations in C extensions (@aardvark179).
  • Improved performance of regex boolean matches (e.g., Regexp#match?) by avoiding match data allocation in TRegex (#2588, @nirvdrum).
  • Remove overhead when getting using RDATA_PTR (@aardvark179).
  • Additional copy operations have been reduced when performing IO (#2536, @aardvark179).

Changes:

  • Foreign exceptions are no longer translated to RuntimeError but instead remain as foreign exceptions, see the documentation for how to rescue them (@eregon).

TruffleRuby - GraalVM Community Edition 22.0.0.2

25 Jan 14:29
Compare
Choose a tag to compare

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:

Bug fixes:

  • Fix File.utime to use nanoseconds (#2448, @bjfish).
  • Capture the intercepted feature path during patching to reuse during patch require (#2441, @bjfish).
  • Update Module#constants to filter invalid constant identifiers (#2452, @bjfish).
  • Fixed -0.0 <=> 0.0 and -0.0 <=> 0 to return 0 like on CRuby (#1391, @eregon).
  • Fixed Range#step to return correct class with begin-less range (@ccocchi, #2516).
  • Fixed exception creation when an Errno is sub-classed (@bjfish, #2521).
  • Fixed String#[]= to use the negotiated encoding (@bjfish, #2545).

Compatibility:

  • Implement rb_sprintf in our format compiler to provide consistent formatting across C standard libraries (@eregon).
  • Update defined? to return frozen strings (#2450, @bjfish).
  • Use compensated summation for {Array,Enumerable}#sum when floating point values are included (@eregon).
  • Module#attr_* methods now return an array of method names (#2498, @gogainda).
  • Fixed Socket#(local|remote)_address to retrieve family and type from the file descriptor (#2444, @larskanis).
  • Add Thread.ignore_deadlock accessor (#2453, @bjfish).
  • Allow Hash#transform_keys to take a hash argument (@ccocchi, #2464).
  • Add Enumerable#grep{_v} optimization for Regexp (#2453, @bjfish).
  • Update IO#write to accept multiple arguments (#2501, @bjfish).
  • Do not warn when uninitialized instance variable is accessed (#2502, @andrykonchin).
  • Remove TRUE, FALSE, and NIL constants like CRuby 3.0 (#2505, @andrykonchin).
  • Symbol#to_proc now returns a lambda like in Ruby 3 (#2508, @andrykonchin).
  • Kernel#lambda now warns if called without a literal block (#2500, @andrykonchin).
  • Implement Hash#except (#2463, @wildmaples).
  • Remove special $SAFE global and related C API methods (#2453, @bjfish).
  • Assigning to a numbered parameter raises SyntaxError (#2506, @andrykonchin).
  • Implement --backtrace-limit option (#2453, @bjfish).
  • Update String methods to return String instances when called on a subclass (#2453, @bjfish).
  • Update String#encode to support the :fallback option (#1391, @aardvark179).
  • Module#alias_method now returns the defined alias as a symbol(#2499, @gogainda).
  • Implement Symbol#name (#2453, @bjfish).
  • Update Module#{public, protected, private, public_class_method, private_class_method} and top-level private and public methods to accept single array argument with a list of method names (#2453, @bjfish).
  • Constants deprecated by Module#deprecate_constant only warn if Warning[:deprecated] is true (@eregon).
  • All Array methods now return Array instances and not subclasses (#2510, @Strech).
  • Integer#zero? overrides Numeric#zero? for optimization (#2453, @bjfish).
  • Default Kernel#eval source file and line to (eval):1 like CRuby 3 (#2453, @aardvark179).
  • Add GC.auto_compact accessors for compatibility (#2453, @bjfish).
  • Update accessing a class variable from the top-level scope to be a RuntimeError (#2453, @bjfish).
  • Update interpolated strings to not be frozen (#2453, @bjfish).
  • Add WERRORFLAG to RbConfig (#2519, @bjfish).
  • Update MatchData methods to return String instances when called on a subclass (#2453, @bjfish).
  • Implement Proc#{==,eql?} (#2453, @bjfish).
  • Implement all StringScanner methods (#2520, @eregon).
  • Handle Kernel#clone(freeze: true) (#2512, @andrykonchin).
  • Relax Fiber#transfer limitations (#2453, @bjfish).
  • Implement Fiber#blocking? like CRuby 3 (#2453, @aardvark179).
  • Sort by default for Dir.{glob,[]} and add sort: keyword argument (#2523, @Strech).
  • Implement rb_str_locktmp and rb_str_unlocktmp (#2524, @bjfish).
  • Update Kernel#instance_variables to return insertion order (@bjfish).
  • Fixed rb_path2class() to not error for a module (#2511, @eregon).
  • Update Kernel#print to print $_ when no arguments are given (#2531, @bjfish).
  • Add category kwarg to Kernel.warn and Warning.warn (#2533, @Strech).
  • Implement GC.{measure_total_time, total_time} and update GC.stat to update provided hash (#2535, @bjfish).
  • Implement Array#slice with ArithmeticSequence (#2526, @ccocchi).
  • Update Hash#each to consistently yield a 2-element array (#2453, @bjfish).
  • Remove Hash#{store, index} methods for compatibility (#2546, @bjfish).
  • Implement more correct conversion of array elements by Array#pack (#2503, #2504, @aardvark179).
  • Update String#split to raise a RangeError when limit is larger than int (@bjfish).

Performance:

  • Regexp objects are now interned in a similar way to symbols (@aardvark179).
  • Improve performance of regexps using POSIX bracket expressions (e.g., [[:lower:]]) matching against ASCII-only strings (#2447, @nirvdrum).
  • String#sub, sub!, gsub, and gsub! have been refactored for better performance (@aardvark179).
  • Don't allocate a MatchData object when Regexp#match? or String#match? is used (#2509, @nirvdrum).
  • Add ENV.except (#2507, @Strech).
  • Fully inline the Integer#+ and Integer#- logic for interpreter speed (#2518, @smarr).
  • Remove unnecessary work in negotiating the encoding to use in a Regexp match (#2522, @nirvdrum).
  • Add new fast paths for encoding negotiation between strings with different encodings, but which match common default cases (#2522, @nirvdrum).
  • Reduce footprint by removing unnecessary nodes for accessing the FrameOnStackMarker (#2530, @smarr).

Changes:

  • TruffleRuby now requires Java 11+ and no longer supports Java 8 (@eregon).

TruffleRuby - GraalVM Community Edition 21.3.0

19 Oct 14:21
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby 2.7.3, MRI.

The Ruby support is not available in GraalVM by default and should be installed: gu install ruby.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

  • TRegex is now used by default, which provides large speedups for matching regular expressions (@jirkamarsik).
  • Add Polyglot.languages to expose the list of available languages.
  • Add Polyglot::InnerContext to eval code in any available language in an inner isolated context (#2169, @eregon).
  • Foreign objects now have a dynamically-generated class based on their interop traits like ForeignArray and are better integrated with Ruby objects (#2149, @eregon and @rbotafogo).
  • Foreign arrays now have all methods of Ruby Enumerable and many methods of Array (#2149, @eregon and @rbotafogo).
  • Foreign hashes now have all methods of Ruby Enumerable and many methods of Hash (#2149).
  • Foreign iterables (InteropLibrary#hasIterator) now have all methods of Ruby Enumerable (#2149).
  • Foreign objects now implement #instance_variables (readable non-invocable members) and #methods (invocable members + Ruby methods).

Bug fixes:

  • Fix Marshal.load of multiple Symbols with an explicit encoding (#1624).
  • Fix rb_str_modify_expand to preserve existing bytes (#2392, @bjfish).
  • Fix String#scrub when replacement is frozen (#2398, @LillianZ).
  • Fix Dir.mkdir error handling for Pathname paths (#2397).
  • BasicSocket#*_nonblock(exception: false) now only return :wait_readable/:wait_writable for EAGAIN/EWOULDBLOCK like MRI (#2400).
  • Fix issue with strspn used in the date C extension compiled as a macro on older glibc and then missing the __strspn_c1 symbol on newer glibc (#2406).
  • Fix constant lookup when loading the same file multiple times (#2408).
  • Fix handling of break, next and redo in define_method(name, &block) methods (#2418).
  • Fix handling of incompatible types in Float#<=> (#2432, @chrisseaton).
  • Fix issue with escaping curly braces for Dir.glob (#2425).
  • Fix base64 decoding issue with missing output (#2435).
  • Fix StringIO#ungetbyte to treat a byte as a byte, not a code point (#2436, @aardvark179).
  • Fix defined?(yield) when used inside a block (#2446).
  • Fix a couple issues related to native memory allocation and release.
  • Capture the intercepted feature path during patching to reuse during patch require (#2441).

Compatibility:

  • Implement Process::Status.wait (#2378).
  • Update rb_str_modify and rb_str_modify_expand to raise a FrozenError when given a frozen string (#2392).
  • Implement rb_fiber_* functions (#2402).
  • Implement rb_str_vcatf.
  • Add support for tracing allocations from C functions (#2403, @chrisseaton).
  • Implement rb_str_catf.
  • Search the executable in the passed env PATH for subprocesses (#2419).
  • Accept a string as the pattern argument to StringScanner#scan and StringScanner#check (#2423).

Performance:

  • Moved most of MonitorMixin to primitives to deal with interrupts more efficiently (#2375).
  • Improved the performance of rb_enc_from_index by adding cached lookups (#2379, @nirvdrum).
  • Improved the performance of many MatchData operations (#2384, @nirvdrum).
  • Significantly improved performance of TRegex calls by allowing Truffle splitting (#2389, @nirvdrum).
  • Improved String#gsub performance by adding a fast path for the string_byte_index primitive (#2380, @nirvdrum).
  • Improved String#index performance by adding a fast path for the string_character_index primitive (#2383, @LillianZ).
  • Optimized conversion of strings to integers if the string contained a numeric value (#2401, @nirvdrum).
  • Use Truffle's ContextThreadLocal to speedup access to thread-local data.
  • Provide a new fast path for rb_backref* and rb_lastline*functions from C extensions.

Changes:

  • foreign_object.class on foreign objects is no longer special and uses Kernel#class (it used to return the java.lang.Class object for a Java type or getMetaObject(), but that is too incompatible with Ruby code).
  • Java.import name imports a Java class in the enclosing module instead of always as a top-level constant.
  • foreign_object.keys no longer returns members, use foreign_object.instance_variables or foreign_object.methods instead.
  • foreign_object.respond_to?(:class) is now always true (before it was only for Java classes), since the method is always defined.

Security:

TruffleRuby - GraalVM Community Edition 21.2.0.1

04 Aug 10:25
Compare
Choose a tag to compare

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

Bug fixes:

  • Fix issue with strspn used in the date C extension compiled as a macro on older glibc and then missing the __strspn_c1 symbol on newer glibc (#2406).

TruffleRuby - GraalVM Community Edition 21.2.0

20 Jul 15:25
Compare
Choose a tag to compare

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:

Bug fixes:

  • Fix of different values of self in different scopes (@entlicher).
  • Truffle::POSIX.select was being redefined repeatedly (#2332, @eregon).
  • Fix the --backtraces-raise and --backtraces-rescue options 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_expand to preserve existing bytes (#2392).
  • Fix Marshal.load of multiple Symbols with an explicit encoding (#1624).
  • Fix String#scrub when replacement is frozen (#2398, @LillianZ).

Compatibility:

  • Updated to Ruby 2.7.3. The resolv stdlib was not updated (resolv in 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#rehash to remove duplicate keys after modifications (#2266, @MattAlp)
  • Only fail rb_check_type for typed data, not wrapped untyped structs (#2331, @aardvark179).
  • Decide the visibility in Module#define_method based on self and the default definee (#2334).
  • Configure mandir value in RbConfig::CONFIG and RbConfig::MAKEFILE_CONFIG (#2315, @bjfish).
  • TruffleRuby now supports the Truffle polyglot Hash interop API (@norswap).
  • Implement Fiber#raise (#2338).
  • Update File.basename to return new String instances (#2343).
  • Allow Fiber#raise after Fiber#transfer like Ruby 3.0 (#2342).
  • Fix ObjectSpace._id2ref for Symbols and frozen String literals (#2358).
  • Implemented Enumerator::Lazy#filter_map (#2356).
  • Fix LLVM toolchain issue on macOS 11.3 (#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 comparing Infinity to other #infinite? values.
  • Implement date library as a C extension to improve compatibility (#2344).
  • Update rb_str_modify and rb_str_modify_expand to raise a FrozenError when given a frozen string (#2392).

Performance:

  • Make #dig iterative to make it faster and compile better for calls with 3+ arguments (#2301, @chrisseaton, @jantnovi).
  • Make Struct#dig faster 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_nonblock when no data is available to be read.
  • TruffleSafepoint is 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#strftime for 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 Ruby Array (#2089).

Changes:

  • rb_iterate() (deprecated since 1.9) no longer magically passes the block to rb_funcall(), use rb_block_call() instead.

Security:

TruffleRuby - GraalVM Community Edition 21.1.0

20 Apr 13:38
Compare
Choose a tag to compare

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 support can be added to GraalVM using the gu utility.
More information is available on the GraalVM website: https://www.graalvm.org/ruby/

Changelog

21.1.0

New features:

  • Access to local variables of the interactive Binding via language bindings is now supported: context.getBindings("ruby").putMember("my_var", 42); (#2030).
  • VALUEs in C extensions now expose the Ruby object when viewed in the debugger, as long as they have not been converted to native values (@aardvark179).
  • Signal handlers can now be run without triggering multi-threading (@eregon).
  • Fibers no longer trigger Truffle multi-threading.

Bug fixes:

  • Range#to_a wasn't working for long ranges (#2198, @tomstuart and @LillianZ).
  • Show the interleaved host and guest stacktrace for host exceptions (#2226).
  • Fix the label of the first location reported by Thread#backtrace_locations (#2229).
  • Fix Thread.handle_interrupt to defer non-pure interrupts until the end of the handle_interrupt block (#2219).
  • Clear and restore errinfo on entry and normal return from methods in C extensions (#2227).
  • Fix extra whitespace in squiggly heredoc with escaped newline (#2238, @wildmaples and @norswap).
  • Fix handling of signals with --single-threaded (#2265).
  • Fix Enumerator::Lazy#{chunk_while, slice_before, slice_after, slice_when} to return instances of Enumerator::Lazy (#2273, @bjfish).
  • Fix Truffle::Interop.source_location to return unavailable source sections for modules instead of null (#2257).
  • Fix usage of Thread.handle_interrupt in MonitorMixin#mon_synchronize.
  • Fixed TruffleRuby.synchronized to handle guest safepoints (#2277).
  • Fix control flow bug when assigning constants using ||= (#1489).
  • Fix Kernel#raise argument handling for hashes (#2298).
  • Set errinfo when rb_protect captures a Ruby exception (#2245).
  • Fixed handling of multiple optional arguments and keywords when passed a positional Hash (#2302).

Compatibility:

  • Prepend the GraalVM LLVM Toolchain to PATH when installing gems (#1974, #1088, #1343, #1400, #1947, #1931, #1588).
  • Installing the nokogiri gem now defaults to use the vendored libxml2 and libxslt, similar to CRuby, which means the corresponding system packages are no longer needed (#62).
  • Implemented $LOAD_PATH.resolve_feature_path.
  • Add Pathname#/ alias to Pathname#+ (#2178).
  • Fixed issue with large Integers in Math.log (#2184).
  • Updated Regexp.last_match to support Symbol and String parameter (#2179).
  • Added support for numbered block parameters (_1 etc).
  • Fixed String#upto issue with non-ascii strings (#2183).
  • Implemented partial support for pattern matching (#2186).
  • Make File.extname return '.' if the path ends with one (#2192, @tomstuart).
  • Include fractional seconds in Time#inspect output (#2194, @tomstuart).
  • Add support for Integer#[Range] and Integer#[start, length] (#2182, @gogainda).
  • Allow private calls with self as an explicit receiver (#2196, @wildmaples).
  • Fixed :perm parameter for File.write.
  • Implemented Time#floor and #ceil (#2201, @wildmaples).
  • Allow Range#include? and #member? with Time (#2202, @wildmaples).
  • Implemented Comparable#clamp(Range) (#2200, @wildmaples).
  • Added a Array#minmax to override Enumerable#minmax (#2199, @wildmaples).
  • Implemented chomp parameter for IO.{readlines, foreach} (#2205).
  • Implemented the Debug Inspector C API.
  • Added beginless range support for Range#{new, bsearch, count, each, equal_value, first, inspect, max, min, size, cover?, include?, ===}.
  • Added beginless range support for Array#{[], []=, slice, slice!, to_a, fill, values_at} (#2155, @LillianZ).
  • Added beginless range support for String#{byteslice, slice, slice!} and Symbol#slice (#2211, @LillianZ).
  • Added beginless range support for Kernel#{caller, caller_locations} and Thread#backtrace_locations (#2211, @LillianZ).
  • Make rand work with exclusive range with Float (#1506, @gogainda)
  • Fixed String#dump's formatting of escaped unicode characters (#2217, @meganniu).
  • Switched to the io-console C extension from C ruby for better performance and compatibility in irb.
  • Coerce the message to a String for BasicSocket#send (#2209, @HoneyryderChuck).
  • Support buffer argument for UDPSocket#recvfrom_nonblock (#2209, @HoneyryderChuck).
  • Fixed Integer#digits implementation to handle more bases (#2224, #2225).
  • Support the inherit parameter for Module#{private, protected, public}_method_defined?.
  • Implement Thread.pending_interrupt? and Thread#pending_interrupt? (#2219).
  • Implement rb_lastline_set (#2170).
  • Implemented Module#const_source_location (#2212, @tomstuart and @wildmaples).
  • Do not call File.exist? in Dir.glob as File.exist? is often mocked (#2236, @gogainda).
  • Coerce the inherit argument to a boolean in Module#const_defined? and Module#const_get (#2240).
  • Refinements take place at Object#method and Module#instance_method (#2004, @ssnickolay).
  • Add support for rb_scan_args_kw in C API (#2244, @LillianZ).
  • Update random implementation layout to be more compatible (#2234).
  • Set RbConfig::CONFIG['LIBPATHFLAG'/'RPATHFLAG'] like MRI to let $LIBPATH changes in extconf.rb work.
  • Access to path and mode via rb_io_t from C has been changed to improve compatibility for io-console.
  • Implemented the Time.at in: parameter.
  • Implemented Kernel#raise cause parameter.
  • Improved compatibility of Signal.trap and Kernel#trap (#2287, @chrisseaton).
  • Implemented GC.stat(:total_allocated_objects) as 0 (#2292, @chrisseaton).
  • ObjectSpace::WeakMap now supports immediate and frozen values as both keys and values (#2267).
  • Call divmod when coercion to Float fails for #sleep (#2289, @LillianZ).

Performance:

  • Multi-Tier compilation is now enabled by default, which improves warmup significantly.
  • Improve the performance of checks for recursion (#2189, @LillianZ).
  • Improve random number generation performance by avoiding synchronization (#2190, @ivoanjo).
  • We now create a single call target per block by default instead of two.
  • Some uses of class variables are now much better optimized (#2259, @chrisseaton).
  • Several methods that need the caller frame are now always inlined in their caller, which speeds up the interpreter and reduces footprint.
  • Pasting code in IRB should be reasonably fast, by updating to irb 1.3.3 and reline 0.2.3 (#2233).

Changes:

  • Standalone builds of TruffleRuby are now based on JDK11 (they used JDK8 previously). There should be no user-visible changes. Similarly, JDK11 is now used by default in development instead of JDK8.
  • The deprecated Truffle::System.synchronized has been removed.
  • Java.synchronized has been removed, it did not work on host objects.