oracle / truffleruby

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

Home Page:https://www.graalvm.org/ruby/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace Ripper with Prism's Ripper compatibility layer

andrykonchin opened this issue · comments

Replace Ripper C code with Prism::Translation::Ripper implementation.

Adding some notes: ruby/prism#2354 (comment) so the Prism Ripper compat should be mostly complete.
So it'd be worth to try using Prism to replace Ripper in TruffleRuby.
That'd need shipping the Ruby sources of Prism in TruffleRuby as well, probably best as a default gem like in CRuby 3.3 so it can be upgraded and e.g. there is no issue when loading Prism gem + Ripper.
So maybe best done after importing Ruby 3.3 sources, OTOH Prism in Ruby 3.3.0 is too old, so seems no need to wait.
Probably we should have a script to copy the files from the prism repo to places that make sense for a default gem, i.e. similar places for other default gems.

Regarding which libprism to use we should just use the one from the gem, because the Ruby code depends on it, so it's necessary. Also there is a the syntax version in Prism which should be enough to guarantee Ripper returns something that's the same version as RUBY_VERSION.