Skip to content

Namespace on read #10247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft

Conversation

tagomoris
Copy link
Contributor

@tagomoris tagomoris commented Mar 14, 2024

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

Features

  • Namespaces to require/load .rb files
  • Namespaces to require extensions
  • Supporting autoload
  • Reopening existing classes/modules
  • Adding hooks to end of class/module definitions
  • Defining methods on existing classes/modules
  • Eval code string in namespaces
  • Top-level methods in namespaces
  • Creating Procs in namespaces
  • Set the global namespace before running scripts
  • Defining singleton methods
  • Calling include on existing classes/modules
  • Newly added constant separation
  • Global variable separation
  • Implicit reopen with class/module in namespaces on built-in classes/modules
  • Loading C libraries as dependencies of extensions in namespaces

Nothing to do

  • Defining singleton methods on existing objects
  • Calling extend on global objects with namespaced modules
  • Class variables
  • Class instance variables

TODOs

  • Apply refined definitions on methods defined previously
  • Implement basename in C instead of calling rb_funcall in rb_namespace_local_extension
  • Update Namespace to contain rb_namespace_t directly instead of having Namespace::Entry
  • Initialize refiner module lazily to not make overhead if monkey patches are not done
  • Support calling require in methods defined in namespace on non-namespaced threads
  • Support remove_const, const_defined, const_added, rb_define_global_const, etc

@ko1 ko1 added the Playground Experimental: Post link to try Ruby with PR changes label Mar 14, 2024
@tagomoris tagomoris force-pushed the namespace-on-read-snapshot branch from 035dc71 to 6855945 Compare March 17, 2024 07:17
Copy link

Launchable Report

❌ Test session #2727464 failedos:ubuntu-22.04 test_opts:--enable-shared--enable-load-relative test_task:checkdetails on CI
🔔 no issues ✖️117 tests failed ✔️25568 tests passed

Passed test sessions

✅ Test session #2727456 passed os:ubuntu-20.04 test_opts:"RUSTC:rustc+1.58.0" test_task:checkdetails on CI
✅ Test session #2727465 passed os:ubuntu-22.04 test_opts:--disable-yjit test_task:checkdetails on CI

Build: refs_pull_10247_merge_68559456760b3870f4ff3bfc4e34d56806aa8c4f

Copy link

Try on Playground: https://ruby.github.io/play-ruby?run=8313778912
This is an automated comment by pr-playground.yml workflow.

@tagomoris tagomoris force-pushed the namespace-on-read-snapshot branch from 6855945 to 035dc71 Compare March 19, 2024 11:33
@tagomoris tagomoris force-pushed the namespace-on-read-snapshot branch from 035dc71 to 245b961 Compare April 30, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Playground Experimental: Post link to try Ruby with PR changes
Development

Successfully merging this pull request may close these issues.

2 participants