Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32061 invoked from network); 23 May 2014 22:25:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2014 22:25:31 -0000 Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.23 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.23 relay3.ptmail.sapo.pt Linux 2.4/2.6 Received: from [212.55.154.23] ([212.55.154.23:34669] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/20-29307-8DACF735 for ; Fri, 23 May 2014 18:25:31 -0400 Received: (qmail 17397 invoked from network); 23 May 2014 22:25:25 -0000 Received: from unknown (HELO sapo.pt) (10.134.36.75) by relay3 with SMTP; 23 May 2014 22:25:25 -0000 Received: (qmail 20962 invoked from network); 23 May 2014 22:25:25 -0000 Received: from unknown (HELO pc07654) (nunoplopes@sapo.pt@[85.240.117.143]) (envelope-sender ) by mta-auth01 (qmail-ptmail-1.0.0) with SMTP for ; 23 May 2014 22:25:20 -0000 X-PTMail-RemoteIP: 85.240.117.143 X-PTMail-AllowedSender-Action: Message-ID: To: "\"PHP Internals\"" Cc: "\"Dmitry Stogov\"" , "\"Zeev Suraski\"" , "\"Andi Gutmans\"" , =?UTF-8?Q?Johannes_=22Schl=C3=BCter=22?= References: <79B69A20-15AD-4C07-B026-61C2C9DEBBE5@ajf.me> <1400851698.2870.9315.camel@guybrush> In-Reply-To: <1400851698.2870.9315.camel@guybrush> Date: Fri, 23 May 2014 23:25:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18463 Subject: Re: [PHP-DEV] [RFC] Fast Parameter Parsing API From: nlopess@php.net ("Nuno Lopes") > On Fri, 2014-05-23 at 13:52 +0100, Andrea Faulds wrote: >> On 23 May 2014, at 12:36, Dmitry Stogov wrote: >> >> > Please take a look at https://wiki.php.net/rfc/fast_zpp >> > >> > Thanks. Dmitry. >> >> This looks like a great idea. I like how it’s not only faster, but it >> seems to be more readable. > > More readable? - I feel exactly the opposite. Yes, we get rid of void > pointers but use a pattern easy to understand. This looks like macro > hell. > > If we break APIs anyways: Can't we go for C++ which allows providing > high level APIs with high performance ... Totally agreed! I strongly believe we should upgrade to C++. All platforms already support C++, and C++11 support is spreading quickly. We wouldn't need to convert everything to C++ (classes and stuff). We could start compiling with a C++ compiler and use C++ as needed and where it makes sense. In particular we could use it to replace some macros in the Zend engine. For this particular example, with C++ you could improve performance of parameter passing *without* changing the API at all. With templates one can basically evaluate functions at compile time, and therefore most of the code could be inlined (and let the "scanf" part be done at compile time). C++ would also allow us to improve type safety and get rid of pointer aliasing rules violations which will cause trouble sometime if not fixed. Finally, I don't think the current proposal (the new macros) is very readable. Moreover it requires substantial work to upgrade API users. Nuno P.S.: I've been a bit inactive in the past few years, but I'm really trilled by the fact that phpng is taking momentum :)