Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115350 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72587 invoked from network); 7 Jul 2021 13:17:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jul 2021 13:17:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 642871804C8 for ; Wed, 7 Jul 2021 06:39:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 7 Jul 2021 06:39:31 -0700 (PDT) Received: by mail-ej1-f46.google.com with SMTP id i20so3335361ejw.4 for ; Wed, 07 Jul 2021 06:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=B3ouMYVwlC7iglClqNjPMCNV4upXIlxeuX+gfF3mDeg=; b=IX3yX9pmci9AeTxMZVp+tp9bwquuMPRZkejtMkaDOzOL/tApHiocoCpF33BE90t3z2 4bchmPEPRCYnqa1LDpEsR8qkBRf5+3FhIchLcG/9uCZA/hBh/wmWBNEqxRss6OITlzFr 0vR7lxEv2n3e4KNNbYB6WUcUGlnPct9kDbcna24KQBX+SMMCg7EQFEqfMtb7nz3RIobt 10IVdkTk5Wpu/nD22RI3bioQYDMFizS5yyZff3OEmkVY0Fwup5szOfbCl8U7EMOq8zi7 2RqFqJ8eKXCm3WSDgWDMs63142J18FaJ9Er0qdb6etjGrfs+UrqhpQL5z75kk3Xw+kDa 77HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=B3ouMYVwlC7iglClqNjPMCNV4upXIlxeuX+gfF3mDeg=; b=WqnDq/k+DS1KJsiEs0sqqXPg6RR6e+5QMBAI4JrRGN7aF08d9gIE2z5qyGIVzl4Zhu QNug1oEkLRJfy/rxWgaV/g9LwxuJuugfkRZWVW2CA+tnZDDDziye9E468Ys23nHvigm7 t4OTBqYT9dmmCoA81sT3JaVgWtdaZC40FmNlY26k+zsq35ItpRPSMAJNJDqOTdJkfNFQ SwXGoptV71hwMIKd634PkUYTx84sM9SCf92XpK8VP41Pbeh1PKzap+asVcdYBpVgLYng 8v1SwRSD1CW99fZTdFGCmf82torptJkUj3Kzu2YCr+iX0cm12HcBJz0Hiyvf6esBOXj8 YN1w== X-Gm-Message-State: AOAM531nOBcZuHxnokF5LKPCHwYV/wT1g3vLYwRZPn2P/ouSA7/0D0vn A3oBNUDBjL0WRYq/Rx4LsISbYqVT3+GduPUHaPw= X-Google-Smtp-Source: ABdhPJymqC/tSW80lYojUL4aqRAV6gtNwva8s8CbdNl8qsNDNwbxbwBj5et+e+HyfMhiCRNYJUCFY+RaVvSSKrJgeSQ= X-Received: by 2002:a17:906:d92:: with SMTP id m18mr23280735eji.309.1625665169611; Wed, 07 Jul 2021 06:39:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 7 Jul 2021 22:39:18 +0900 Message-ID: To: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary="000000000000f5606905c688aa43" Subject: Re: [PHP-DEV] [RFC] Add Random Extension (before: Add Random class) From: zeriyoshi@gmail.com (Go Kudo) --000000000000f5606905c688aa43 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, let me check one thing. The macros provided by ext/standard/php_random.h are currently being used from several places. Merging this into ext/stanrard/php_rand.h would require support for all dependent code. Also, if a third party extension includes ext/standard/php_random.h and uses the php_random_bytes_throw / php_random_bytes_silent macros, this will result in a BC break. Are you sure there is no problem doing this? Translated with www.DeepL.com/Translator (free version) Regards, Go Kudo 2021=E5=B9=B47=E6=9C=887=E6=97=A5(=E6=B0=B4) 22:10 Nikita Popov : > On Wed, Jul 7, 2021 at 3:08 PM Go Kudo wrote: > >> We'll do it that way. >> >> Thanks for fixing the memory issue. I'm not quite sure I understand the >> principle, so I will investigate. >> >> By the way, are you working on something now? If so, I'll pause the work= . >> > > Nope, I just dropped by to fix the valgrind warning. Generally, you also > need to initialize these is_null variables to true, because if the > parameter is not passed, then the variables will be left at the default > value and you want to treat "not passed" the same way as "null was passed= ". > > Regards, > Nikita > > >> Regards, >> Go Kudo >> 2021=E5=B9=B47=E6=9C=887=E6=97=A5(=E6=B0=B4) 21:41 Nikita Popov : >> >>> On Wed, Jul 7, 2021 at 2:33 PM Go Kudo wrote: >>> >>>> Incidentally, what would be the preferred name for the ext/standard >>>> random? >>>> I was going to rename it to random_func, but I have a feeling that >>>> would be controversial. >>>> >>>> - random_func.c / php_random_func.h / RANDOM_FUNC_G / >>>> php_random_func_bytes() / php_random_func_int() >>>> - std_random.c ... >>>> - standard_random.c ... >>>> >>>> Which would be better? >>>> >>> >>> We already have another php_rand.h header, so I think you can just merg= e >>> them. Name of the C file shouldn't matter. >>> >>> Regards, >>> Nikita >>> >>> >>>> 2021=E5=B9=B47=E6=9C=887=E6=97=A5(=E6=B0=B4) 19:32 Nikita Popov : >>>> >>>>> On Tue, Jul 6, 2021 at 4:38 PM Go Kudo wrote: >>>>> >>>>>> > 1st >>>>>> >>>>>> This is to avoid conflicts with the implementation in ext/standard. = I >>>>>> don't >>>>>> want to do it this way either, but I have to do it this way. >>>>>> Since random in ext/standard does not use namespaces, I would like t= o >>>>>> change the ext/standard side. >>>>>> >>>>> >>>>> To clarify, are you referring to the php_random.h header in >>>>> ext/standard? I agree with Remi that the extension should be in ext/r= andom, >>>>> not ext/random_ext. We can rename the ext/standard header. >>>>> >>>>> Alternatively, you could also use ext/rng, with names RNG\Random, >>>>> RNG\NumberGenerator\XorShift128Plus etc. >>>>> >>>>> Regards, >>>>> Nikita >>>>> >>>>> >>>>>> > 2nd >>>>>> >>>>>> Although it goes back quite a long time, this implementation was >>>>>> originally >>>>>> based on an extension I submitted to PECL. >>>>>> >>>>>> https://pecl.php.net/package/orng >>>>>> >>>>>> After I posted this to PECL, I found that an object scope RNG had be= en >>>>>> proposed in the past in the Internals ML, and there was positive >>>>>> feedback >>>>>> about it. >>>>>> >>>>>> https://externals.io/message/112525 >>>>>> >>>>>> However, the proposal never actually took place. This RFC is a >>>>>> realization >>>>>> of that proposal. >>>>>> >>>>>> Is that what you asked? >>>>>> >>>>>> Regards, >>>>>> Go Kudo >>>>>> >>>>>> 2021=E5=B9=B47=E6=9C=886=E6=97=A5(=E7=81=AB) 22:46 Remi Collet : >>>>>> >>>>>> > Le 26/06/2021 =C3=A0 02:39, Go Kudo a =C3=A9crit : >>>>>> > > Hello Internals. >>>>>> > > >>>>>> > > RFC has been reorganized for finalization. >>>>>> > > >>>>>> > > https://wiki.php.net/rfc/rng_extension >>>>>> > >>>>>> > 1st I dislike the name "random_ext", why this "_ext" part ? >>>>>> > >>>>>> > 2nd why not following the standard process ? >>>>>> > >>>>>> > 1/ publish on pecl >>>>>> > 2/ merge in php-src if enough success and good feedback >>>>>> > >>>>>> > >>>>>> > Remi >>>>>> > >>>>>> > -- >>>>>> > PHP Internals - PHP Runtime Development Mailing List >>>>>> > To unsubscribe, visit: https://www.php.net/unsub.php >>>>>> > >>>>>> > >>>>>> >>>>> --000000000000f5606905c688aa43--