Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88071 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43692 invoked from network); 7 Sep 2015 01:19:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2015 01:19:18 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.91 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.91 blu004-omc2s16.hotmail.com Received: from [65.55.111.91] ([65.55.111.91:50956] helo=BLU004-OMC2S16.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/80-40368-416ECE55 for ; Sun, 06 Sep 2015 21:19:17 -0400 Received: from BLU436-SMTP233 ([65.55.111.71]) by BLU004-OMC2S16.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 6 Sep 2015 18:19:13 -0700 X-TMN: [jjoIVVTZJ0Tv4BWAKlv1QzVTB9JyVmMN] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) In-Reply-To: <28335322-EF2C-487D-99A8-2A624CAEAD99@golemon.com> Date: Mon, 7 Sep 2015 03:19:08 +0200 CC: =?utf-8?Q?Bj=C3=B6rn_Larsson?= , PHP Internals Content-Transfer-Encoding: quoted-printable References: <55EAB740.6080004@telia.com> <55EC1B77.6080708@telia.com> <28335322-EF2C-487D-99A8-2A624CAEAD99@golemon.com> To: Sara Golemon X-Mailer: Apple Mail (2.2098) X-OriginalArrivalTime: 07 Sep 2015 01:19:11.0083 (UTC) FILETIME=[3372FBB0:01D0E90B] Subject: Re: [PHP-DEV] [RFC] [Discussion] Short Closures From: bobwei9@hotmail.com (Bob Weinand) > Am 07.09.2015 um 02:59 schrieb Sara Golemon : >=20 > On Sep 6, 2015, at 07:01, Bob Weinand wrote: >> Also, Hack is using a completely different parser, doesn't look like = we could borrow anything there. >>=20 > True, Hack's parser is ocaml based and unrecognizable to the majority = of this list. But HHVM's parser (which implements the runtime side of = Hack), is a flex/bison parser, not just similar to, but actually = directly descended from PHP 5.2's parser. Sure things have diverged = since then, but the overall rule structure is nearly identical in = spirit. Borrowing concepts should be trivial. >=20 > -Sara Oh, I thought that feature to be Hack-only. Looks like I'm wrong and = hence looked at the wrong place. [I always heard Hack has short = Closures, but never was told HHVM had them too...] But as I see you use a T_LAMBDA_OP which is inserted by a = token-pre-parser before it's being analyzed by the real parser. Wouldn't = say we really could compare that. It's a lot of complication... If I = remember correctly, we had a similar reason back then to reject my = initial keywords as identifiers patch as it was using that type of = approach. Honestly, a %glr-parser bison directive would look cleaner here. But I'm = not sure if we want to go that route down as a LALR(1) has much more = deterministic performance characteristics... Bob=