ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: eregontp@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:93000] [Ruby trunk Feature#15903] Move RubyVM.resolve_feature_path to Kernel.resolve_feature_path
Date: Thu, 06 Jun 2019 09:17:16 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-78377.20190606091716.637a2e59fc278850@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15903.20190605201351@ruby-lang.org

Issue #15903 has been updated by Eregon (Benoit Daloze).

Assignee changed from Eregon (Benoit Daloze) to matz (Yukihiro Matsumoto)

mame (Yusuke Endoh) wrote:
> However, we can't be too careful to add anything to `Kernel` nowadays.

I propose only as a class method, not an instance method, so I think there is literally no chance for conflicts. What's your concern?

> At least, I don't want to do that until we receive an actual request to make the method available in production.

We very rarely receive this, e.g., even for RubyVM::InstructionSequence which is now used in production (bootsnap).
I think it is not a good criteria, it's just too easy to use `RubyVM` in user code.

I understand we should have an actual use-case, but we already have since the feature was introduced.
It would be useful when wanting to have more control over loading files (e.g., I guess this could be useful in RubyGems), and potentially bootsnap as @byroot just said above.

> Currently, I have no reason to move it to `Kernel`, except module design consistency.

I think that's a good enough reason on its own.
`RubyVM` shouldn't become a random collections of classes & methods of which part of it are MRI-specific and part not, part stable and part not.
That's just so messy, so I'd like to fix that.
This issue is a trivial fix for I think an obvious case that does not belong under `RubyVM`.

> This is just my opinion.  It is all right if matz accepted this.

OK, I'll assign to him and add to the developer meeting's agenda.

----------------------------------------
Feature #15903: Move RubyVM.resolve_feature_path to Kernel.resolve_feature_path
https://bugs.ruby-lang.org/issues/15903#change-78377

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 2.7
----------------------------------------
RubyVM contains mostly MRI-specific features but `resolve_feature_path` is clearly not MRI-specific.

So I propose to move it as a class method of `Kernel`.
I think this makes sense given the related `load` and `require` are defined in `Kernel` too.

Moreover, moving this method outside `RubyVM` is *necessary* for other Ruby implementations to implement it, and keep the clean separation that `RubyVM` is only defined on MRI (see #15752).

So, can I move `RubyVM.resolve_feature_path` to `Kernel.resolve_feature_path`?

Do we need to keep the method on RubyVM (and deprecate it), or can we just remove it since anyway API under RubyVM is not stable?

cc @mame



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2019-06-06  9:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15903.20190605201351@ruby-lang.org>
2019-06-05 20:13 ` [ruby-core:92986] [Ruby trunk Feature#15903] Move RubyVM.resolve_feature_path to Kernel.resolve_feature_path eregontp
2019-06-05 20:17 ` [ruby-core:92987] " eregontp
2019-06-05 22:51 ` [ruby-core:92989] " jean.boussier
2019-06-05 23:11 ` [ruby-core:92991] " mame
2019-06-06  9:17 ` eregontp [this message]
2019-06-06  9:18 ` [ruby-core:93001] " eregontp
2019-06-06  9:25 ` [ruby-core:93002] " eregontp
2019-06-06  9:59 ` [ruby-core:93007] " mame
2019-06-13  8:24 ` [ruby-core:93097] " nobu
2019-06-13  9:33 ` [ruby-core:93101] " eregontp
2019-06-14  2:51 ` [ruby-core:93123] " mame
2019-06-14 21:45 ` [ruby-core:93148] " eregontp
2019-07-11  4:53 ` [ruby-core:93660] [Ruby master " matz
2019-07-13 10:37 ` [ruby-core:93740] " eregontp
2019-07-13 13:37 ` [ruby-core:93741] " eregontp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-78377.20190606091716.637a2e59fc278850@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).