Issue #15743 has been updated by mame (Yusuke Endoh).


I'm negative against the rename for some reasons.

1) CRuby/MRI is a popular name, not an official name.  In fact, `RUBY_ENGINE` is `"ruby"`.

```
$ ruby -e 'p RUBY_ENGINE'
"ruby"
```

2) A casual user is not recommended to use RubyVM.  You, a designer of JRuby, TruffleRuby, etc., can (or should) ignore a library that is using RubyVM.

3) Some APIs in RubyVM, e.g., RubyVM::AbstractSyntaxTree, might be compatible among some implementations, if you want.  If the namespace is split, a user must follow them.

4) The name of CRuby is already used: https://rubygems.org/gems/cruby

I think the rename is worse than worth.

Of course, JRuby, TruffleRuby, etc. are all "Ruby VMs".  I think you can use the namespace "RubyVM" as you like.  A library that is truly serious to use `RubyVM` will (or should) check `RUBY_ENGINE`.  Or, if you are still worried, you may want to use a namespace `RubyVM::JRuby` and `RubyVM::TruffleRuby`.

----------------------------------------
Bug #15743: RubyVM should be renamed to CRuby
https://bugs.ruby-lang.org/issues/15743#change-77443

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: Next Major
* ruby -v: ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
My understanding is that `RubyVM` is supposed to only exist on MRI/CRuby, and not on any other Ruby implementation.
In fact, almost all features under `RubyVM` are not realistically implementable on other major Ruby implementations (JRuby, TruffleRuby, Rubinius).

Unfortunately, the name doesn't reflect that it is specific to CRuby, e.g., JRuby/TruffleRuby/Rubinius are also "Ruby VMs".
And as a result it is not clear for many Ruby users that RubyVM is CRuby-specific.

The documentation is also unclear:
```
The RubyVM module provides some access to Ruby internals. This module is
for very limited purposes, such as debugging, prototyping, and research.
 Normal users must not use it.
```

So I propose to rename RubyVM to CRuby.
That way, it is clear for everyone that this module is CRuby-specific.
It's also consistent with the JRuby module, the TruffleRuby module and the Rubinius module.

Proposed migration path:

* Introduce CRuby as an alias of RubyVM on `trunk`, and deprecate the RubyVM constant on `trunk` (for 2.7).
* Remove `RubyVM` in Ruby 3.0.

What do you think?

cc @ko1 @k0kubun @headius



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>