ruby-core

Mailing list archive

[#119670] [Ruby master Feature#20859] Make Base64 to core class — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #20859 has been reported by hsbt (Hiroshi SHIBATA).

8 messages 2024/11/01

[#119683] [Ruby master Feature#20861] Add an environment variable for tuning the default thread quantum — "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>

Issue #20861 has been reported by tenderlovemaking (Aaron Patterson).

24 messages 2024/11/01

[#119724] [Ruby master Bug#20863] `zlib.c` calls `rb_str_set_len` and `rb_str_modify_expand`(and others) without holding the GVL. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20863 has been reported by ioquatix (Samuel Williams).

8 messages 2024/11/05

[#119726] [Ruby master Feature#20864] Support `error:` keyword to `Kernel#warn` — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20864 has been reported by ioquatix (Samuel Williams).

14 messages 2024/11/05

[#119741] [Ruby master Bug#20869] IO buffer handling is inconsistent when seeking — "javanthropus (Jeremy Bopp) via ruby-core" <ruby-core@...>

Issue #20869 has been reported by javanthropus (Jeremy Bopp).

13 messages 2024/11/05

[#119751] [Ruby master Bug#20871] Including methods in Enumerable doesn't make them available in Array — "sanderd17 (Sander Deryckere) via ruby-core" <ruby-core@...>

Issue #20871 has been reported by sanderd17 (Sander Deryckere).

13 messages 2024/11/05

[#119769] [Ruby master Feature#20875] Atomic initialization for Ractor local storage — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

Issue #20875 has been reported by ko1 (Koichi Sasada).

12 messages 2024/11/06

[#119801] [Ruby master Feature#20878] A new C API to create a String by adopting a pointer: `rb_enc_str_adopt(const char *ptr, long len, long capa, rb_encoding *enc)` — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #20878 has been reported by byroot (Jean Boussier).

32 messages 2024/11/07

[#119852] [Ruby master Feature#20882] Provide Boolean(...) — "getajobmike (Mike Perham) via ruby-core" <ruby-core@...>

Issue #20882 has been reported by getajobmike (Mike Perham).

12 messages 2024/11/08

[#119881] [Ruby master Feature#20884] reserve "Ruby" toplevel module for Ruby language — "Dan0042 (Daniel DeLorme) via ruby-core" <ruby-core@...>

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

8 messages 2024/11/12

[#119897] [Ruby master Bug#20890] MacOS 15.1, Macbook pro 2024 m4, YJIT: Kernel Panic on network access, works w/o YJIT — "markus_d (Markus Doits) via ruby-core" <ruby-core@...>

Issue #20890 has been reported by markus_d (Markus Doits).

24 messages 2024/11/12

[#119988] [Ruby master Bug#20904] 3.4.0-preview2: Building miniruby.exe fails for mswin32 — "jun66j5 (Jun Omae) via ruby-core" <ruby-core@...>

Issue #20904 has been reported by jun66j5 (Jun Omae).

11 messages 2024/11/22

[#120002] [Ruby master Bug#20908] Ruby extension builds fail with GCC 15 which defaults to -std=gnu23 — "thesamesam (Sam James) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTA4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHRoZXNhbWVzYW0gKFNhbSBKYW1lcyku

7 messages 2024/11/25

[#120016] [Ruby master Feature#20912] Move warning when redefining object_id to __id__ — "jhawthorn (John Hawthorn) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTEyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGpoYXd0aG9ybiAoSm9obiBIYXd0aG9y

11 messages 2024/11/27

[#120027] [Ruby master Misc#20913] Proposal: Adding Jeremy Evans and Burdette Lamar to www.ruby-lang.org's English Editorial Team — "st0012 (Stan Lo) via ruby-core" <ruby-core@...>

Issue #20913 has been reported by st0012 (Stan Lo).

6 messages 2024/11/27

[#120043] [Ruby master Bug#20919] IO#seek does not clear the character buffer in some cases while transcoding — "javanthropus (Jeremy Bopp) via ruby-core" <ruby-core@...>

Issue #20919 has been reported by javanthropus (Jeremy Bopp).

7 messages 2024/11/28

[ruby-core:119891] [Ruby master Feature#20884] reserve "Ruby" toplevel module for Ruby language

From: "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>
Date: 2024-11-12 10:53:28 UTC
List: ruby-core #119891
Issue #20884 has been updated by Eregon (Benoit Daloze).


I think this is a great idea, and would allow to introduce some methods/constants/modules/classes we wouldn't be able to otherwise due to concerns of conflicting with existing constants.

I think it would be a good place for:
* a method returning the ruby executable, there is currently `RbConfig.ruby` and `Gem.ruby` but neither are the right place for it.
* a method returning the main ruby script, `Process.argv0` is so confusing.
* a method returning the original ruby interpreter options (#6648)
* a method returning the original user-level arguments, i.e. the initial deeply-copied value of `ARGV` (#6648)
* a method returning the original working directory, as a String, i.e. the initial value of `Dir.pwd` (#6648)
* a class like SourceLocation/CodeLocation with `start_{line,column,offset}`, `end_{line,column,offset}` and `code/source` for https://bugs.ruby-lang.org/issues/6012#note-19

> Thread::Backtrace::Location would have made a lot of sense as Ruby::Backtrace::Location

Agreed.

> RubyVM is considered specific to CRuby; so RubyVM::AbstractSyntaxTree should be Ruby::AbstractSyntaxTree if it is meant to be present in other implementations.

AbstractSyntaxTree is parse.y-specific and CRuby-specific, so that's not a good example. There is already Prism as the official and portable API to deal with Ruby ASTs.
But indeed sometimes there were suggestions to add methods to RubyVM which are not CRuby-specific (e.g. `RubyVM.resolve_feature_path` in #15903), which is a problem as `RubyVM` can only exist on CRuby, as many gems rely on `defined?(RubyVM)` == CRuby or things like assuming `RubyVM::InstructionSequence` exists if `defined?(RubyVM)`.
Adding it under `Ruby` makes it possible for other Ruby implementations to implement it, which is essential for any new functionality which can be implemented on other Ruby implementations.

>>From a quick look at `RubyVM`, I think `keep_script_lines{,=}` should be moved, the rest does look truly CRuby-specific (specific JITs of CRuby, CRuby-specific bytecode, CRuby-specific VM options).

Regarding `RUBY_*` constants I'm not sure there is much value to copy them under `Ruby` as backward-compatible code can't use them for a while, but I don't mind it either (they should stay uppercase though, I'd suggest to update the description to use `Ruby::VERSION`).

----------------------------------------
Feature #20884: reserve "Ruby" toplevel module for Ruby language
https://bugs.ruby-lang.org/issues/20884#change-110582

* Author: Dan0042 (Daniel DeLorme)
* Status: Open
----------------------------------------
`Ruby` would be a convenient namespace for many features of the Ruby language, in particular APIs related to the interpreter.

All these constants:

	RUBY_VERSION
	RUBY_RELEASE_DATE
	RUBY_PLATFORM
	RUBY_PATCHLEVEL
	RUBY_REVISION
	RUBY_COPYRIGHT
	RUBY_ENGINE
	RUBY_ENGINE_VERSION
	RUBY_DESCRIPTION
	
would have made a lot of sense as `Ruby::Version` etc.

`Thread::Backtrace::Location` would have made a lot of sense as `Ruby::Backtrace::Location`

`RubyVM` is considered specific to CRuby; so `RubyVM::AbstractSyntaxTree` should be `Ruby::AbstractSyntaxTree` if it is meant to be present in other implementations.

In #6648 there's a bit of contention over where `ruby_args` should be. `RubyVM`, `RbConfig`, `Process` have all been proposed, but `Ruby` would be an excellent choice.

`Process.argv0` was added in Ruby 2.1 but the `Process` namespace is really about OS-level process control (fork, signals, euid, limits) while this argv0 is not (in `ps` it's neither value of COMMAND nor CMD) so it would have made sense as `Ruby.argv0`

The "ruby" gem name is reserved, so there's no conflict. https://rubygems.org/gems/ruby

All in all, "Ruby" is an appropriate namespace for many Ruby things. We don't want to break compatibility over this, but we could at least start small by reserving the namespace, and see how it grows from there.

	module Ruby
	  Version = ::RUBY_VERSION
	end




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


In This Thread