[go: up one dir, main page]

ruby-core

Mailing list archive

[#120073] [Ruby master Feature#20925] Allow boolean operators at beginning of line to continue previous line — "Dan0042 (Daniel DeLorme) via ruby-core" <ruby-core@...>

Issue #20925 has been reported by Dan0042 (Daniel DeLorme).

12 messages 2024/12/01

[#120141] [Ruby master Bug#20937] "can't set length of shared string" error when using OpenSSL::Cipher#update with buffer — "akiellor (Andrew Kiellor) via ruby-core" <ruby-core@...>

Issue #20937 has been reported by akiellor (Andrew Kiellor).

9 messages 2024/12/09

[#120174] [Ruby master Bug#20943] Constant defined in `Data` block — "nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@...>

Issue #20943 has been reported by nobu (Nobuyoshi Nakada).

8 messages 2024/12/11

[#120183] [Ruby master Misc#20946] Proposing tomoya ishida (@tompng) as a Ruby committer — "matsuda (Akira Matsuda) via ruby-core" <ruby-core@...>

Issue #20946 has been reported by matsuda (Akira Matsuda).

10 messages 2024/12/12

[#120189] [Ruby master Misc#20947] Propose ydah (Yudai Takada) as a Ruby committer — "yui-knk (Kaneko Yuichiro) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTQ3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHl1aS1rbmsgKEthbmVrbyBZdWljaGly

7 messages 2024/12/12

[#120232] [Ruby master Misc#20951] Confusing handling of timezone object's `#utc_to_local` results — "andrykonchin (Andrew Konchin) via ruby-core" <ruby-core@...>

Issue #20951 has been reported by andrykonchin (Andrew Konchin).

7 messages 2024/12/13

[#120250] [Ruby master Feature#20953] Array#fetch_values vs #values_at protocols — "zverok (Victor Shepelev) via ruby-core" <ruby-core@...>

Issue #20953 has been reported by zverok (Victor Shepelev).

11 messages 2024/12/15

[#120252] [Ruby master Bug#20955] Subtle differences with Proc#parameters for anonymous parameters — "zverok (Victor Shepelev) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTU1IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHp2ZXJvayAoVmljdG9yIFNoZXBlbGV2

9 messages 2024/12/15

[#120283] [Ruby master Bug#20961] MMTk build on macOS missing librubygc.mmtk.bundle — "shan (Shannon Skipper) via ruby-core" <ruby-core@...>

Issue #20961 has been reported by shan (Shannon Skipper).

8 messages 2024/12/17

[#120303] [Ruby master Bug#20965] `it` vs `binding.local_variables` — "zverok (Victor Shepelev) via ruby-core" <ruby-core@...>

Issue #20965 has been reported by zverok (Victor Shepelev).

10 messages 2024/12/18

[#120315] [Ruby master Bug#20968] `Array#fetch_values` unexpected method name in stack trace — "koic (Koichi ITO) via ruby-core" <ruby-core@...>

Issue #20968 has been reported by koic (Koichi ITO).

22 messages 2024/12/19

[#120325] [Ruby master Bug#20970] `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` — "tompng (tomoya ishida) via ruby-core" <ruby-core@...>

Issue #20970 has been reported by tompng (tomoya ishida).

11 messages 2024/12/19

[#120335] [Ruby master Feature#20971] Deprecate `rb_path_check` — "Earlopain (Earlopain _) via ruby-core" <ruby-core@...>

Issue #20971 has been reported by Earlopain (Earlopain _).

13 messages 2024/12/19

[#120458] [Ruby master Misc#20995] exception escapes block given to IO.popen("-") in child process — "martin.dorey@... (Martin Dorey) via ruby-core" <ruby-core@...>

Issue #20995 has been reported by martin.dorey@hds.com (Martin Dorey).

7 messages 2024/12/31

[ruby-core:120392] [Ruby master Feature#20564] Switch default parser to Prism

From: "naruse (Yui NARUSE) via ruby-core" <ruby-core@...>
Date: 2024-12-24 07:30:45 UTC
List: ruby-core #120392
Issue #20564 has been updated by naruse (Yui NARUSE).


I heard Kevin left Shopify. I'm wondering who owns Prism related components.
As far as I understand, there are Prism Parser, Prism Compiler, and Prism gem.

And I'm also interested in the strategy of Prism gem.


----------------------------------------
Feature #20564: Switch default parser to Prism
https://bugs.ruby-lang.org/issues/20564#change-111173

* Author: kddnewton (Kevin Newton)
* Status: Open
----------------------------------------
This issue is to propose switching the default parser for Ruby to Prism on the master branch. The main goal is to get this default into both master and the next preview so that the community has plenty of time to test before the eventual 3.4 release.

Matz has indicated that the final decision about the default parser for Ruby 3.4 will be made later in the year. Decisions about the default parser for Ruby 3.5+ and the relationship between Prism, lrama, parse.y, etc. will also be made at a later time.

## Background

For some background on the Prism project itself, here are a couple of links in chronological order that you can read:

* https://bugs.ruby-lang.org/issues/19741
* https://railsatscale.com/2023-06-12-rewriting-the-ruby-parser/
* https://kddnewton.com/2024/01/23/prism.html
* https://railsatscale.com/2024-04-16-prism-in-2024/

## Status

Prism now passes all Ruby tests and specs. Internally at Shopify, it also passes our Core monolith's CI, which is a large and complex Rails application. We are confident that it is ready for production use. External to CRuby, Prism has already been adopted extensively around the ecosystem, including but not limited to:

* [JRuby](https://github.com/jruby/jruby/pull/8103) (via Java)
* [TruffleRuby](https://github.com/oracle/truffleruby/issues/3117) (via Java)
* [Natalie](https://github.com/natalie-lang/natalie/pull/1213) (via C++ and Ruby)
* [Opal](https://github.com/opal/opal/pull/2642) (via Ruby and WASM)
* [repl_type_completor](https://github.com/ruby/repl_type_completor)
* [rubocop](https://docs.rubocop.org/rubocop/configuration.html#setting-the-parser-engine) (via parser translator)
* [ruby-lsp](https://github.com/Shopify/ruby-lsp)
* [packwerk](https://github.com/Shopify/packwerk/pull/388) (via parser translator)

Fortunately with the community adoption, we have been able to find many edge cases and bugs that have been fixed. Thank you so much to everyone who has tried, used, reported problems with, and improved Prism in the last couple of years. We would not have hit this milestone without this community involvement.

## Caveats

While Prism correctly accepts and parses all valid Ruby syntax, there are still a number of cases where it does not reject invalid syntax as it should. We are currently working on these cases, and we are confident that we can eliminate them before the next preview release. You can find them listed here: https://github.com/ruby/prism/issues?q=is%3Aopen+is%3Aissue+label%3Ainvalid-syntax. This is our top priority right now, and I anticipate these being resolved quickly.

The other caveat is unknown unknowns: bugs or syntax issues that we have yet to discover. At Shopify we are currently taking numerous steps to mitigate this risk, including:

* Prism currently passes all Ruby tests and specs, and will continue to going forward. The tests and specs are extensive, and we are confident this gets us almost all of the way there.
* Grammar-based fuzzing to ensure we handle all possible syntax variations (both valid and invalid). As an example, that recently led to the discovery that the current compiler was segfaulting on safe navigation in for loops (https://bugs.ruby-lang.org/issues/20468). It has also found several memory leaks that have been fixed.
* Mutation testing of existing source files (by adding and deleting random bytes) to find additional edge cases.

Our goal is 100% compatibility, and we believe this is achievable through the above techniques and others. The goal of this proposal is to allow more companies to test their codebase against Prism, and to make this easier. We believe that we can sort out the remaining problems much more quickly in that manner.

## Implementation

The implementation will be relatively straightforward, as there is already the `--parser` flag that can be used to switch between the current parser and Prism. We will change the default to be `"prism"` instead of `"parse.y"`. There is no plan to remove or change any code related to `parse.y`, `lrama`, or `compile.c` at this time, as we want to create the minimal amount of change possible to ensure stability.



-- 
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/lists/ruby-core.ml.ruby-lang.org/


In This Thread