Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99366 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9987 invoked from network); 5 Jun 2017 17:46:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2017 17:46:57 -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:21128] helo=smtp4-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/52-27119-C0995395 for ; Mon, 05 Jun 2017 13:46:54 -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 D5A1B19F4EA for ; Mon, 5 Jun 2017 19:46:48 +0200 (CEST) To: PHP internals Message-ID: <5313411f-40b4-58c6-83a8-7e813526f2a7@tekwire.net> Date: Mon, 5 Jun 2017 19:46:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Subject: Proposing inclusion of PCS in the 7.2 core distribution From: francois@tekwire.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Hi, PCS provides a fast and easy mechanism to mix C and PHP code in PHP extensions (more about PCS at http://pcs.tekwire.net). Thanks to the PHP 7 performance improvement and the inclusion of opcache in the core, a lot of existing non-performance-critical extension code may now be converted to PHP without significant performance loss (this must be measured case by case, of course, but tests show that opcode-cached PHP code is often faster than C). Another motivation is the lack of extension maintainers. It may be complex to convert a C extension to PHP but, once it's done, maintenance becomes much easier. As one of PCS goals is to allow converting parts of existing core extensions to PHP, it seems natural to initiate the movement by an inclusion of PCS in the core distribution. Then, I and others will start proposing conversions of existing code. IMO, the PDO generic layer is a perfect candidate, but there are many others. Converting existing C code to PHP is not the only usage. With PCS, adding an OO layer to a function-only extension becomes an easy task. Sara recently told about a curl OOP layer (https://gist.github.com/sgolemon/e95bfc34d34c4f63fa953ee9294ae02c). Using PCS, adding such PHP code on top of the curl extension would take less than one hour. I hadn't proposed this so far because the 'cache_key' operation currently proposed for 7.2 is a pre-requisite, as PCS exposes the PHP code it manages via a stream wrapper. So, please give me your thoughts. Suggestions of potential candidates to be rewritten from C to PHP are welcome too. Regards François