Closed bjfish closed 2 years ago
Some extra details: this is a pure-Ruby implementation of the gem using the GraalVM Polyglot API and inner contexts for isolation.
It uses the same interface as the C extension and reuses all the Ruby code in lib/
.
It does not use libv8-node
or C/C++ code.
This fixes https://github.com/oracle/truffleruby/issues/1827.
Wow, Amazing, thank you so much
I hope to get this reviewed early next week, @gschlager is super interested in fully testing this and he is back next week.
Amazing work, thanks heaps.
@lloeki plans to update our v8 version, when we do that I think we can announce a new release of mini_racer!
Could you write here when the new release is done? Then I can close https://github.com/oracle/truffleruby/issues/1827. (I subscribed to this repo's releases but I think it doesn't notify for tags)
Just cut a new release @eregon , is it working on truffle?
Thanks! Yes it works:
$ TRUFFLERUBYOPT="--jvm --polyglot" ruby -rmini_racer -ve 'ctx = MiniRacer::Context.new; p ctx.eval "1 + []"'
truffleruby 22.3.0-dev-4054469b, like ruby 3.0.3, GraalVM CE JVM [x86_64-linux]
"1"
The warnings when --jvm --polyglot
are not passed aren't working correctly though, I'll look at that.
EDIT: that's fixed.
This PR implements mini_racer for TruffleRuby using the GraalVM's JavaScript implementation.
It can be run locally using:
A previous PR with some code review is here: https://github.com/bjfish/mini_racer/pull/1
cc: @eregon