Live data from Hacker News

How come PHP seems so much faster than Rust?

reddit.com

91–100 of 116 posts

Re: How come PHP seems so much faster than Rust?

#91
post #80

Earlier quoted context omitted.

ASP and ColdFusion both required license fees at the time I believe (asp the Windows server license and CF of course the CF license) CGI just would run any type of script. Originally that was typically Perl but PHP surpassed Perl for a variety of reasons. PHP could be run either through CGI or through mod_php in Apache. There was also a mod_perl I believe and a few others but php is what web hosts typically installed…

Why did php beat perl?

The web. Making a typical language output HTML required a lot of hoop-jumping or inventing a web framework in a time before Django and Rails. PHP was its own web framework.

Re: How come PHP seems so much faster than Rust?

#92
post #80

Earlier quoted context omitted.

ASP and ColdFusion both required license fees at the time I believe (asp the Windows server license and CF of course the CF license) CGI just would run any type of script. Originally that was typically Perl but PHP surpassed Perl for a variety of reasons. PHP could be run either through CGI or through mod_php in Apache. There was also a mod_perl I believe and a few others but php is what web hosts typically installed…

Why did php beat perl?

Someone with better knowledge might step in here.

From https://perl.apache.org/about/history.html

> "PHP was also around already, and was an embarrassing witness to Perl's greatest weakness for server-side programming: that embedding Perl was a pain. Although the hooks were there for embedding Perl, they were both undocumented and buggy.

My other take on it is that PHP is like TypeScript, in that the path to adopting PHP from HTML is simple enough—just rename your HTML files with a .php suffix and you can add dynamic elements—or not. Just like how you can rename your JavaScript code with a .ts suffix and add types—or not.

Personally, I remember writing a few Perl CGI scripts. But I ended up using PHP for any quick-and-dirty dynamic stuff.

Re: How come PHP seems so much faster than Rust?

#94

Earlier quoted context omitted.

Indeed. I think most developers don't understand how amazing PHP was compared to the competition and just how fast it acquired new features during those early years. It was a scripting engine with a such a thin layer of C that it could easily and quickly incorporate the huge number of open source C libraries that existed at the time.

> I think most developers don't understand how amazing PHP was compared to the competition and just how fast it acquired new features during those early years. The only competition in those early years was Perl iirc. I'm not entirely sure if PHP was fast at acquiring new features. PHP didn't have classes until version 4 iirc. Namespace in 5.4? And 5.x is around NodeJS early days where RoR and Python Django/Pylon/Pyra…

Proper classes in 5.0, "true" OOP in 5.2.

Namespaces in 5.3

Javascript namespace/module handling is a nightmare, they should have copied PHP's.

Re: How come PHP seems so much faster than Rust?

#95

Earlier quoted context omitted.

> majority of frameworks for a language are vunerable Where's your proof? Modern PHP frameworks are secure by default.

We're talking about the majority of frameworks that are being used, not about some newer versions 0.1% use. In the end arguing won't get neither of us anywhere, I get my livelihood from testing vulnerable software and you can keep writing software in PHP.

Majority of frameworks in use are:

Symfony Laravel CodeIgniter CakePHP Yii Zend Slim

All of these can (and recommend) using either PDO with named parameters, or a full ORM for SQL work. Most came packaged with a PDO (Doctrine, mostly) by default but have always supported whatever you wanted to use.

Write shit code, win shit prizes.

Re: How come PHP seems so much faster than Rust?

#96
post #66

Earlier quoted context omitted.

> I do remember ASP, Cold fusion, CGI This is the competition that PHP was so much better than.

CGI yes, ASP certainly not.

Classic ASP was terrible; if you're thinking ASP.NET then that did not exist at the time.

Re: How come PHP seems so much faster than Rust?

#98

Earlier quoted context omitted.

Indeed. I think most developers don't understand how amazing PHP was compared to the competition and just how fast it acquired new features during those early years. It was a scripting engine with a such a thin layer of C that it could easily and quickly incorporate the huge number of open source C libraries that existed at the time.

> I think most developers don't understand how amazing PHP was compared to the competition and just how fast it acquired new features during those early years. The only competition in those early years was Perl iirc. I'm not entirely sure if PHP was fast at acquiring new features. PHP didn't have classes until version 4 iirc. Namespace in 5.4? And 5.x is around NodeJS early days where RoR and Python Django/Pylon/Pyra…

> I'm not entirely sure if PHP was fast at acquiring new features.

You really have turn back the clock; languages didn't have package management back then. They didn't have packages. The only exception, at the time, was Perl (which had CPAN). PHP acquiring features was not just about language features but also how quickly it's standard library grew to accomplish anything you needed on the web.

> PHP didn't have classes until version 4 iirc. Namespace in 5.4? And 5.x is around NodeJS early days where RoR and Python Django/Pylon/Pyramid was around.

I'm actually talking about the PHP3 era; by the time we're talking about PHP5 then there was already plenty of competition and the "early days" were already long over.

Re: How come PHP seems so much faster than Rust?

#99
post #80

Earlier quoted context omitted.

ASP and ColdFusion both required license fees at the time I believe (asp the Windows server license and CF of course the CF license) CGI just would run any type of script. Originally that was typically Perl but PHP surpassed Perl for a variety of reasons. PHP could be run either through CGI or through mod_php in Apache. There was also a mod_perl I believe and a few others but php is what web hosts typically installed…

Why did php beat perl?

Perl was just as inscrutable then as it is now.

Re: How come PHP seems so much faster than Rust?

#100
post #66

Earlier quoted context omitted.

CGI yes, ASP certainly not.

Classic ASP was terrible; if you're thinking ASP.NET then that did not exist at the time.

Using OCX from ASP, written in Delphi, VB and C++ Builder, alongside VB Script, was definitely better than PHP 3.
Post reply on HN