Skip to content

TruffleRuby - GraalVM Community Edition 20.0.0

Compare
Choose a tag to compare
@ezzarghili ezzarghili released this 18 Feb 19:07
· 13141 commits to master since this release

TruffleRuby is a high-performance implementation of the Ruby programming language 2.6.5. More information is available on the GraalVM website. Changes in 20.0.0 (from the project changelog):

New features:

  • Enable and document --coverage option (#1840, @chrisseaton).
  • Update the internal LLVM toolchain to LLVM 9 and reduce its download size.
  • Updated to Ruby 2.6.5 (#1749, @eregon).
  • Automatically set PKG_CONFIG_PATH as needed for compiling OpenSSL on macOS (#1830).

Bug fixes:

  • Fix Tempfile#{size,length} when the IO is not flushed (#1765, @rafaelfranca).
  • Dump and load instance variables in subclasses of Exception (#1766, @rafaelfranca).
  • Fix Date._iso8601 and Date._rfc3339 when the string is an invalid date (#1773, @rafaelfranca).
  • Fail earlier for bad handle unwrapping (#1777, @chrisseaton).
  • Match out of range ArgumentError message with MRI (#1774, @rafaelfranca)
  • Raise Encoding::CompatibilityError with incompatible encodings on Regexp (#1775, @rafaelfranca).
  • Fixed interactions between attributes and instance variables in Struct (#1776, @chrisseaton).
  • Coercion fixes for TCPServer.new (#1780, @XrXr)
  • Fix Float#<=> not calling coerce when other argument responds to it (#1783, @XrXr).
  • Do not warn / crash when requiring a file that sets and trigger autoload on itself (#1779, @XrXr).
  • Strip trailing whitespaces when creating a BigDecimal with a String (#1796, @XrXr).
  • Default close_others in Process.exec to false like Ruby 2.6 (#1798, @XrXr).
  • Don't clone methods when setting method to the same visibility (#1794, @XrXr).
  • BigDecimal() deal with large rationals precisely (#1797, @XrXr).
  • Make it possible to call instance_exec with rb_block_call (#1802, @XrXr).
  • Check for duplicate members in Struct.new (#1803, @XrXr).
  • Process::Status#to_i return raw waitpid(2) status (#1800, @XrXr).
  • Process#exec: set close-on-exec to false for fd redirection (#1805, @XrXr, @rafaelfranca).
  • Building C extensions should now work with frozen string literals (#1786, @aardvark179).
  • Keep the Truffle working directory in sync with the native working directory.
  • Rename to_native to polyglot_to_native to match polyglot_pointer? and polyglot_address methods.
  • Fixed missing partial evaluation boundary in Array#{sort,sort!} (#1727).
  • Fixed the class of self and the wrapping Module for Kernel#load(path, wrap=true) (#1739).
  • Fixed missing polyglot type declaration for RSTRING_PTR to help with native/managed interop.
  • Fixed Module#to_s and Module#inspect to not return an extra #<Class: for singleton classes.
  • Arrays backed by native storage now allocate the correct amount of memory (#1828).
  • Fixed issue in ConditionVariable#wait that could lose a ConditionVariable#signal.
  • Do not expose TruffleRuby-specific method Array#swap (#1816, @pitr-ch)
  • Fixed #inspect on broken UTF-8 sequences (#1842, @chrisseaton).
  • Truffle::Interop.keys should report methods of String and Symbol (#1817)
  • Kernel#sprintf encoding validity has been fixed (#1852, @XrXr).
  • Fixed ArrayIndexOutOfBoundsException in File.fnmatch (#1845, @bjfish).
  • Make String#concat work with no or multiple arguments (#1519, @norswap).
  • Make Array#concat work with no or multiple arguments (#1519, @norswap).
  • Coerce BigDecimal(arg) using to_str (#1826).
  • Fixed NameError#dup, NoMethodError#dup, and SystemCallError#dup to copy internal fields.
  • Make Enumerable#chunk work without a block (#1518).
  • Fixed issue with SystemCallError.new setting a backtrace too early.
  • Fixed BigDecimal#to_s formatting issue (#1711).
  • Run END keyword block only once at exit.
  • Implement Numeric#clone to return self.
  • Fixed Symbol#to_proc to create a Proc with nil source_location (#1663).
  • Make GC.start work with keyword arguments.
  • Fixed Kernel#clone for nil, true, false, Integer, and Symbol.
  • Make top-level methods available in Context#getBindings() (#1838).
  • Made Kernel#caller_locations accept a range argument, and return nil when appropriate.
  • Made rb_respond_to work with primitives (#1869, @chrisseaton).
  • Fixed issue with missing backtrace for rescue $ERROR_INFO (#1660).
  • Fixed Struct#hash for keyword_init: true Struct.
  • Fixed String#{upcase!,downcase!,swapcase!}(:ascii) for non-ASCII-compatible encodings like UTF-16.
  • Fixed String#capitalize! for strings that weren't full ASCII.
  • Fixed enumeration issue in ENV.{select, filter}.
  • Fixed Complex and Rational should be frozen after initializing.
  • Fixed printf should raise error when not enough arguments for positional argument.
  • Removed "shadowing outer local variable" warning.
  • Fixed parameter conversion to String in ENV methods.
  • Fixed deprecation warning when ENV.index is called.
  • Fixed issue with ENV.each_key.
  • Fixed ENV.replace implementation.
  • Fixed ENV.udpate implementation.
  • Fixed argument handling in Kernel.printf.
  • Fixed character length after conversion to binary from a non-US-ASCII String.
  • Fixed issue with installing latest bundler (#1880).
  • Fixed type conversion for Numeric#step step parameter.
  • Fixed Kernel#Integer conversion.
  • Fixed IO.try_convert parameter conversion.
  • Fixed linking of always-inline C API functions with -std=gnu90 (#1837, #1879).
  • Avoid race conditions during gem install by using a single download thread.
  • RSTRING_PTR() now always returns a native pointer, resolving two bugs memcpying to (#1822) and from (#1772) Ruby Strings.
  • Do not use gems precompiled for MRI on TruffleRuby (#1837).

Compatibility:

  • Implemented String#start_with?(Regexp) (#1771, @dimameshcharakou).
  • Various improvements to SignalException and signal handling (#1790, @XrXr).
  • Implemented rb_utf8_str_new, rb_utf8_str_new_cstr, rb_utf8_str_new_static (#1788, @chrisseaton).
  • Implemented the unit argument of Time.at (#1791, @XrXr).
  • Implemented keyword_init: true for Struct.new (#1789, @XrXr).
  • Implemented MatchData#dup (#1792, @XrXr).
  • Implemented a native storage strategy for Array to allow better C extension compatibility.
  • Implemented rb_check_symbol_cstr (#1814).
  • Implemented rb_hash_start (#1841, @XrXr).
  • JCodings has been updated from 1.0.42 to 1.0.45.
  • Joni has been updated from 2.1.25 to 2.1.30.
  • Implemented Method#<< and Method#>> (#1821).
  • The .bundle file extension is now used for C extensions on macOS (#1819, #1837).
  • Implemented Comparable#clamp (#1517).
  • Implemented rb_gc_register_mark_object and rb_enc_str_asciionly_p (#1856, @chrisseaton).
  • Implemented rb_io_set_nonblock (#1741).
  • Include the major kernel version in RUBY_PLATFORM on macOS like MRI (#1860, @eightbitraptor).
  • Implemented Enumerator::Chain, Enumerator#+, and Enumerable#chain (#1859, #1858).
  • Implemented Thread#backtrace_locations and Exception#backtrace_locations (#1556).
  • Implemented rb_module_new, rb_define_class_id, rb_define_module_id, (#1876, @XrXr, @chrisseaton).
  • Implemented -n CLI option (#1532).
  • Cache the Symbol of method names in call nodes only when needed (#1872).
  • Implemented rb_get_alloc_func and related functions (#1874, @XrXr).
  • Implemented rb_module_new, rb_define_class_id, rb_define_module_id, (#1876, @chrisseaton).
  • Implemented ENV.slice.
  • Support for the Darkfish theme for RDoc generation has been added back.
  • Implemented Kernel#system exception: true option.
  • Implemented Random.bytes.
  • Implemented Random.random_number.
  • Added the ability to parse endless ranges.
  • Made Range#to_a compatible with endless ranges.
  • Made Array#[] and Array#[]= compatible with endless ranges.

Performance:

  • Use a smaller limit for identity-based inline caches to improve warmup by avoiding too many deoptimizations.
  • long[] array storage now correctly declare that they accept int values, reducing deoptimisations and promotions to Object[] storage.
  • Enable inline caching of Symbol conversion for rb_iv_get and rb_iv_set.
  • rb_type information is now cached on classes as a hidden variable to improve performance.
  • Change to using thread local buffers for socket calls to reduce allocations.
  • Refactor IO.select to reduce copying and optimisation boundaries.
  • Refactor various String and Rope nodes to avoid Truffle performance warnings.
  • Reading caller frames should now work in more cases without deoptimisation.