Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124931 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id B51AA1A00B7 for ; Wed, 14 Aug 2024 18:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1723660398; bh=BnEkEz4S+sLakQ1/3L+MUN4dJpzE5jnLrKoXwWxqObE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=USlwchD20YpTfRX0suNlrjECz18phtPuZ9IYmKqCjpSvZApWpFRjHa1qh/DLb9zb8 QMJOhANQhsXhTqwUTfbPX2CmhvKnuZvik/uMUjQ8K+TdULdPNsC1BgAfzWqKiPer+r Mfhr0duX5Hbx/Zudv+YppspritNZ9JWbUqau22oP5+50rUtE7x8rxqh83y6E65S+Ju 4eSx6MC8ZMdAU+cT1+0DtR2aeGe+y0rFPW5lnUyQAHtbcVuYeb8/64JNFHTbnRBat6 DwGq89z5lmPnb8Yz4DIrnU0ioo29g+8BE4/TeQN2UYJaeHSXz2gOddLKY6KrxPWtRV nChYDlZvfsyoQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C676B180059 for ; Wed, 14 Aug 2024 18:33:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 14 Aug 2024 18:33:17 +0000 (UTC) Received: by mail-ua1-f44.google.com with SMTP id a1e0cc1a2514c-842f3f275d3so68493241.1 for ; Wed, 14 Aug 2024 11:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723660290; x=1724265090; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GEfSN94Tav40JvCD00Aske7hPwQZZN9A7fHRdBOP22U=; b=gPuBddzcoPtCGHIxUqqwnBptbHnxKc2Ad2O4BKX5X4DQXsnzNmvODXFg+Q3G36jFYw ZQhCno4l7fdS8qBzX4rFGpUsN0ezn+9VJy1CuFghRbjG1FiJ9AaGCnE3GSfjhNs5jH3L x4xX5vgOVJRSsLMFHBdjL73OhFHKtKlC2gHTla4vbh/9mCEnE1URnYmyjJp6faTDhFlQ fAe+Mih9xMhH+BlxyMcVwBdvRQVhSjEBGycm2ewgvpvoktjbgL30gvk3QKyIPIKNTGQv 0TQr6bJCArOAjs2gn3jGYdhdh06egCJDk7AUGz1Zuycz2wIjNNBE2NSNEOzDp9U84ZS8 /EXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723660290; x=1724265090; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GEfSN94Tav40JvCD00Aske7hPwQZZN9A7fHRdBOP22U=; b=hfSaXfpVbKC5Dhimxn5JmyhMN+gvNQLEKyh18ok4YnQGONLXHMeJ2surbDhYIv6JU9 4yXjVuqEnRDwP0mmcP3lT6s7riUoZ8mUqDZ0xT8HRGMR3hUaJHY9s0p0MEpycGiq/cmc QkSiN3pz7DELZMYO9vtlzL4h1OHdeDMFxp/lGNjdd3pXgrfXwrHiRDriYAZeLdNzrgkZ J95XNqMrNp7+7q8csCPVAKOj+yZ6QDDdFOsLCrhKDXLHBoQBbcwBGf9ppOMvAuf1Xpm7 woSyBh+b2nzoNNI8Atkrj8biJ5PZhNDOgqvz8//llr/QHlPdhoci0WJKy6SawN2+Et/E 6peQ== X-Forwarded-Encrypted: i=1; AJvYcCWHQccYgT3HkhzLCwg7rgAYy1WfuS3pp0kb9vHyi7niBLlmOZd8GRzO5TL0W+hqANLBr+9VNTbRlgpSXbKUuAn2tJZWZzp/WQ== X-Gm-Message-State: AOJu0YwfsTwY+lBQIclojSKaVDlUIeCm4Xwq/qhLjE8S3IF/biteMkaT +22nK7KIxVPRZjRoJJ2e+pT3/pObOkfqW/tHoR1rr1egxDAdsUc3T8O5/KLSEW3qbzcTmyG54wt 8mAum7jVpRTyar/ZlUWxr3ebpyLY= X-Google-Smtp-Source: AGHT+IE059UTpn1zpM82iodVe00XlHVwyUGgfi5qQ1uem5u9g1f4CaVf81YXcARno/d3pAbFMqoS8fVrZGmBu30umX4= X-Received: by 2002:a05:6102:b08:b0:48c:3bd8:5bf2 with SMTP id ada2fe7eead31-4976a65bdd2mr372923137.15.1723660290268; Wed, 14 Aug 2024 11:31:30 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <89C901BF-DCEA-498E-93B0-750C49E6275B@getmailspring.com> <0BB4DB2D-62E1-40F9-91F3-7D48367D2CBE@edison.tech> <9fb2c610-eed9-4773-8158-adef581d6a5b@free.fr> In-Reply-To: <9fb2c610-eed9-4773-8158-adef581d6a5b@free.fr> Date: Wed, 14 Aug 2024 12:31:19 -0600 Message-ID: Subject: Re: [PHP-DEV] [DISCUSSION] C++ Enhancements in Zend API To: Pascal Chevrel Cc: Mike Schinkel , John Coggeshall , Levi Morrison , PHP internals Content-Type: multipart/alternative; boundary="00000000000050a67c061fa8ef2a" From: lnearwaju@gmail.com (Lanre) --00000000000050a67c061fa8ef2a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 14, 2024 at 4:30=E2=80=AFAM Pascal Chevrel = wrote: > Le 14/08/2024 =C3=A0 05:03, Lanre a =C3=A9crit : > > > > Mozilla introduced Rust years ago, yet Firefox remains primarily C++, > > with only about 3% of the codebase in Rust. > > Hi, > > 10.3% now https://openhub.net/p/firefox/analyses/latest/languages_summary > > Firefox is 31 million lines of code, that means 3.4 million lines of > code written in Rust. > > Rewriting everything in Rust has never been a goal but Rust is usually > favored over C++ for new projects or rewrites. I don't think you can > take Mozilla as an example (pro or con) in the context of PHP as the > contexts and constraints are way different. > > Regards > > Pascal > > So how is Rust relevant to this conversation? PHP is implemented in C AND C++ already, except it has shitty C++ support. I bring that up and propose improving it and what am i met with? Stupid questions about rust with stupid reasons for not wanting this in core. I mean look at this shit: - If it's so easy and transparent to improve support for C++, it could easily exist outside of core as a set of header files to make the lift lighter for someone looking to use it. Sounds like that project already exists (no idea, didn't look into it). - Even if it's "easy" with a few header files, it's still adding a whole new thing required to maintain the project because now someone has to ow= n and maintain a C++ API and every change to the "real" C engine needs a corresponding C++ API update. Who here long-term is going to own that engine-level API and make sure it's "the C++ way"...you? The way you're behaving I wouldn't trust you to not rage-quit today... so who then? Wha= t happens if there is a conflict between "the C way" and "the C++ way" in regards to a new engine-level API down the road? What kind of extra thou= ght / energy / consideration do we need to put into engine-level API changes= in the future because now we have to maintain two distinct engine APIs? - If it's not so easy and transparent (e.g. requiring us to start modifying the engine because C++ isn't happy), I'm opposed to the idea because conceptually I'd like to see any such effort spent on improving support for a future-looking language. I honestly don't care what that i= s, but considering Linux's recent embracing of Rust I think that's got some merit to consider. For the record, I don't personally even code in Rust = so attacking me like I've got a horse in that race is pretty ridiculous. - I don't believe that just because something is prevalent means it's good. Entire governments are starting to recommend not using C/C++ becau= se of the security risks posed by its non-existent memory safety. If PHP wa= s being written today, it wouldn't have been written in C. Clearly this guy has no clue what he's talking about, yet I'm supposed to convince people like him? His suggestions range from "leave it to a third party lib" to "i don't trust you to not rage-quit". I'm not asking for anything extreme=E2=80=94just to improve the API. Yet, I'm being told that = C++ is obsolete because of Rust. That's why I mentioned that Firefox is still primarily written in C++, even though they've introduced Rust. I'm not expecting a full Rust rewrite from them (which would be both unwise and wasteful); I just want to highlight how unreasonable it is to suggest that improving C++ support in the engine is pointless. Cheers, Lanre. --00000000000050a67c061fa8ef2a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Wed, Aug 14, 2024 at 4:30=E2=80=AFAM P= ascal Chevrel <pa= scalc@gmail.com> wrote:
Le 14/08/2024 =C3=A0 05:03, Lanre a =C3=A9crit=C2=A0:
>
> Mozilla introduced Rust years ago, yet Firefox remains primarily C++, =
> with only about 3% of the codebase in Rust.

Hi,

10.3% now https://openhub.net/p/firef= ox/analyses/latest/languages_summary

Firefox is 31 million lines of code, that means 3.4 million lines of
code written in Rust.

Rewriting everything in Rust has never been a goal but Rust is usually
favored over C++ for new projects or rewrites. I don't think you can take Mozilla as an example (pro or con) in the context of PHP as the
contexts and constraints are way different.

Regards

Pascal


So how is Rust relevant to this conver= sation? PHP is implemented in C AND C++ already, except it has shitty C++ s= upport. I bring that up and propose improving it and what am i met with? St= upid questions about rust with stupid reasons for not wanting this in core.= I mean look at this shit:
  • If it's so easy and transparent to improve support for C++, it could = easily exist outside of core as a set of header files to make the lift ligh= ter for someone looking to use it. Sounds like that project already exists = (no idea, didn't look into it).
  • Even if it's "easy" with a few header files, it's = still adding a whole new thing required to maintain the project because now= someone has to own and maintain a C++ API and every change to the "re= al" C engine needs a corresponding C++ API update. Who here long-term = is going to own that engine-level API and make sure it's "the C++ = way"...you? The way you're behaving I wouldn't trust you to no= t rage-quit today... so who then? What happens if there is a conflict betwe= en "the C way" and "the C++ way" in regards to a new en= gine-level API down the road? What kind of extra thought / energy / conside= ration do we need to put into engine-level API changes in the future becaus= e now we have to maintain two distinct engine APIs?
  • If it's not so easy and transparent (e.g. requir= ing us to start modifying the engine because C++ isn't happy), I'm = opposed to the idea because conceptually I'd like to see any such effor= t spent on improving support for a future-looking language. I honestly don&= #39;t care what that is, but considering Linux's recent embracing of Ru= st I think that's got some merit to consider. For the record, I don'= ;t personally even code in Rust so attacking me like I've got a horse i= n that race is pretty ridiculous.
  • =
    I don't believe that just because something is prevalent means it&= #39;s good. Entire governments are starting to recommend not using C/C++ be= cause of the security risks posed by its non-existent memory safety. If PHP= was being written today, it wouldn't have been written in C.
    Clearly this guy has no clue what he's talking about, yet I&= #39;m supposed to convince people like him? His suggestions range from &quo= t;leave it to a third party lib" to "i don't trust you to not= rage-quit". I'm not asking for anything extreme=E2=80=94just to i= mprove the API. Yet, I'm being told that C++ is obsolete because of Rus= t. That's why I mentioned that Firefox is still primarily written in C+= +, even though they've introduced Rust. I'm not expecting a full Ru= st rewrite from them (which would be both unwise and wasteful); I just want= to highlight how unreasonable it is to suggest that improving C++ support = in the engine is pointless.

  • Cheers,
    Lanre. --00000000000050a67c061fa8ef2a--