Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99396 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95848 invoked from network); 6 Jun 2017 11:07:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2017 11:07:05 -0000 Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.4 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.4 smtp4-g21.free.fr Received: from [212.27.42.4] ([212.27.42.4:15847] helo=smtp4-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/7D-27119-7DC86395 for ; Tue, 06 Jun 2017 07:07:04 -0400 Received: from [172.16.0.22] (unknown [158.255.108.131]) (Authenticated sender: flaupretre@free.fr) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 81EED19F5DE for ; Tue, 6 Jun 2017 13:06:59 +0200 (CEST) To: internals@lists.php.net References: <5313411f-40b4-58c6-83a8-7e813526f2a7@tekwire.net> <12948b4b-bd2d-b88e-80a0-f70ba2d49657@fedoraproject.org> <5e8464ca-8fa1-ad0c-c296-36ed1b6bd2a3@tekwire.net> <05d8f04a-4fad-fbee-4bc5-bf85f282212c@rhsoft.net> Message-ID: Date: Tue, 6 Jun 2017 13:06:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <05d8f04a-4fad-fbee-4bc5-bf85f282212c@rhsoft.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Subject: Re: [PHP-DEV] Proposing inclusion of PCS in the 7.2 core distribution From: francois@tekwire.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Le 06/06/2017 à 12:33, lists@rhsoft.net a écrit : > > > Am 06.06.2017 um 12:27 schrieb François Laupretre: >> What I am proposing here is very different, as the main objective is >> to dramatically reduce the line count of the core source, without >> significant performance loss. If we had an army of C developers >> maintaining every core extension, maybe we wouldn't need that, but we >> don't (we even have fewer and fewer). What we have instead is >> thousands of lines of C code without any active maintainer. 'phar' is >> an example we talked about recently, but there are many others. >> Converting some of this code to PHP without loosing performance would >> improve the situation, IMO. So, while I agree that 3rd-party >> extensions may have very good reasons to maintain both an extension >> and a PHP package, opposing this for core extensions is very different. > > but what is the difference? just because you re-write some code in a > different programming language don't grow maintainers for the future > of that code > Wrong. Moving code from C to PHP reduces the code size, improves readability, and dramatically increases the count of potential maintainers. How many times did we get messages on the list such as 'I would love improving/maintaining the xxx extension but I cannot program in C' ? Let's take the 'phar' extension as an example. The source code is about 18,000 lines of C. After a quick look, I consider that more than 90 % of this code can be rewritten in PHP without loosing ANY performance (because this code is used during package creation only). Prior C to PHP conversions show that the resulting PHP line count is about 10 % of the original. So, we can transform 18,000 lines of very complex C code into about 1,500 lines of PHP and probably less than 1,000 remaining lines of C. From a maintainability POV, this makes the situation very different. After such an operation, phar can attract active maintainers and evolve. If it remains as it is now, experience shows that it is frozen for a very long time. Regards François