TruffleRuby - GraalVM Community Edition 1.0 RC6
Pre-release
Pre-release
·
17816 commits
to master
since this release
TruffleRuby is high performance implementation of the Ruby programming language, compatible with MRI 2.4.4.
TruffleRuby is progressing fast but is currently probably not ready for you to try running your full Ruby application on. However it is ready for experimentation and curious end-users to try on their gems and smaller applications.
TruffleRuby runs Rails, and passes the majority of the Rails test suite. But it is missing support for Nokogiri and ActiveRecord database drivers which makes it not practical to run real Rails applications at the moment.
The Ruby language components can be installed in GraalVM using the gu utility.
Release Notes
New features:
Polyglot.export
can now be used with primitives, and will now convert
strings to Java, and.import
will convert them from Java.- Implemented
--encoding
,--external-encoding
,--internal-encoding
. rb_object_tainted
and similar C functions have been implemented.rb_struct_define_under
has been implemented.RbConfig::CONFIG['sysconfdir']
has been implemented.Etc
has been implemented (#1403).- The
-Xcexts=false
option disables C extensions. - Instrumentation such as the CPUSampler reports methods in a clearer way like
Foo#bar
,Gem::Specification.each_spec
,block in Foo#bar
instead of just
bar
,each_spec
,block in bar
(which is what MRI displays in backtraces). - TruffleRuby is now usable as a JSR 223 (
javax.script
) language. - A migration guide from JRuby (
doc/user/jruby-migration.md
) is now included. kind_of?
works as an alias foris_a?
on foreign objects.- Boxed foreign strings unbox on
to_s
,to_str
, andinspect
.
Bug fixes:
- Fix false-positive circular warning during autoload.
- Fix Truffle::AtomicReference for
concurrent-ruby
. - Correctly look up
llvm-link
alongclang
andopt
so it is no longer
needed to add LLVM toPATH
on macOS for Homebrew and MacPorts. - Fix
alias
to work when in a refinement module (#1394). Array#reject!
no longer truncates the array if the block raises an
exception for an element.- WeakRef now has the same inheritance and methods as MRI's version.
- Support
-Wl
linker argument for C extensions. Fixes compilation ofmysql2
andpg
. - Using
Module#const_get
with a scoped argument will now correctly
autoload the constant if needed. - Loaded files are read as raw bytes, rather than as a UTF-8 string and then
converted back into bytes. - Return 'DEFAULT' for
Signal.trap(:INT) {}
. Avoids a backtrace when quitting
a Sinatra server with Ctrl+C. - Support
Signal.trap('PIPE', 'SYSTEM_DEFAULT')
, used by the gemrouge
(#1411). - Fix arity checks and handling of arity
-2
forrb_define_method()
. - Setting
$SAFE
to a negative value now raises aSecurityError
. - The offset of
DATA
is now correct in the presence of heredocs. - Fix double-loading of the
json
gem, which led to duplicate constant
definition warnings. - Fix definition of
RB_NIL_P
to be early enough. Fixes compilation of
msgpack
. - Fix compilation of megamorphic interop calls.
Kernel#singleton_methods
now correctly ignores prepended modules of
non-singleton classes. Fixes loadingsass
whenactivesupport
is loaded.- Object identity numbers should never be negative.
Performance:
- Optimize keyword rest arguments (
def foo(**kwrest)
). - Optimize rejected (non-Symbol keys) keyword arguments.
- Source
SecureRandom.random_bytes
from/dev/urandom
rather than OpenSSL. - C extension bitcode is no longer encoded as Base64 to pass it to Sulong.
- Faster
String#==
using vectorization.
Changes:
- Clarified that all sources that come in from the Polyglot API
eval
method
will be treated as UTF-8, and cannot be re-interpreted as another encoding
using a magic comment. - The
-Xembedded
option can now be set set on the launcher command line. - The
-Xplatform.native=false
option can now load the core library, by
enabling-Xpolyglot.stdio
. $SAFE
andThread#safe_level
now cannot be set to1
- raising an error
rather than warning as before.-Xsafe
allows it to be set, but there are
still no checks.- Foreign objects are now printed as
#<Foreign:system-identity-hash-code>
,
except for foreign arrays which are now printed as#<Foreign [elements...]>
. - Foreign objects
to_s
now callsinspect
rather than Java'stoString
. - The embedded configuration (
-Xembedded
) now warns about features which may
not work well embedded, such as signals. - The
-Xsync.stdio
option has been removed - use standard Ruby
STDOUT.sync = true
in your program instead.