From: "Eregon (Benoit Daloze) via ruby-core" Date: 2025-06-13T17:23:21+00:00 Subject: [ruby-core:122525] [Ruby Misc#21385] Namespace: Suggesting a rename Issue #21385 has been updated by Eregon (Benoit Daloze). hsbt (Hiroshi SHIBATA) wrote in #note-19: > ClassLoader (joke) I'm not sure how I missed this but indeed this feature seems very much like Java's ClassLoader, i.e., a way to load files/"features"/modules/classes again in their own isolated top-level namespace (semantically a copy of `Object` except it shares identity). Java doesn't have monkey-patching so there is no need for the COW handling on core classes (in Java terms for classes loaded by the bootstrap classloader). `ClassLoader` wouldn't be a good name for Ruby though, because `require` loads files/features, not classes. Maybe `FileLoader` or `FeatureLoader` (which BTW are names already used internally exactly for this stuff in TruffleRuby and also in Rubinius IIRC). ko1 (Koichi Sasada) wrote in #note-17: > RootNamespace I think this is good as `RootNamespace.new` expresses clearly and fairly faithfully what the feature does. IMO it's best to avoid any term related to isolation or security for this feature since there is little isolation in this feature: the only isolation is separate top-level constant namespaces, separate global variables, and the lazy copy of core classes. But different "namespaces" can refer to each other and even mutate each other, hence no isolation. ---------------------------------------- Misc #21385: Namespace: Suggesting a rename https://bugs.ruby-lang.org/issues/21385#change-113750 * Author: fxn (Xavier Noria) * Status: Open ---------------------------------------- I'd like to suggest a rename of namespaces. The word "namespace" is already taken in Ruby. We say that classes and modules act as or represent namespaces. Constant paths nest them in practice. We say that it is a best practice that gems create their own namespace, etc. If the feature goes ahead with this name, the above sentences, well-established in the Ruby community, will start to sound confusing, because that meaning of "namespace" stays. If you look at the index in Matz's book, "namespaces" is indexed in pages 248���250. Title of section 7.5.1 is "Modules as Namespaces". Besides, I have had a few experiences explaining the proposal to people, and quickly realizing they assume this is something like C++ namespaces or Java packages. Then, I have to undo that mental model and start all over saying "forget that mental model". Those are like our constant paths, only more simple and strict. I think it may also be confusing in this sense (though this could be OK if it wasn't for the previous point.) To be constructive: Some alternative names that I have thought about are "isolates", "shields", or "cells". ("sandboxes" is close, but may have security connotations you do not want to suggest.) -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/