Benoit Daloze

407 Followers
112 Following
138 Posts
Expert in dynamic language runtimes and JIT compilation, TruffleRuby lead, Rubyist.
Bloghttps://eregon.me/blog/

We’re pleased to announce that TruffleRuby 33.0.1 is now available. This is a bug fix release that notably adds support for structured event reporting in Rails 8.1 (and any other usage of Fiber storage). We’ve also addressed some non-UTF-8 encoding issues, Integer & Float ceil with negative precision, and mkmf.rb’s `—target-rbconfig`.

More details at:

https://github.com/truffleruby/truffleruby/releases/tag/graal-33.0.1

We recommend all TruffleRuby users upgrade. Available now in common Ruby installers.

Release TruffleRuby 33.0.1 · truffleruby/truffleruby

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

GitHub

@getajobmike @nirvdrum It's slow because it's a lot of code, about 5k lines of Ruby: https://github.com/djberg96/pr-zlib/blob/main/lib/pr/rbzlib.rb
And that would need to warmup and be JIT-compiled. Even after that it would still be slower than C due to richer Ruby semantics.
My take is low-level code like zlib are not a good fit for high-level languages.

Also direct translations from C to Ruby don't work so well, it'd need more work to be faster and more idiomatic.

pr-zlib/lib/pr/rbzlib.rb at main · djberg96/pr-zlib

A pure Ruby implementation of the zlib library. Contribute to djberg96/pr-zlib development by creating an account on GitHub.

GitHub
@getajobmike @nirvdrum A long time ago TruffleRuby used https://github.com/djberg96/pr-zlib (because of no support for C extensions back then). But it's much slower and not fully compatible, so we switched to the zlib extension as soon as feasible.

RE: https://ruby.social/@truffleruby/115889733907958716

This is a huge release for TruffleRuby. It’s our first under our new org.

If you’ve been hesitant about contributing because of the CLA, please note that we no longer have one. We can also release more frequently so please report bugs or open PRs.

TruffleRuby kicks off the year with a new website, a new release, and a blog post to go with it! 🎉
https://truffleruby.dev/blog/truffleruby-33-is-released
Many changes:
* New versioning
* Thread-safe Hash
* No system dependencies anymore
* Installs in 2 seconds
* Development is now fully in the open
TruffleRuby 33 is Released

TruffleRuby 33.0.0 is released and available on GitHub, in your favorite Ruby installer, and on Maven Central!

TruffleRuby
Consider Encoding::InvalidByteSequenceError instead of ArgumentError for not-multiple-of-width bytes in UTF-16/32 · Issue #4084 · truffleruby/truffleruby

See https://github.com/truffleruby/truffleruby/blob/5c85240d0f51254a1721327233ff9ba0619f4896/doc/user/compatibility.md#strings-in-utf-16-and-utf-32-encoding Currently it's an ArgumentError: $ ruby ...

GitHub

@alexanderadam Any opinion if an EncodingError would be better?

BTW I found that ` "a".force_encoding("UTF-16")` fails but that shouldn't since UTF-16 is a dummy encoding and now equivalent to BINARY: https://github.com/truffleruby/truffleruby/issues/4083

@alexanderadam It seems I get email notifications now (for the first time), yeah :)
@tekknolagi @mgaudet Not sure it has a name but I would consider that reasoning/technique to be part of deoptimization and the key benefit of it (vs an explicit check and handling the case it fails in JITed code). It's the "don't need to merge back after a failed guard because of deoptimization".

@alexanderadam It comes from https://github.com/truffleruby/truffleruby/blob/5c85240d0f51254a1721327233ff9ba0619f4896/src/main/java/org/truffleruby/language/methods/TranslateExceptionNode.java#L115-L116, which could be changed.

I think the initial idea for ArgumentError is e.g. passing UTF-16LE to e.g. encode or force_encoding is an invalid encoding argument in that context if the String has an odd number of bytes.

truffleruby/src/main/java/org/truffleruby/language/methods/TranslateExceptionNode.java at 5c85240d0f51254a1721327233ff9ba0619f4896 · truffleruby/truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM. - truffleruby/truffleruby

GitHub