Replies: 6 comments 4 replies
-
I'd like to also add tools like mutant need to support a wider range of ruby runtime versions. I'd not need 2.7 support as its as of this post EOL, but ideally YARP would support all non EOL versions from the same release. |
Beta Was this translation helpful? Give feedback.
-
I had opened an issue earlier about packaging gem by version (e.g. 3.2 support could be 32.0 -- just a proposal) and I think the result is we would address it later on when we got closer to being usable. For JRuby (and CRuby), we just need one version per release line but will have to support multiple language levels in parallel (3.1, 3.2, ...). This is tangential but I am just mentioning it because it is another use case of compatibilty and support (albeit a pretty simple one). My understanding is that YARP is going to start at 3.2 support. Obviously, to support your use cases there still needs to be a strategy but I think the oldest YARP version will be 3.2. |
Beta Was this translation helpful? Give feedback.
-
I think part of the initial thoughts from @kddnewton about this is newer Rubies simply accept more syntax than older versions, so to some extent it might be enough (?) to just use the latest version of the parser. |
Beta Was this translation helpful? Give feedback.
-
I'm imagining this will be solved with branches going forward. We're going to release the initial version with Ruby 3.3. At that point we'll create a tag (just like CRuby will) and backport issues as necessary. If you want to only parse Ruby 3.3, then you'll be able to link back to the shared library for version 3.3. |
Beta Was this translation helpful? Give feedback.
-
Coming back to this now that ruby 3.3 is out: 3.3 restricted multiple syntax cases, see this example. That means that ruby code running on < 3.3 which is perfectly valid couldn't be parsed using the 3.3.x parser. I think there will probably need to be some kind of versioning mechanism for rubocop, mutant, and other similar tools that want to be able to run on multiple versions of ruby. |
Beta Was this translation helpful? Give feedback.
-
Yeah we haven't solved this yet, but there is a new |
Beta Was this translation helpful? Give feedback.
-
How would
yarp
handle the various versions of ruby? So, for instance, inrubocop
you can set your target ruby version and it will only apply rules that matter to that ruby version. For example, targetting 2.7 and runningrubocop
(even though my local ruby version is 3.2) will give you:This is often different from the actual version of ruby that you are running. I assume other tools might have similar/related needs and also likely need easy ways of recognizing and tolerating different versions of the ASTs if they want to support multiple versions. I know that there will be versioned metadata based on the design document, but was curious about how this will be managed. See logic from
rubocop-ast
for an example of howparser
works.Beta Was this translation helpful? Give feedback.
All reactions