Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-30 Thread Andreas Hennings
On Wed, 30 Oct 2019 at 22:06, Rowan Tommins wrote: > > Hi Dik, > > On 29/10/2019 21:44, Dik Takken wrote: > > Opcache already performs type inference. [...] > > Here is an interesting read on the subject: > > > > https://depositonce.tu-berlin.de/bitstream/11303/7919/3/popov_etal_2017.pdf > > >

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-30 Thread Rowan Tommins
Hi Dik, On 29/10/2019 21:44, Dik Takken wrote: Opcache already performs type inference. [...] Here is an interesting read on the subject: https://depositonce.tu-berlin.de/bitstream/11303/7919/3/popov_etal_2017.pdf Thanks for the link, and the insight into how much OpCache can already do. I

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-29 Thread Rowan Tommins
On 29/10/2019 21:56, Mike Schinkel wrote: It would be much better to keep it separate, and opt into it via a declare() statement, or a package configuration, or a file extension. There have beenĀ proposals for a single flag, lots of separate flags, a complete "P++" dialect, or bundles of

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-29 Thread Mike Schinkel
> On Oct 29, 2019, at 5:49 PM, Rowan Tommins wrote: > > I think the problem is that as soon as you have two engines targeting > different feature sets, it will be hard to persuade people to spend equal > attention on both. If all the new features end up being added to one engine, > the other

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-29 Thread Rowan Tommins
On 29/10/2019 19:04, Mike Schinkel wrote: Note that this was exactly what "P++" was intended to avoid - the two dialects would exist in the same engine, and get the same performance and security enhancements. It could also be one engine, it just seemed like that coupling would be more

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-29 Thread Dik Takken
On 28-10-19 00:04, Rowan Tommins wrote: > - a static analyser that can infer types in a PHP program; we know > that's possible from a number of third-party tools, although they do > rely on docblock comments for things the language doesn't (yet) let you > define Opcache already performs type

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-29 Thread Mike Schinkel
> On Oct 28, 2019, at 6:00 AM, Rowan Tommins wrote: > > Current tools tend to actually work on a directory level, because you don't > actually know what namespaces are involved until after you've loaded it, > and a file can include code for two completely separate namespaces. My > thinking was

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-28 Thread Rowan Tommins
On Sun, 27 Oct 2019 at 23:56, Mike Schinkel wrote: > > So we'd probably need some built-in definition of a "package", which could > be analysed and compiled as one unit, and didn't rely on any run-time > loading. > > > That idea of a "package" came up during a debate on this list at least >

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-28 Thread Benjamin Morel
> > This would break as soon as we have two versions of a class, and a > runtime choice which of them to use. > (see also Mark Randall's comment) That's why I'm suggesting to only make these optimizations when preloading is in use, which means that you know

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-27 Thread Mike Schinkel
> On Oct 27, 2019, at 11:20 PM, Mark Randall wrote: > > On 27/10/2019 23:56, Mike Schinkel wrote: >> 2. Allowing PHP to continue to meet the needs of new/less-skilled >> programmers and/or people who want a more productive language for smaller >> projects that do not need or want all the

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-27 Thread Benjamin Morel
> > > So we'd probably need some built-in definition of a "package", which > could be analysed and compiled as one unit, and didn't rely on any run-time > loading. > That idea of a "package" came up during a debate on this list at least > once, a few months ago, and I think it makes a lot of

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-27 Thread Mike Schinkel
> On Oct 27, 2019, at 7:04 PM, Rowan Tommins wrote: Thank you for your comments. > I chose the phrase "static analysis tool" deliberately, because I wanted to > think about the minimum requirements for such a tool, rather than its > long-term possibilities. Your points are all

Re: [PHP-DEV] Optional pre-compiler for PHP8?

2019-10-27 Thread Rowan Tommins
On 27/10/2019 02:12, Mike Schinkel wrote: While reading the [RFC] Union Types v2 thread and comments from Dmitry[1], and especially Benjamin[2] who suggested "building a static analysis tool which could prove that certain type checks would never fail, and prime OpCache" it occurred to me that

[PHP-DEV] Optional pre-compiler for PHP8?

2019-10-26 Thread Mike Schinkel
Hello all: While reading the [RFC] Union Types v2 thread and comments from Dmitry[1], and especially Benjamin[2] who suggested "building a static analysis tool which could prove that certain type checks would never fail, and prime OpCache" it occurred to me that a PHP pre-compiler could