From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 725761F4B4 for ; Thu, 10 Dec 2020 07:05:00 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C473F120A09; Thu, 10 Dec 2020 16:04:13 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 76D811209F3 for ; Thu, 10 Dec 2020 16:04:11 +0900 (JST) Received: by filterdrecv-p3mdw1-6f5f88f6c4-mcqxl with SMTP id filterdrecv-p3mdw1-6f5f88f6c4-mcqxl-18-5FD1C896-28 2020-12-10 07:04:54.567966375 +0000 UTC m=+554533.253268376 Received: from herokuapp.com (unknown) by ismtpd0090p1mdw1.sendgrid.net (SG) with ESMTP id TipsADNUR3-3NpJDgilGpw for ; Thu, 10 Dec 2020 07:04:54.509 +0000 (UTC) Date: Thu, 10 Dec 2020 07:04:54 +0000 (UTC) From: matz@ruby.or.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77230 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17351 X-Redmine-Issue-Author: Eregon X-Redmine-Issue-Assignee: matz X-Redmine-Sender: matz X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?bXEIHGfdFwsIlBTndiToCp=2Fmc2rfxRD2sZAksRKJIHXRtWe5ImtbPfobMrYJT8?= =?us-ascii?Q?k0NbnqbT5HDRAEa2GiV9PwZNQNv0Qyk7JiMl5ee?= =?us-ascii?Q?zeEJXcQAbKdfvbBPmKHoIdiMoYgBTrUWOCFhvhF?= =?us-ascii?Q?CHBdIPk8dXRy85ZWnZTJmpwfbgHlDZRjDC8p4Pr?= =?us-ascii?Q?jLJS4w5Oe385Iw=2F1ouYqST1ooFA4S6KXCl=2F+0C6?= =?us-ascii?Q?VCiqU5MLCpVCUZcJA=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101362 Subject: [ruby-core:101362] [Ruby master Feature#17351] Deprecate Random::DEFAULT X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17351 has been updated by matz (Yukihiro Matsumoto). OK, accepted. Matz. ---------------------------------------- Feature #17351: Deprecate Random::DEFAULT https://bugs.ruby-lang.org/issues/17351#change-89069 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- >From https://bugs.ruby-lang.org/issues/17322#note-11 I think we should deprecate the `Random::DEFAULT` constant, it doesn't make sense anymore and it's longer than using Random class methods (Random.rand) or Kernel instance methods (#rand). Also, people might expect it to be global. If users want a Random instance they should just use `Random.new`, not assume there is a global instance in Random::DEFAULT, which is actually rather misleading now (Random::DEFAULT is no longer an instance of Random). Also note that JRuby & TruffleRuby use a per-thread instance for Kernel#rand, etc, to avoid contention (otherwise it becomes a huge source of contention when threads run in parallel). Which means on those implementations using Random::DEFAULT was inefficient (extra synchronization). So for all these reasons I think it's time to deprecate `Random::DEFAULT` and then later remove it (in 3.1?). I don't think there is any use case for `Random::DEFAULT`, but happy to hear if there is and there is no trivial replacement. -- https://bugs.ruby-lang.org/