Live data from Hacker News

PHP 8 to Add a JIT

blog.krakjoe.ninja

11–20 of 190 posts

Re: PHP 8 to Add a JIT

#11
post #2

There is something to be said about PHP's staying power. The early versions of the language weren't considered "right". Except maybe they were right for the problem at hand. The way I see it was PHP captured the vector of change , and left ample room for future developments. Both internal changes (hello, bytecode; hello, JIT), language level features (hi there, namespaces), and runtime level features (oh hai, countle…

Part of its staying power is also due to Wordpress. If you're looking for an off the shelf CMS you'll almost certainly be considering Wordpress, Drupal, Joomla, et al.

Re: PHP 8 to Add a JIT

#12

This is the RFC with more technical details https://wiki.php.net/rfc/jit . I believe their plan is to emit low-level code directly via DynAsm, without their own intermediate representation. This kind of approach has been tried again and again and again and every project doing this either not got the results they wanted and given up or has had to go back and add a proper intermediate representation. Examples include R…

Chris - any recommendations on a good simple IR to study?

Re: PHP 8 to Add a JIT

#13
post #11
post #2

There is something to be said about PHP's staying power. The early versions of the language weren't considered "right". Except maybe they were right for the problem at hand. The way I see it was PHP captured the vector of change , and left ample room for future developments. Both internal changes (hello, bytecode; hello, JIT), language level features (hi there, namespaces), and runtime level features (oh hai, countle…

Part of its staying power is also due to Wordpress. If you're looking for an off the shelf CMS you'll almost certainly be considering Wordpress, Drupal, Joomla, et al.

I could be wrong, but I think the ubiquity of those frameworks/CMSes is rather due to the language's success rather than vice versa. Web hosts made the near universal decision to support PHP as a dynamic language at some point, and the frameworks that were built in PHP then thrived on that. Wordpress wasn't that popular back when I started out with PHP, but PHP was already universally supported by web hosts (hence my learning it). The switch from, uh, I don't know what came before (Perl? Or just a jumble of different languages called by CGI?), to PHP as universal dynamic hosting language, is before my time though.

Re: PHP 8 to Add a JIT

#14
One very important motivation what I do not see clearly delineated in this post is for Event-driven applications. Swoole[1] is an example of a PHP framework which enable some very interesting uses such as Websocket services.

In those long lived processes, a JIT really shines!

[1] https://www.swoole.co.uk/

Re: PHP 8 to Add a JIT

#15
post #12

This is the RFC with more technical details https://wiki.php.net/rfc/jit . I believe their plan is to emit low-level code directly via DynAsm, without their own intermediate representation. This kind of approach has been tried again and again and again and every project doing this either not got the results they wanted and given up or has had to go back and add a proper intermediate representation. Examples include R…

Chris - any recommendations on a good simple IR to study?

MIR is probably a good example as it solves the problem I'm suggesting they'll encounter https://blog.rust-lang.org/2016/04/19/MIR.html.

Ideal is also a classic https://www.oracle.com/technetwork/java/javase/tech/c2-ir95-....

Re: PHP 8 to Add a JIT

#16
post #12

Earlier quoted context omitted.

Chris - any recommendations on a good simple IR to study?

MIR is probably a good example as it solves the problem I'm suggesting they'll encounter https://blog.rust-lang.org/2016/04/19/MIR.html . Ideal is also a classic https://www.oracle.com/technetwork/java/javase/tech/c2-ir95-... .

Thanks!

Re: PHP 8 to Add a JIT

#17
post #2

There is something to be said about PHP's staying power. The early versions of the language weren't considered "right". Except maybe they were right for the problem at hand. The way I see it was PHP captured the vector of change , and left ample room for future developments. Both internal changes (hello, bytecode; hello, JIT), language level features (hi there, namespaces), and runtime level features (oh hai, countle…

I think PHP endures because it does one thing and does it exceptionally well. There is no other tool that makes the creation of simple dynamic server side web sites as easy and accessible. Simple FTP/SCP deployment to the server is such a killer feature. It is also one of the few choices available on cheap shared hosting sites.

PHP was practically "serverless" before serverless was even a thing. You just deploy your code with ftp, rsync, git, or whatever. There's no step 2.

Re: PHP 8 to Add a JIT

#18
post #2

There is something to be said about PHP's staying power. The early versions of the language weren't considered "right". Except maybe they were right for the problem at hand. The way I see it was PHP captured the vector of change , and left ample room for future developments. Both internal changes (hello, bytecode; hello, JIT), language level features (hi there, namespaces), and runtime level features (oh hai, countle…

[deleted]

Re: PHP 8 to Add a JIT

#19
post #13
post #11

Earlier quoted context omitted.

Part of its staying power is also due to Wordpress. If you're looking for an off the shelf CMS you'll almost certainly be considering Wordpress, Drupal, Joomla, et al.

I could be wrong, but I think the ubiquity of those frameworks/CMSes is rather due to the language's success rather than vice versa. Web hosts made the near universal decision to support PHP as a dynamic language at some point, and the frameworks that were built in PHP then thrived on that. Wordpress wasn't that popular back when I started out with PHP, but PHP was already universally supported by web hosts (hence my…

From my memory (which is not the most reliable source) it was a co-dependent relationship initially. PHP gained acceptance as a language for open source web projects, which lead to the likes of phpBB and Wordpress which in turn lead to PHP gaining even more presence on the web.

I think the staying power of php is at least in part due to the continued success of popular projects that rely on it, whoever was responsible for its initial successes.

Re: PHP 8 to Add a JIT

#20
post #2

There is something to be said about PHP's staying power. The early versions of the language weren't considered "right". Except maybe they were right for the problem at hand. The way I see it was PHP captured the vector of change , and left ample room for future developments. Both internal changes (hello, bytecode; hello, JIT), language level features (hi there, namespaces), and runtime level features (oh hai, countle…

I think PHP endures because it does one thing and does it exceptionally well. There is no other tool that makes the creation of simple dynamic server side web sites as easy and accessible. Simple FTP/SCP deployment to the server is such a killer feature. It is also one of the few choices available on cheap shared hosting sites.

Exactly this. I've been doing back-end development for work the last 7 years, first Java then NodeJs and I'm now playing with the Rust web backend (still very early-stage but promised to a bright future IMHO) but my personal blog is still PHP, and so was my wedding's website. Being able to drop a file through FTP on a 2€/month shared server is so convenient!

PHP is the VBA of the web: it's ugly but too useful to ignore.

Post reply on HN