[#114774] [Ruby master Feature#19884] Make Safe Navigation Operator work on classes — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>
Issue #19884 has been reported by p8 (Petrik de Heus).
13 messages
2023/09/15
[ruby-core:114854] [Ruby master Misc#19772] API naming for YARP compiler
From:
"mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date:
2023-09-21 01:43:11 UTC
List:
ruby-core #114854
Issue #19772 has been updated by mame (Yusuke Endoh).
I had a little conversation with @matz about this issue yesterday.
He clearly rejects the name "yarp" not only a built-in constant but also as a bundled gem. He said "prism" is fine for a bundled gem. (Sorry, I misunderstood his opinion of this.)
He came up with an idea to enable a user to use multi-version yarp gems at a time by Namespace on read (#19744) in the future. So he said that the yarp gem doesn't have to support multi-version.
```ruby
ns33 = Namespace.new
ns33.require("yarp", version: "3.3.0")
ns33::YARP.parse(src) # parse it as Ruby 3.3 syntax
ns34 = Namespace.new
ns34.require("yarp", version: "3.4.0")
ns34::YARP.parse(src) # parse it as Ruby 3.4 syntax
```
In light of the above, here is a suggestion.
* How about having the ruby repository mirror only the C implementation of YARP, but not Ruby API? It should be used only when `ruby --enable-yarp` or something are given.
* How about bundling the "prism" gem as a bundled gem to provide a Ruby API for YARP?
@matz Please point out if I misunderstood something.
@kddnewton What do you think?
----------------------------------------
Misc #19772: API naming for YARP compiler
https://bugs.ruby-lang.org/issues/19772#change-104701
* Author: jemmai (Jemma Issroff)
* Status: Open
* Priority: Normal
----------------------------------------
We are working on the YARP compiler, and have [the first PR ready](https://github.com/ruby/ruby/pull/8042) which introduces the YARP compile method. Our only outstanding question before merging it is about naming. How should we expose the public API for YARP's compile method?
Potential suggestions:
1. YARP.compile
2. RubyVM::InstructionSequence.compile(yarp: true)
3. RubyVM::InstructionSequence.compile_yarp
4. Any of the above options, with a name other than yarp (please suggest an alternative)
Regarding option 1, which would mirror `YARP.parse`, is the top level constant `YARP` acceptable?
cc @matz @ko1
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/