From: "HParker (Adam Hess) via ruby-core" Date: 2023-12-06T01:59:12+00:00 Subject: [ruby-core:115599] [Ruby master Bug#20044] Add runtime flag and environment variable for prism Issue #20044 has been updated by HParker (Adam Hess). I am happy to adopt any direction the core team likes for this proposal, but to attempt answers to @mame's questions, I would suggest, > What to do with the command-line option when prism becomes the default parser in the future. I believe we can safely begin ignoring the environment variable when prism becomes the default parser without any work (just deleting code). I think deprecating the runtime flag version with a message is reasonable one release after it becomes the default, but I don't have a strong opinion here and I defer to whatever Ruby has typically done in the past. > What are the appropriate names. I was unaware of this naming convention and I believe in the first release including prism as an option, this should be targeted towards people who are sure this is what they want. My intention with this change is to allow those interested in testing prism to begin doing that. I would like to integrate it into CI and begin testing Ruby HEAD with it enabled when that becomes possible. > Whether to print a warning when this mode is used. I am conflicted on this. `RubyVM::InstructionSequence.compile_prism` does not outputs a warning. I suspect using Prism as your default parser is **more** experimental than using prism via this API, but I am not sure how much more experimental. I suspect if we plan to remove the flag, at least using the flag should warn, but I don't have strong feelings about this either. ---------------------------------------- Bug #20044: Add runtime flag and environment variable for prism https://bugs.ruby-lang.org/issues/20044#change-105529 * Author: HParker (Adam Hess) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- To enable prism to be used as the parser when running Ruby code, I would like to add a runtime flag and environment variable that allow it to be enabled. The flags could be, ``` ruby --prism test.rb ``` and the environment variable could be, ``` RUBY_PRISM=1 ruby test.rb ``` Previously implemented here: https://github.com/ruby/ruby/pull/9115, but merged before discussion could happen. Things to be sure to discuss mentioned by @mame, > * What to do with the command-line option when prism becomes the default parser in the future. > ** Just remove it, or leave it as a "do nothing" option? > * What are the appropriate names. > ** In Ruby, not absolutely but the names of features for professional use tend to be long and verbose, while those used by ordinary users tend to be short. > * Whether to print a warning when this mode is used. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/