From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2024-02-15T01:59:39+00:00 Subject: [ruby-core:116765] [Ruby master Misc#20238] Use prism for mk_builtin_loader.rb Issue #20238 has been updated by k0kubun (Takashi Kokubun). > I think there is a risk to use syntax which is not released yet. If the syntax is reverted by some reason, mk_builtin_loader.rb also needs to be also fixed. Note that I'm fine with the latest released syntax as well. The syntax I've wanted to use are: pattern matching (Ruby 2.7, already added to BASERUBY), endless method definition (Ruby 3.0), and omitted keyword arguments (Ruby 3.1), which had been already released when I tried to use them. So it's fine to use either Prism with `PM_OPTIONS_VERSION_CRUBY_3_3_0` or the Prism version for the latest release Ruby. > I doubt this idea even if the initial implementation of it is simple. I'm afraid that it becomes more complex over the years. It all depends on the design of the C program, so that's why we should _try making_ one. If the new `mk_builtin_loader.rb` and the C program seem harder to maintain than today's `mk_builtin_loader.rb`, we can revisit alternatives (bumping BASERUBY, using prism.gem from BASERUBY, etc). > I think it should use latest stable Ruby as BASERUBY instead. Based on [Matz's conclusion](https://bugs.ruby-lang.org/issues/16671#note-10) (ref: [meeting notes](https://github.com/ruby/dev-meeting-log/blob/master/2023/DevMeeting-2023-01-19.md#misc-16671-baseruby-version-policy-hsbt)), the "latest" we can use is still Ubuntu 22.04's Ruby 3.0. That's too old for me since I want to use Ruby 3.1's feature. However, if no other option is left, I'd be happy to wait until Ubuntu 24.04's release, which is already close enough, and bump BASERUBY to Ruby 3.1+. ---------------------------------------- Misc #20238: Use prism for mk_builtin_loader.rb https://bugs.ruby-lang.org/issues/20238#change-106788 * Author: kddnewton (Kevin Newton) * Status: Open * Priority: Normal ---------------------------------------- I would like to propose that we use prism for mk_builtin_loader.rb. Right now the Ruby syntax that you can use in builtin classes is restricted to the base Ruby version (2.7). This means you can't use a lot of the nicer syntax that Ruby has shipped in the last couple of years. If we switch to using prism to parse the builtin files instead of using ripper, then we can always use the latest version of Ruby syntax. A pull request for this is here: https://github.com/kddnewton/ruby/pull/65. The approach for the PR is taken from how RJIT bindgen works. -- 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/