Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Nikita Popov
On Mon, Aug 18, 2014 at 3:30 PM, Dmitry Stogov wrote: > Some more problems I found: > > - few tests started fail with the patch > > Zend Multibyte and ShiftJIS > [Zend/tests/multibyte/multibyte_encoding_001.phpt] > zend multibyte (8) [ext/mbstring/tests/zend_multibyte-08.phpt] > Thanks, those ar

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Dmitry Stogov
On Mon, Aug 18, 2014 at 3:39 PM, Nikita Popov wrote: > On Mon, Aug 18, 2014 at 1:19 PM, Dmitry Stogov wrote: > >> On Mon, Aug 18, 2014 at 2:26 PM, Nikita Popov >> wrote: >> >>> On Mon, Aug 18, 2014 at 9:32 AM, Dmitry Stogov wrote: >>> Hi Nikita, I think RFC misses few important

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Nikita Popov
On Mon, Aug 18, 2014 at 1:19 PM, Dmitry Stogov wrote: > On Mon, Aug 18, 2014 at 2:26 PM, Nikita Popov > wrote: > >> On Mon, Aug 18, 2014 at 9:32 AM, Dmitry Stogov wrote: >> >>> Hi Nikita, >>> >>> I think RFC misses few important notes about behavior changes: >>> >>> 1) The behavior of $a->$b[$c

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Dmitry Stogov
one more problem sapi/cli/php -r ' $a = [1,2]; list($b, $a) = $a; var_dump($a,$b);' Segmentation fault Thanks. Dmitry. On Mon, Aug 18, 2014 at 3:19 PM, Dmitry Stogov wrote: > > > > On Mon, Aug 18, 2014 at 2:26 PM, Nikita Popov > wrote: > >> On Mon, Aug 18, 2014 at 9:32 AM, Dmitry Stogov wro

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Dmitry Stogov
On Mon, Aug 18, 2014 at 2:26 PM, Nikita Popov wrote: > On Mon, Aug 18, 2014 at 9:32 AM, Dmitry Stogov wrote: > >> Hi Nikita, >> >> I think RFC misses few important notes about behavior changes: >> >> 1) The behavior of $a->$b[$c] is changed. PHP apps that used such syntax >> have to be changed i

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Nikita Popov
On Mon, Aug 18, 2014 at 9:32 AM, Dmitry Stogov wrote: > Hi Nikita, > > I think RFC misses few important notes about behavior changes: > > 1) The behavior of $a->$b[$c] is changed. PHP apps that used such syntax > have to be changed into $a->{$b[$c]}. > This is a change from the uniform variable

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Dmitry Stogov
Magento doesn't work with AST patch. 500 response on home page, no crash. Other applications I tested seem to work. Thanks. Dmitry. On Mon, Aug 18, 2014 at 11:32 AM, Dmitry Stogov wrote: > Hi Nikita, > > I think RFC misses few important notes about behavior changes: > > 1) The behavior of $a

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Dmitry Stogov
constant expressions for properties, etc. class Foo { public $x = 5 + SOME_CONST; } Thanks. Dmitry. On Mon, Aug 18, 2014 at 11:52 AM, Sebastian Bergmann wrote: > Am 18.08.2014 um 09:32 schrieb Dmitry Stogov: > > Can OPcahce always keep AST in shared memory and don't copy it into > > process

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Sebastian Bergmann
Am 18.08.2014 um 10:01 schrieb Pierre Joye: > I can imagine optimizations happening during the cache lifetime and > not only right on the 1st request/compilation. Having the AST at hand > can be handy. That makes sense. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, vis

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Pierre Joye
On Mon, Aug 18, 2014 at 9:52 AM, Sebastian Bergmann wrote: > Am 18.08.2014 um 09:32 schrieb Dmitry Stogov: >> Can OPcahce always keep AST in shared memory and don't copy it into >> process memory on each request? (ext/opcache/zend_accelerator_util_funcs.c) > > Why would the AST need to be cached?

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Sebastian Bergmann
Am 18.08.2014 um 09:32 schrieb Dmitry Stogov: > Can OPcahce always keep AST in shared memory and don't copy it into > process memory on each request? (ext/opcache/zend_accelerator_util_funcs.c) Why would the AST need to be cached? -- PHP Internals - PHP Runtime Development Mailing List To unsub

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-18 Thread Dmitry Stogov
Hi Nikita, I think RFC misses few important notes about behavior changes: 1) The behavior of $a->$b[$c] is changed. PHP apps that used such syntax have to be changed into $a->{$b[$c]}. 2) The evaluation order of left and right parts of assignment is changed. $a[$i++] = $a[$i++]; It wasn't guaran

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-15 Thread Christoph Becker
Nikita Popov wrote: > Yes, anything containing simple variables (like $i) will often deviate from > the usual evaluation order due to the CV optimization. I don't touch that. > What I've changed now is that ${a()}[b()] = c() will continue to call a, b, > c, rather than calling c, b, a (which was w

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-15 Thread Andrey Andreev
On Fri, Aug 15, 2014 at 6:58 PM, Christoph Becker wrote: > Andrey Andreev: > >> I'd personally find it horrible if $foo[$i] = $bar[$i++]; is executed >> right-to-left, but given that your examples are a bit weird, I'm not sure >> if mine is affected. Is it? > > Isn't that evaluated from right to l

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-15 Thread Nikita Popov
On Fri, Aug 15, 2014 at 5:58 PM, Christoph Becker wrote: > Andrey Andreev: > > > I'd personally find it horrible if $foo[$i] = $bar[$i++]; is executed > > right-to-left, but given that your examples are a bit weird, I'm not sure > > if mine is affected. Is it? > > Isn't that evaluated from right

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-15 Thread Christoph Becker
Andrey Andreev: > I'd personally find it horrible if $foo[$i] = $bar[$i++]; is executed > right-to-left, but given that your examples are a bit weird, I'm not sure > if mine is affected. Is it? Isn't that evaluated from right to left already since PHP 5.1.0? See . --

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-15 Thread Nikita Popov
On Wed, Aug 13, 2014 at 9:25 PM, Andrey Andreev wrote: > Hi, > > I'd personally find it horrible if $foo[$i] = $bar[$i++]; is executed > right-to-left, but given that your examples are a bit weird, I'm not sure > if mine is affected. Is it? > > Cheers, > Andrey. > I've decided that I'd rather avo

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-15 Thread Michael Wallner
On 14/08/14 13:30, Christoph Becker wrote: > Michael Wallner wrote: > >> On 14 08 2014, at 11:33, Alain Williams wrote: >>> Some code is just broken. >> >> Wat? No. This is totally different to two in/decrements on one line. This >> has to be executed in order. Ignore that. > > The current sp

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-14 Thread Christoph Becker
Michael Wallner wrote: > On 14 08 2014, at 11:33, Alain Williams wrote: > >> It is OK to define some things as undefined and have them break between >> releases - >> even minor releases. I always teach it as undefined - as it is in most >> programming languages. >> >> Likewise, if the next 2 ch

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-14 Thread Michael Wallner
On 14 08 2014, at 11:33, Alain Williams wrote: > On Thu, Aug 14, 2014 at 10:25:11AM +0100, Chris Wright wrote: > >>> My personal opinion is that things like $a[$i++] = $i++ have zero practical >>> relevance (and also think that anyone using something like this deserves >>> any breakage he gets)

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-14 Thread Alain Williams
On Thu, Aug 14, 2014 at 10:25:11AM +0100, Chris Wright wrote: > > My personal opinion is that things like $a[$i++] = $i++ have zero practical > > relevance (and also think that anyone using something like this deserves > > any breakage he gets). I'd rather save some lines of code than maintain any

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-14 Thread Chris Wright
On 13 August 2014 20:05, Nikita Popov wrote: > On Wed, Aug 13, 2014 at 7:18 PM, guilhermebla...@gmail.com < > guilhermebla...@gmail.com> wrote: > >> When is this planned to go through voting process? >> > > Before voting I'd like to have some opinions on the behavioral differences > the proposal i

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-13 Thread Andrey Andreev
Hi, I'd personally find it horrible if $foo[$i] = $bar[$i++]; is executed right-to-left, but given that your examples are a bit weird, I'm not sure if mine is affected. Is it? Cheers, Andrey. On Aug 13, 2014 10:05 PM, "Nikita Popov" wrote: > > On Wed, Aug 13, 2014 at 7:18 PM, guilhermebla...@gm

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-13 Thread Nikita Popov
On Wed, Aug 13, 2014 at 7:18 PM, guilhermebla...@gmail.com < guilhermebla...@gmail.com> wrote: > When is this planned to go through voting process? > Before voting I'd like to have some opinions on the behavioral differences the proposal introduces. In particular I'd like to know whether we are o

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-13 Thread guilhermebla...@gmail.com
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

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-02 Thread Andrea Faulds
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 e

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-02 Thread Nikita Popov
On Thu, Jul 31, 2014 at 9:03 PM, Andrea Faulds wrote: > On another note, while we *could* allow extensions to hook into the AST, > I’d stray away from letting them modify it and implement new features. That > really doesn’t sound like a good idea at all (I could elaborate on why, but > I won’t bo

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-01 Thread Andrey Andreev
Hi, I don't really have anything new to say about this, just couldn't resist another +1. This RFC is an example to follow - well thought and written, detailed, implementation ready in spite of it being a real challenge, non-controversial, and even as a userland developer, I can see the benefits.

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-01 Thread rich gray
On 31/07/2014 20:11, Nikita Popov wrote: Hi internals! I've created a draft RFC and implementation for the introduction of an Abstract Syntax Tree (AST) as an intermediate structure in our compilation process: https://wiki.php.net/rfc/abstract_syntax_tree The RFC outlines why an AST is

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-01 Thread Julien Pauli
On Thu, Jul 31, 2014 at 9:03 PM, Andrea Faulds wrote: > > On 31 Jul 2014, at 19:11, Nikita Popov wrote: > > > I've created a draft RFC and implementation for the introduction of an > > Abstract Syntax Tree (AST) as an intermediate structure in our > compilation > > process: > > Oh man, you got t

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-08-01 Thread Sebastian Bergmann
Am 31.07.2014 um 20:11 schrieb Nikita Popov: > https://wiki.php.net/rfc/abstract_syntax_tree Is it Christmas already? Seriously: +1 from me. Especially because of "The generated AST can be exposed to userland via an extension, for use by static analysers. This should be relatively easy to

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-07-31 Thread Andrea Faulds
On 31 Jul 2014, at 19:11, Nikita Popov wrote: > I've created a draft RFC and implementation for the introduction of an > Abstract Syntax Tree (AST) as an intermediate structure in our compilation > process: Oh man, you got the implementation done? That makes me so happy. ^^ Like Sara, I am ver

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-07-31 Thread guilhermebla...@gmail.com
OMG, so +1 on this! *rolling eyes* We'd be a step away for hookable grammars! \o/ On Thu, Jul 31, 2014 at 2:27 PM, Michael Wallner wrote: > On 31 July 2014 20:11, Nikita Popov wrote: > > > Hi internals! > > > > I've created a draft RFC and implementation for the introduction of an > > Abstract

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-07-31 Thread Michael Wallner
On 31 July 2014 20:11, Nikita Popov wrote: > Hi internals! > > I've created a draft RFC and implementation for the introduction of an > Abstract Syntax Tree (AST) as an intermediate structure in our compilation > process: > > https://wiki.php.net/rfc/abstract_syntax_tree > > The RFC outlines

Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-07-31 Thread Sara Golemon
On Thu, Jul 31, 2014 at 11:11 AM, Nikita Popov wrote: > I've created a draft RFC and implementation for the introduction of an > Abstract Syntax Tree (AST) as an intermediate structure in our compilation > process: > > https://wiki.php.net/rfc/abstract_syntax_tree > > The RFC outlines why an

[PHP-DEV] [RFC] Introduce Abstract Syntax Tree

2014-07-31 Thread Nikita Popov
Hi internals! I've created a draft RFC and implementation for the introduction of an Abstract Syntax Tree (AST) as an intermediate structure in our compilation process: https://wiki.php.net/rfc/abstract_syntax_tree The RFC outlines why an AST is beneficial, how it impacts performance and me