Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124935 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 F31541A00B7 for ; Wed, 14 Aug 2024 22:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1723676349; bh=FjB9ZBdC1yAPaem/6v8583PR+fAqWoiQbSPyyzc3Sr0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=G/+WqqKOX1ai/8D/rcNdqQ+VgxdM2hP558CI6u1+s2ecyWlVqu/gMt+wu0Fr8T8iu BmWM1TBGXmdqwjPvxC5nlWAwY1hEht/yLEofYKYPggZcq1i6S0kRiwnA6944x/v+6R hFX2aZaCsSN7+r7WzI/mK8iFZPmVLZWmh86gNe+im2Yej/n4dRu9jj3ESD43eyWWrd QLQr3ZQ91kanL7qWTuFLssQ/NfSjIJ3e3meEpt64aOdhyeTdSDW3g44IE5hCau+RDj //UYF9DKqkc6TwIdydtRU0P115lA+QRwjwo/yGjFNfEcaZ7RUKG7EWYBGT8wEUXf46 kVBs69gwUz3oQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7661C180054 for ; Wed, 14 Aug 2024 22:59:08 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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 22:59:08 +0000 (UTC) Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-e116d2f5f7fso328828276.1 for ; Wed, 14 Aug 2024 15:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1723676241; x=1724281041; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZloyPf+3+hbdMhqTE6QYpi9vWYQCTtCNqBcRMJz1ZHc=; b=mvD8fRv4eWD+M6VHEGwMk/J4ay3p6ByplbLlIo8ozKFlm/WodvsXg5WhRDDQ9pw6GQ 8jWsmBIk6hEpjfqxbE9OHAfFZTYNdYRV8ieI6HyHqAhG7ABtjCZ1XLSJ5BakaB4IZgZn cUFwFRlfh7ui0ecVez8l9yXHBy+TYZ+y/aZdo1Oi7LEfOKhSNOafRaiSj9hA009qRXte ly4FOKsfwDpSO6rPQFBe1gigfO2G812t3l7Rxe1QrWna6GfkZwRMS7yM/3qhKptSWAAK ft4SCWfCnoszLZaYAO/rBqo4JGjpcaiCU23o3wNV4Rw5jWRWcOJgCPlo9YqrP4h+0pt6 j/mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723676241; x=1724281041; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZloyPf+3+hbdMhqTE6QYpi9vWYQCTtCNqBcRMJz1ZHc=; b=YgsLEFQncg8NmeHyrWH8yFAX7VKKNGFtHlt6wY4VRGrpw2gnFkQRqeK/RhoM6HfGCP 2yfgeuFJ/A7ju4XTr1A84ABIvdpWKGH5nzx9SwbEiwq7HH/ALHd0y35bmxhjvACITCku vMmY0KYFLfKTZAdhuOuoegzkEMJ5hpOGINA7sfbWwlu452FZk1Mn1KCasNmgq5qjyWXU bd8o3K7CTU6SS7ZpiB8qiPEFxSeVSFhb9C3t3lp+Ne0GdfES4l6sx0mI82S7mDja7FeP pMdeN3ci4qXYhNjBwZVseuEM66m/THv8MwUlROgaMMv5hSO5AbnGLYODaTUKYAtKHqH7 q22A== X-Gm-Message-State: AOJu0Yzyvo+sp/GF/R6242f97JNiG83DbOzWYqWqfJi9tZwvga8Bn0VS aVNgSa3YXANwwN40pZa9kgqm++m4SxkfzoDHX8uQ3iRxOVG7WOOZrzTZ3YIXE7w= X-Google-Smtp-Source: AGHT+IHhQBBsRRpOX4GuZO0uKCKNus6mkc1sIrsKeEqRUFRamgZP5gPFATLKBTx1Ty+UezAoxoFVfw== X-Received: by 2002:a05:6902:2b8c:b0:e0e:cec7:7a27 with SMTP id 3f1490d57ef6-e116cdc8316mr1878727276.21.1723676241181; Wed, 14 Aug 2024 15:57:21 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e1171e09dbfsm29544276.10.2024.08.14.15.57.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Aug 2024 15:57:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] [DISCUSSION] C++ Enhancements in Zend API In-Reply-To: Date: Wed, 14 Aug 2024 18:57:18 -0400 Cc: PHP internals , Pascal Chevrel , John Coggeshall , Levi Morrison , Arvids Godjuks Content-Transfer-Encoding: quoted-printable Message-ID: <6CBD6794-6733-43F5-B2A3-B136D8823410@newclarity.net> References: <89C901BF-DCEA-498E-93B0-750C49E6275B@getmailspring.com> <0BB4DB2D-62E1-40F9-91F3-7D48367D2CBE@edison.tech> <9fb2c610-eed9-4773-8158-adef581d6a5b@free.fr> To: Lanre X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) > On Aug 14, 2024, at 5:27 PM, Lanre wrote: >=20 >> On Wed, Aug 14, 2024 at 2:32=E2=80=AFPM Mike Schinkel = wrote: >> > On Aug 14, 2024, at 3:05 PM, Arvids Godjuks = wrote: >> > PHP has C as core and has allowed C++ for extensions. Expanding = that support is a no-brainer, especially since modern C++ has stepped up = in major ways and I don't think C sees a lot of development any more, so = it makes sense to move towards C++. >>=20 >> IF there is a serious consideration given to evolving PHP to be = written in another language =E2=80=94 vs. just a newer version of C =E2=80= =94 I think any reasonable analysis would indicate that none of the = languages proposed in this thread would be appropriate; not Rust, not = C++, and not Go. Why not? > Can you point out where either of us suggested writing PHP in another = language? Arvids wrote "I don't think C sees a lot of development any more, so it = makes sense to move towards C++."=20 That statement was why I wrote my email. > You might be mixing this up with the C11 thread, which has nothing to = do with this.=20 No, not the case. > All I'm proposing is improving the current C++ support in the engine.=20= I was not replying to your email(s). I was replying to Arvids' email = which was worded as if moving to C++ for PHP was a foregone conclusion. > https://github.com/php/php-src/blob/master/Zend/zend_portability.h = already guarantees compatibility with c++ thanks to the BEGIN_EXTERN_C() = and END_EXTERN_C() macros defined right at the top and that are used all = around the engine. Notice how that macro compiles to nothing when C++ = isn't being used? I'm simply proposing more of those. I made no comment pro nor con regarding that proposal. =20 > All of this is moot, it would be a huge investment and a whole other = discussion to port PHP to another language. That has nothing to do with = my proposal. I could be wrong as I am not an expert in either C or Zig, but from what = I understand from others who have adopted Zig for C code bases it would = not be a huge investment at all. Which is why I proposed it.=20 > Again, I will reiterate that these proposed changes will not affect = the current course of PHP. Development will go on as usual and any bugs = introduced by this proposal will be contained to C++ extensions = interacting with the code. C devs can act like this doesn't even exist = because as far as the C compiler is concerned, it doesn't. On the other = hand C++ devs won't have to keep reinventing the wheel whenever they = have to build an extension with C++. What is a php extension if not a = wrapper for a C/C++ lib? >=20 > IF I wanted PHP to be implemented in C++, I would simply fork it. How = many thousand RFCs do you think it will take to get anything reasonable = done? I'm baffled that I actually have to convince y'all to IMPROVE the = current support for C++, but calm down, no one wants you to quit. Again, I did not comment on your proposal pro nor con.=20 OTOH, as others discussed moving to Rust or C++ I wanted to ensure a = more compelling alternative =E2=80=94 Zig =E2=80=94 was at least = mentioned and considered, assuming a change is being/will be considered = at all. -Mike P.S. BTW, didn't you already say this conversation was a waste of your = time and imply that you were done with the thread? Then why would I be = replying to you?=20