From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id B2F551F5AE for ; Sat, 1 Aug 2020 13:26:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 02610120BA5; Sat, 1 Aug 2020 22:25:28 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id A5281120BA3 for ; Sat, 1 Aug 2020 22:25:25 +0900 (JST) Received: by filterdrecv-p3mdw1-7ff865655c-r62j4 with SMTP id filterdrecv-p3mdw1-7ff865655c-r62j4-19-5F256D61-14 2020-08-01 13:25:53.374756399 +0000 UTC m=+241774.052419459 Received: from herokuapp.com (unknown) by ismtpd0010p1iad1.sendgrid.net (SG) with ESMTP id BoNcCe8lSdqvCzdqk0yUQQ for ; Sat, 01 Aug 2020 13:25:53.331 +0000 (UTC) Date: Sat, 01 Aug 2020 13:25:53 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75265 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 15752 X-Redmine-Issue-Author: Eregon X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr1J0EiWOhMuoOcWpxWf6z?= =?us-ascii?Q?DfNbU4hEBFcwEFEzMVWVBrF=2FSaxAA6S88=2FiwjZq?= =?us-ascii?Q?au+8v+u=2FG16u4RDXLG+M75nmwLATLc522+j2S5+?= =?us-ascii?Q?u=2Fw684fUlL1WtMDjDAK7bdUSYQHpu0lIqdSYe7r?= =?us-ascii?Q?dXJ6VU1UDNE9eiFwF7NBCfJp29NotWL0eba0XKk?= =?us-ascii?Q?o3EDcEb6FCh3rNcRo=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99436 Subject: [ruby-core:99436] [Ruby master Feature#15752] A dedicated module for experimental features X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15752 has been updated by Eregon (Benoit Daloze). The existence of `RubyVM` prevents other Ruby implementations to be fully 100% compatible, because more and more gems start to rely on it. So either: * We move most of `RubyVM` to `ExperimentalFeatures` so that other Ruby implementations can implement it for compatibility (e.g., `AbstractSyntaxTree`, `InstructionSequence`). That also gives a nice way to experiment with not-yet-stable features/APIs. * We are fine that other Ruby implementations have a `RubyVM` constant too. That will make it even less clear that `RubyVM` is experimental. In practice, if CRuby exposes any API, then some gems might rely on it and with enough gems it becomes hard/impossible to remove it. So if CRuby wants extra API for e.g. internal VM debugging, it should be added only with some special `./configure` flag. That I think is the only way to prevent gems to (probably unknowingly) depend on CRuby-private APIs that are not meant to be used except for CRuby internal debugging. ---------------------------------------- Feature #15752: A dedicated module for experimental features https://bugs.ruby-lang.org/issues/15752#change-86891 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal ---------------------------------------- I believe we should introduce a module for experimental features portable across Ruby implementations. An example of such a portable experimental feature is `RubyVM.resolve_feature_path`. This feature has nothing MRI specific in it, it is a part of basic `require` functionality. In the future, I would think more experimental features will be introduced, and I think `RubyVM` is not a good place for it. Currently, `RubyVM` is sometimes used for experimental features, but I believe `RubyVM` should be defined only on MRI and contain only MRI-specific features. This means it is *impossible* for other implementations such as JRuby and TruffleRuby to define `resolve_feature_path` (even though it's trivial and might be useful for some users), and keeping `RubyVM` not defined for clearly marking MRI specific features are not available. This is a problem that will only gets worse as portable experimental features are added to `RubyVM`. Here is one example of adding an experimental feature but unfortunately there is no common place between Ruby implementations to add it: https://github.com/jruby/jruby/issues/5206 If other implementations defined `RubyVM`, then only parts of it would be portable and other parts would be MRI specific, which would be very confusing to both users and Ruby implementers. Also, `RubyVM` doesn't really indicate by its name that it contains experimental features. So I propose the obvious name `ExperimentalFeatures`. I think such a long name is unlikely to clash with existing Object constants, is very clear, and marks that any usage of it is by definition using not stable APIs that might be removed or changed. In combination with #15743, this would mean we can very clearly see what kind of feature it is due to explicit naming: * `ExperimentalFeatures.resolve_feature_path` is a portable experimental feature, which can be supported on other Ruby implementations too. * `CRuby::InstructionSequence` is a CRuby/MRI-specific feature, which will only be supported on MRI. OTOH, the `RubyVM` name doesn't indicate this important difference, and doesn't even indicate the features under it might experimental or not portable. My main motivation here, is allowing other Ruby implementations to support some of these portable experimental features. There is no reason for only MRI to be able to support code using portable experimental features. cc @mame @headius -- https://bugs.ruby-lang.org/