Live data from Hacker News

PHP 8 to Add a JIT

blog.krakjoe.ninja

161–170 of 190 posts

Re: PHP 8 to Add a JIT

#161

Earlier quoted context omitted.

How is syncing your PHP code with the server serverless?

You still have to deploy to Lambdas. I believe the post you're responding to was alluding to the degree to which a lot of single-file PHP/HTML is written in a very "serverless-esque" way: no dependencies on an outer framework, and likely scales quite far compared to other languages when run on any number of servers (with the required libraries).

In addition to what you mentioned, with PHP there's no need to start, restart, monitor, or otherwise manage your own daemon. Apache and/or PHP-FPM does that for you.

Re: PHP 8 to Add a JIT

#162
post #17

Earlier quoted context omitted.

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.

That's not a PHP thing, it's a CGI thing. You can use any scripting language to do it. Perl was popular but you could use Python or even bash.

Re: PHP 8 to Add a JIT

#163
post #102
post #7

Earlier quoted context omitted.

make the right thing easy with security. All other things being equal, security is usability[1] anti-pattern. You don't get to make clever hacks (in the original sense) on a secure system. Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. - Doug Gwyn -- [1] at the very least for a power user or a developer

PHP was not really designed , though. It grew accidentally from a templating system. When other systems are said to be more secure, I think it's meant in the sense of not being horrifically broken and routinely injecting untrusted input into namespaces, markup and SQL queries.

Just like C grew accidentenly from a language created to bootstrap compilers and JavaScript was a hacky 10 day solution.

Re: PHP 8 to Add a JIT

#164

Love what they've been doing on PHP lately :) > However, this in fact opens the door on things such as machine learning, 3d rendering, 2d (gui) rendering, and data analysis, to name just a few. Shouldn't we get decent threading built in before we consider most of those? I've hit that wall many times when processing larger amounts of data w/ php scripts. I know about the pthreads plugin but nothing beats a first class…

Joe (the author of this post and pthreads extension) has been working on a new threading extension in the last months that looks extremely promising and more along the lines of goroutines than Java style threading: - https://github.com/krakjoe/parallel - https://blog.krakjoe.ninja/2019/02/parallel-php-next-chapter...

Wow, that looks incredible. Thank you for linking it.

Re: PHP 8 to Add a JIT

#165
post #72
post #45

Earlier quoted context omitted.

and now you see why "serverless" is misleading. "serverless" now means you don't run your own web server, you use someone else's.

That's not what serverless means. It means that your code isn't running on a specific server, and between requests it isn't in any kind of running state whatsoever. It's effectively in cold storage until it's needed, then it's pushed to a frontend/edge server and run. Serverless doesn't mean that there's no servers anywhere, but rather that you don't have a webserver or set of webservers that your code is on; it goes…

I don't see a difference there, PHP code can run on any webserver your hoster operaters provided they route the request correctly (I've once used a web provider that would rsync your PHP code to a geolocated DC if they detected more traffic from your region). If this is via vhosts or other routing methods is almost irrelevant, PHP code behaves extremely similar to "serverless" code (except it's often much cheaper).

Re: PHP 8 to Add a JIT

#166
post #10

Earlier quoted context omitted.

I think PHP had a couple of obvious advantages - it almost had a "first mover" advantage in that it happened to be installed alongside CGI-BIN on shared webhosts way back in the way - plus Drupal and WordPress being PHP projects. But to me, one of the most significant advantages PHP has is that its documentation is terrific . PHP.net is simple, clear about parameters and return values (as clear as PHP lets it be anyw…

Nah, PHP survived because it wasn't strict, it tolerated a lot of crap. It would process almost anything it can and not fail. Most other languages would error out seriously. Also it's model of running each request as a fresh process eliminated persistent bugs. PHP's documentation is garbage. I say this as someone that has made money handsomely from PHP. :-).

Why do you say PHP's documentation is garbage?

Just one reason is enough. I personally disagree, I think it's great.

Re: PHP 8 to Add a JIT

#167
post #90

Earlier quoted context omitted.

Perhaps not better, but there certainly have been worse. As for the comments. Yes. But at least they're there, and quite often helpful. Plenty of times I've read other docs where I wished they had commenting but alas didn't.

The comments are only needed because the documentation is often wrong or confused. And, of course, usually most of the comments are wrong too. Other languages don't need comments because they at least aim to have documentation that's correct.

"Often wrong"? Really? By often, 50% more wrong than right or less? Or more? I can count on one hand the number of occasions I've found the documentation to be incorrect.

Re: PHP 8 to Add a JIT

#168
post #152

Earlier quoted context omitted.

> Array expression I meant as in $hash['member'] vs hash.member

Well that isn't even an Array in Javascript, so already I'm beyond caring what you mean.

I understood that "array expression" meant "associative array", and that the closest equivalent in JavaScript is an Object. But I don't consider myself a PHP guru.

Re: PHP 8 to Add a JIT

#170
post #73

Earlier quoted context omitted.

When / where was mod_perl ever widespread? Perl was usually provided via CGI, and php was mostly deployed with mod_php back in the day which gave it a great speed advantage, often at the price of security.

When? Before 2000.. php came after PERL. PHP wasn't a serious language was the general though. ASP was seen as that.. or Java/JSP

I know that Perl was earlier, I've worked with Perl before PHP came around. However, I've never seen a shared hosting environment that offered mod_perl, they were all using CGI.

Might be region specific, I've mostly worked in Western Europe, but even the two NA-based providers I've used back then didn't offer mod_perl for shared hosting.

You could certainly get it on a managed server, or set it up yourself on your dedicated box, but PHP's strong suit was the low-end shared hosting options. It ran anywhere, and usually fast.

Post reply on HN