Issue #5653 has been updated by Eregon (Benoit Daloze).


It would be good to have a definite choice on this thread, I'll add it to the developer meeting (#15546).
I think at the last RubyKaigi during the Q/Am it was becoming clear removing #autoload would be a huge breaking change and there are usages which cannot be replaced easily.
The ability to load code lazily is increasingly important with larger applications, so that if #autoload was removed, we'd need another easy way to achieve that to maintain reasonable boot times.

I think the observation that Rails uses autoload quite a bit is something worth consideration for this ticket, which I believe is what @rafaelfranca meant.

----------------------------------------
Feature #5653: "I strongly discourage the use of autoload in any standard libraries" (Re: autoload will be dead)
https://bugs.ruby-lang.org/issues/5653#change-76472

* Author: matz (Yukihiro Matsumoto)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: Next Major
----------------------------------------
Hi,
 
Today, I talked with NaHi about enhancing const_missing to enable
autoload-like feature with nested modules.  But autoload itself has
fundamental flaw under multi-thread environment.  I should have remove
autoload when I added threads to the language (threads came a few
months after autoload).
 
So I hereby declare the future deprecation of autoload.  Ruby will
keep autoload for a while, since 2.0 should keep compatibility to 1.9.
But you don't expect it will survive further future, e.g. 3.0.
 
I strongly discourage the use of autoload in any standard libraries.
 
matz.

---Files--------------------------------
noname (500 Bytes)
5653.pdf (38.3 KB)


-- 
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>