[#107867] Fwd: [ruby-cvs:91197] 8f59482f5d (master): add some tests for Unicode Version 14.0.0 — Martin J. Dürst <duerst@...>
To everybody taking care of continuous integration:
3 messages
2022/03/13
[#108090] [Ruby master Bug#18666] No rule to make target 'yaml/yaml.h', needed by 'api.o' — duerst <noreply@...>
Issue #18666 has been reported by duerst (Martin D端rst).
7 messages
2022/03/28
[#108117] [Ruby master Feature#18668] Merge `io-nonblock` gems into core — "Eregon (Benoit Daloze)" <noreply@...>
Issue #18668 has been reported by Eregon (Benoit Daloze).
22 messages
2022/03/30
[ruby-core:107920] [Ruby master Feature#15592] mode where "autoload" behaves like an immediate "require"
From:
"fxn (Xavier Noria)" <noreply@...>
Date:
2022-03-16 09:58:47 UTC
List:
ruby-core #107920
Issue #15592 has been updated by fxn (Xavier Noria). I'd personally suggest closing this one. When you offer lazy/eager loading mechanisms, loading has to be _consistent_. You cannot have a code base that loads in lazy model, but errs on eager mode. ```ruby # m.rb module M autoload :X, 'm/x' autoload :Y, 'm/y' end ``` makes it hard. Because `m/x.rb` may be referencing `M::Y` at the top-level, and the autoload is not yet set in eager mode. And that is only one synthetic example, it can get more subtle, the issue may be 5 levels down, and may be introduced in a code base without you even noticing. The general problem is that in order to eager load without explicit `require`s, you need all the autoloads of a certain namespace in place. Accomplishing this is one key aspect of the implementation of Zeitwerk. ---------------------------------------- Feature #15592: mode where "autoload" behaves like an immediate "require" https://bugs.ruby-lang.org/issues/15592#change-96860 * Author: akr (Akira Tanaka) * Status: Open * Priority: Normal ---------------------------------------- How about a feature to switch "autoload" behavior to "require" immediately. autoload is a feature for lazy loading. matz dislikes autoload as [Feature #5653]. I heard that he dislikes class (and other) definitions at arbitrary timing. I agree that eager loading is safer than lazy loading. However, lazy loading realize shorter loading time and it makes development cycle shorter. It is more important for larger applications as Eregon said in https://bugs.ruby-lang.org/issues/5653#note-39 . It is especially important when library loading causes I/O (code generation from DB schema). These two, safety of eager loading and easier development of lazy loading, conflicts. But if we can distinguish production mode and development mode, we can enjoy both benefits. So, I propose a feature to select autoload behavior from two modes: - autoload behaves as lazy loading as now in development mode - autoload behaves as eager loading (immediately invokes "require") in production mode. There are several idea to switch the mode: - $AUTOLOAD_MODE = :eager or :lazy - RubyVM.autoload_mode = :eager or :lazy - ObjectSpace.autoload_mode = :eager or lazy I'm not sure there is a good enough one in above list, though. -- 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>