-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soft deprecation of the project? #1046
Comments
The real use case of this gem left for me is multi version capability. Prism is not shipped with all the ruby versions my use cases still have to support, basically all non EOL (MRI) rubies. If this gem where to stop supporting future ruby versions I'd be fine. Cannot speak for the rest of the ecosystem OFC. |
In general I think this is the right long-term direction, but I'm uncomfortable soft deprecating until we mirror the tree rewriting functionality, since so many consumers use that. I think it could be added to the Ruby API of Prism relatively easily, but I haven't had time to look into this yet. I'm not sure if there are any other APIs that I'm not thinking about, but that's the main one I know we are missing. |
Indeed. I don't see how we can deprecated One other question - if |
My initial thought was to stop doing it. At this point |
I think we need to put evolutionary pressure on and NOT release compatibility with new versions. |
I'm not super fond of measures that will be quite disruptive to the end users - to me it seems just wild to stop supporting something without providing a complete alternative for it. E.g. what happens if the rewriting is still not supported by Prism when Ruby 3.5 comes out?
Breaking existing apps is not exactly in the service of the community either. ;-) I'm not arguing that |
To play a bit of devils advocate here: How is not supporting a new future ruby release "breaking existing apps"? |
Okay, "causing problems for the existing apps". I'm fairly certain RuboCop's users won't be exactly happy if we tell them we don't really support newer Ruby releases for whatever reasons. :-) And I'm not sure that simply stopping work on Moving fully to Prism's native AST is going to be quite the time investment for many projects. I'd like for us to get there, but ideally I don't want us to be pressured into a timeline for this given that everyone working on RuboCop does this in their spare time. |
Is there a translation layer from prosm to this parsers AST somewhere? |
Prism supports AST translation for popular parsers: https://github.com/ruby/prism/tree/main/lib/prism/translation
I think, deprecating Parser as soon as
From my experience, adding new nodes could be done relatively easy (compared to upgrading the grammar and lexer). I see, how, in theory, we can use Prism for newer Ruby versions as a parser and a Parser-compatible AST builder. So, if we can keep Parser Ruby internals and APIs work in new Ruby versions (without providing the corresponding syntax support), that would smooth the transition. To sum up, I would treat soft-deprecation as follows: stop adding new |
Yes, that's more or less what I proposed (probably the word "deprecate" was a bit misleading). I'm not proposing to yank I personally never touched rewriting API, shouldn't it "just work" with an AST constructed by Prism's compatibility layer?
My understanding is that it shouldn't break anything. If you are on Ruby 3.3+ use Prism (probably with a compatibility layer but it will be a part of the tooling, fully transparent for end users), otherwise use legacy |
Yeah, it works right now. Well, at least, for Ruby Next. I think, what could be done in terms of ensuring this compatibility is to make it possible to run rewriter tests via Prism and the translation layer. I can take a look at this (since I've already done the same for Ruby Next). |
Is there an |
Truthfully I don't know if parse.y is going to be deprecated, or if that will happen any time soon at all. I imagine it could stick around for quite a long time. That being said, it is getting further away from strict bison/racc syntax, so I know it's quite a maintenance burden to hold on to.
I think this would work, but we will want to test the translation layer even more. I think there are issues with string escapes at the moment, but I'm not sure.
That would be really great.
I haven't managed to get it over the finish line yet, but yes https://github.com/ruby-syntax-tree/syntax_tree-prism is that work. It's almost done. |
Probably no, but I've found "untokenizer" made by @koic 😄 |
To me it seems that'd be quite painful, especially if Prism doesn't support specifying target Ruby versions. And by "break" I mostly refer to "break the way" things are happening right now, not so much actually breaking existing apps. (and force clients to take some steps to ensure their tools will work with future Rubies that are not supported by To summarize, for us the biggest problems right now are:
I'm guessing that @koic and @marcandre will have more to add on the subject. |
unfortunately not enough for my use case. @bbatsov Okay so I saw a world where All my use cases would be covered but not yours, curious if there are plans for a version target @kddnewton? |
I think the rewriter could definitely be included in |
Much of what @bbatsov has already said aligns with my own thoughts, and I completely agree with his perspective. Specifically, I also share concerns about the impact on RuboCop users who rely on the Parser gem. Direct Support for Prism Is Not StraightforwardFirst, I think the path to directly supporting Prism without going through For instance, node pattern would require new support to describe the Prism AST, which differs from that of the Parser gem AST. Moreover, ensuring a seamless transition for users likely means supporting existing implementations written using the traditional Parser gem AST in parallel. So, It's important to note that changes in AST programming will affect not only RuboCop core developers but also its gem users. And, node pattern is just one example, and there are some other aspects of design and implementation to consider. The Importance of
|
We have version targeting built into Prism right now (you can pass |
I'm personally not going to backport changes anymore. If you want to keep this project up-to-date feel free to do so. I can still bump versions for existing |
@iliabylich Fair enough. I definitely wouldn't expect you to be doing work you don't consider meaningful. I'm not sure who from our team has access to the repo, but it might be a good idea to make some of us co-maintainers, so we can keep supporting it as long as necessary for the needs of RuboCop. |
So, Prism is out and it's:
parser
)On the other side backporting changes to
parser
becomes more and more difficult. MRI doesn't use yacc/bison anymore, instead there's Lrama that is also an LALR(1) parser generator but it has more "syntax sugar" that Racc doesn't have, and so the grammar will diverge more and more over time. And if (or once)parse.y
is deprecated it will be even more complex to "translate" grammar changes.I personally believe that
parser
should be soft-deprecated. What do you guys think? @kddnewton @bbatsov @koic @palkan @marcandre @mbjAnd if you agree do you see anything we could do to
parser
to make transition easier?The text was updated successfully, but these errors were encountered: