Benoit Daloze

Results 1300 comments of Benoit Daloze

Thank you for reporting the issue. We need to look how JRuby supports that and if we can support the same or similar.

I found these docs about that feature in JRuby: https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby#reopening-java-classes https://kofno.wordpress.com/2007/02/24/monkey-patch-java-objects-from-jruby/ JRuby seems to create a Ruby Class for every Java Class (which is some memory overhead), when a Java...

As the JRuby wiki [says it](https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby#reopening-java-classes), modifications on the Ruby side are not visible to Java. And the extra methods are just stored in a Ruby class. > Perhaps behind...

OK I found the ConcurrentHashMap used for proxy classes in JRuby: https://github.com/jruby/jruby/blob/0635bb6605838c48c426db9b3cf351716eed0a16/core/src/main/java/org/jruby/util/collections/MapBasedClassValue.java https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/javasupport/JavaSupport.java#L113 https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/javasupport/Java.java#L417-L421 (this also shows there is a second ConcurrentHashMap lookup) It seems like JRuby can use ClassValue...

I will experiment with creating a Ruby Class for every foreign object which has a MetaObject (class), and see how well that works. It adds a hashmap lookup every time...

I have a very early, unoptimized, proof-of-concept for giving a Ruby class based on the foreign meta object qualified name at https://github.com/oracle/truffleruby/pull/3155 It needs more work, including a cache from...

On linux-amd64: ``` CRuby 3.1.3: $ ruby -ve "require 'bigdecimal'; p BigDecimal::VERSION; puts (BigDecimal('10.4') * 2).to_f" ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux] "3.1.1" 20.8 $ gem i bigdecimal $ ruby...

> Trying out truffleruby I encountered all the errors related to #1975. Which ones exactly? For instance https://github.com/oracle/truffleruby/issues/2002 seems very unlikely. Is it just this `puts (BigDecimal('10.4') * 2).to_f` example...

It sounds like a transient issue, probably not specific to TruffleRuby but might happen more often on TruffleRuby due to more optimizations for C extensions. Could you try on TruffleRuby...

> We think this might be an issue with the [asdf version manager](https://github.com/asdf-vm/asdf-ruby), which uses [ruby-build](https://github.com/rbenv/ruby-build) internally. > > Could that be? That's very unlikely. Maybe this is an issue...