oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.02k stars 185 forks source link

Avoid Env#asGuestValue for Truffle::Interop methods #2278

Open eregon opened 3 years ago

eregon commented 3 years ago

From discussion at https://github.com/oracle/truffleruby/issues/2257#issuecomment-785870837

For Truffle::Interop.source_location, [String, Integer] seems obvious.

For date/time-related InteropLibrary messages, it's not that clear, but at least we should treat foreign date+time+zone the same as Ruby's Time.

@fniephaus How do you actually use the result of asGuestValue? It seems not usable at all from https://github.com/oracle/truffleruby/issues/2257#issuecomment-785986474.

fniephaus commented 3 years ago

I must admit I don't understand why asGuestValue doesn't work. Is it because it considers visibility of packages? Anyway, we have our own wrapper class for exposing host objects in TruffleSqueak, which shamelessly exposes everything possible to guest languages.