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
introduce --parser runtime flag #9167
Conversation
ee9457d
to
4d8147a
Compare
ractor_core.h
Outdated
@@ -186,6 +186,7 @@ struct rb_ractor_struct { | |||
VALUE r_stderr; | |||
VALUE verbose; | |||
VALUE debug; | |||
bool prism; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it should be global, not ractor local.
4db67a4
to
e12345c
Compare
I have been thinking about this change and if it should go in before or after 3.3.0. I want to have it in 3.3.0, but I worry that it might make a bad first impression for Prism. I worry that someone will turn on prism via this option and be disappointed and decide Prism is not good when they run into issues. If we get this in shortly after the 3.3.0 release and have all the time between then and 3.3.1 to test, we might be able to make a better first impression. I am open to whatever the team thinks is best, but right now I am nervous about including it in 3.3.0. |
My opinion is that we should not add features to tiny releases, only to minor ones. So if |
In that case, I think we should probably add this in 3.3.0. My hope is that there is a way to use prism optionally as the parser before 3.4.0. I would like to at least be testing with prism in CI regularly in 2024. |
I agree, I don't think we should add features in tiny releases. Given that we now compile all nodes and are just fixing bugs, I think we need to get this merged for 3.3.0 so that we're not stuck waiting for it for another year. The function of this flag is not for people to run it in production, the function is for us to gather feedback about what may or may not be breaking with people's code that we don't have access to. We need this flag for testing and I wouldn't want to add it in a tiny release. |
Sorry I just clicked the wrong button.... |
e12345c
to
b9fc078
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
b9fc078
to
74b1b5d
Compare
ruby.c
Outdated
else if (is_option_with_arg("parser", Qfalse, Qtrue)) { | ||
if (strcmp("prism", s) == 0) { | ||
(*rb_ruby_prism_ptr()) = true; | ||
rb_warn("The Prism compiler is currently experimental and compatibility with parse.y is not yet complete. Please report an issues you find on the prism issue tracker."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an issues
, should be without an
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that's meant to be any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah any issue
would also work
Introduce runtime flag for specifying the parser, ``` ruby --parser=prism ``` also update the description: ``` $ ruby --parser=prism --version ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384) +PRISM [x86_64-darwin23] ``` [Bug #20044]
74b1b5d
to
136fdaa
Compare
Co-authored-by: Ufuk Kayserilioglu <ufuk@paralaus.com>
test/ruby/test_rubyoptions.rb
Outdated
@@ -287,6 +287,19 @@ def test_rjit_version | |||
end | |||
end | |||
|
|||
def test_parser_flag | |||
warning = /The Prism compiler is currently experimental and compatibility with parse.y is not yet complete. Please report an issues you find on the prism issue tracker./ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message needs to be updated as well.
Introduce --parser runtime flag
also update the description:
Bug #20044