Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76495 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67406 invoked from network); 13 Aug 2014 17:18:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 17:18:55 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.179 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.213.179 mail-ig0-f179.google.com Received: from [209.85.213.179] ([209.85.213.179:45344] helo=mail-ig0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/F9-11625-EFD9BE35 for ; Wed, 13 Aug 2014 13:18:55 -0400 Received: by mail-ig0-f179.google.com with SMTP id h18so2418912igc.6 for ; Wed, 13 Aug 2014 10:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=pqFJuOoSUXp6xNrbncosYI4o0yJcIypdxSxuzyyaVgQ=; b=dTpDxyidswcMtH/EPfWKbTutxhtoo0YxkyYvMbvYUeK/4DiE88f+jk/qXzAJ0H2k0p DzDmEoceJaIIFBZJU291vBDicn0Xqbub5I8GjNstUjDNESlclJC50UP/IAoWXdfE5WxU jEhst+N9ojSuzku3hsNPLK3EwWcceWfXyDRsUwMdqQS2/9ihQbLq5abcM/X7mgNI6C1d VP7oKwPvYFF+zNFlw6RyYNf/FDwXGoxFLUr5R5TWopwCcYiz3JS7FnQfKaXd3JqGRICG HBHqGz/YEwApDAGgWPBjqpDa6pcLabADloo1kd6hQ273ejuBqk6AFQzF5Wj9wG5SX5L3 FdIA== X-Received: by 10.50.176.202 with SMTP id ck10mr51620363igc.2.1407950331552; Wed, 13 Aug 2014 10:18:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.28.148 with HTTP; Wed, 13 Aug 2014 10:18:31 -0700 (PDT) In-Reply-To: References: <3F1B2834-3939-4F86-86E0-207D2CE469D6@ajf.me> Date: Wed, 13 Aug 2014 13:18:31 -0400 Message-ID: To: Andrea Faulds Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=089e0111d7585fad82050085fb16 Subject: Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --089e0111d7585fad82050085fb16 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable When is this planned to go through voting process? On Sat, Aug 2, 2014 at 5:27 PM, Andrea Faulds wrote: > Hi! > > On 2 Aug 2014, at 21:44, Nikita Popov wrote: > > > Why do you think this isn't a good idea? I think it would be a nice way > to prototype language features before pulling them into PHP. Though > admittedly I don't think there are many things that could be implemented > that way. > > If people can extend the syntax, they will, and I don=E2=80=99t like the = possible > consequences of that. I=E2=80=99m all for overloading, but if people star= t relying > on custom syntactical features, it means non-portable and confusing to re= ad > code. Granted, it might be useful for prototyping, but prototyping itself > would be easier with an AST, so I=E2=80=99m not sure it matters. > > > A native extension has the limitation that it will not be able to parse > files for newer PHP versions (which, depending on the use case may or may > not be a problem) and probably won't provide a stable structure across > versions. At least I think giving BC guarantees on the AST structure > between minor versions would be way too limiting for us. As such I think > both a native ext (which provides awesome perf) and PHP-Parser (which > provides x-compat) have their place ;) > > Yeah, I was thinking that you could keep it around for version > compatibility. You could even make your library pass through to the nativ= e > ext where possible. :) > > > Yes, the AST structure is based on the existing work on constant scalar > expressions, though by now the structure and API deviate a good bit from > that. It doesn't cause problems for them - constant expressions go throug= h > a validation that checks that only valid nodes are used and adjusts those > nodes that have special representation for the constexpr case (e.g. > constant and class constant access) > > Ah, I see. > > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --089e0111d7585fad82050085fb16--