PHP Next Generation
An anonymous reader writes "The PHP Group has put up a post about the future of PHP. They say, 'Over the last year, some research into the possibility of introducing JIT compilation capabilities to PHP has been conducted. During this research, the realization was made that in order to achieve optimal performance from PHP, some internal API's should be changed. This necessitated the birth of the phpng branch, initially authored by Dmitry Stogov, Xinchen Hui, and Nikita Popov. This branch does not include JIT capabilities, but rather seeks to solve those problems that prohibit the current, and any future implementation of a JIT capable executor achieving optimal performance by improving memory usage and cleaning up some core API's. By making these improvements, the phpng branch gives us a considerable performance gain in real world applications, for example a 20% increase in throughput for Wordpress. The door may well now be open for a JIT capable compiler that can perform as we expect, but it's necessary to say that these changes stand strong on their own, without requiring a JIT capable compiler in the future to validate them.'"
I've mostly just stuck with Perl and Bash, and I'm still not sorry.
Write failed: Broken pipe
It should have been shot in the paddock.
Mind you at the other end of the spectrum we have the entry from academia "Haskell" that has already completed the course and is back in the stables. Unfortunately they haven't found a way to get it to interact with reality yet as that's an implementation issue.
Feel free to add an analogy to your language pet hate below.
Yes, that's just what the world needs: the rigorous code quality of PHP combined with the high performance and lightweight Java Virtual Machine.
Any chance you could throw some Haskell and M4 macros in there, too?
I've had the misery of suffering with maintaining a few PHP applications over the years. It is, bar none, THE WORST LANGUAGE I have ever used. Even COBOL does a better job of handling the humungous amount of copy-paste code that PHP requires. Even FORTRAN does a better job of error checking before run-time.
Sure, it's popular.
So is McDonald's.
That doesn't mean it's good or good for you.
I do not fail; I succeed at finding out what does not work.
From inconsistent to consistent
You're talking about Python, right? It may be a lot of things, but consistent isn't one of them.
From difficult to scale to easy to scale.
Again, Python? Also, I wasn't aware that PHP was "difficult to scale". No one else seems to have trouble with it. Well, "double-digit percentage of total internet traffic" sites excepted, of course. Though at that point, just about everything is "difficult to scale".
From crappy web frameworks to excellent web frameworks
I've never seen a "web framework" I'd classify as "good", let alone "excellent".
I'm still floored by the Python recommendation. This is a language that couldn't even get a simple print function right until version 3. A language so fundamentally flawed that the syntax can't adequately handle its features (anonymous functions, for example). A language known for abysmal performance. A language that can't even maintain compatibility between minor versions.
You want people to invest in that? That's just crazy.
Required reading for internet skeptics
"Yes, that's just what the world needs: the rigorous code quality of PHP combined with the high performance and lightweight Java Virtual Machine."
Fortunately, I had already swallowed my coffee so the keyboard was safe.
However, your point is valid. Just because you can theoretically run something on something doesn't mean it's a good idea.
Anyway, I need to get back to writing a JVM in VBA. This is going to be the tits.
The opposite of progress is congress
Despite all hatred - and let's face it, PHP is a really strange phenomenon - this is why PHP continues to thrive. The PHP community gets from A to B by the most bizar reroutes across Z, Mary Poppins and f(x)=x^2e^x-2. PHP is a fractal of bad design, but they always seem to focus on the next issue that's simply in the way of getting the next real world job done. I've written a post on that a few weeks ago.
Them checking the performance of Wordpress (one of the large popular CMSes out there, with a really shitty architecture ... like most of its kind) as a benchmark for the foundation of a VM show how 'fast result' oriented the PHP community is. The idea itself of testing like this would seem insane to any serious developer, AFAICT.
Point in case for PHPs insanity that always seems to work out in a strange way: ... sort of like line-numbers, but not quite ... its really crazy ...). If PHP is a fractal of bad design, Typo3 classic is that ^2. It's very difficult to describe, you have to experience it for yourself to fully understand. It's like taking the red and the blue pill at the same time. Seriously.
I've fought it for over 12 years, but now I've finally given in and am working myself into Typo3, a big-league player in the world of PHP Web CMSes. Let me tell you: If you think Wordpress, Drupal or Joomla have an architecture that was designed by chimpansees (I should now, I've deployed Drupal and Joomla professionally and was on the Joomla Bugsquad), Typo3s has one that was designed by amobeas. With TypoScript - the T3 template and config language - they've got the textbook example of an inner platform (think PHP but non-turing complete for configuration and with magic numbers
Anyway, I'm veering off. The point is: ... Although TypoScript is one of the strangest things I've seen in my 28 years of computing, I have to admit. Think of Typo3 as the Vi and Emacs of CMSes, all rolled into one. Yet there are over 2000 official Typo3 agencies here in Germany. Being an online agency basically means being a Typo3 agency over here. What do you say, it's what people want. T3 is a household brand, it has an official association, a neat website and the vibe of "big, complicated and professional" all over it. The customers want it, and they're willing to pay for deployment in T3. Who am I to complain?
Knowing Typo3 is basically job security galore for any web developer in Germany. Period. I've agreed to dive into T3 and am right now scoring more than 60Ã an hour. Being able to edit templates in the CMS Admin area isn't bad either.
PHP is bad, and nobody cares. Its barrier of entry is basically non-existant, security issues be damned, and they have a slew of pointy-clicky stuff for the peddlers to sell to end-customers. All for free. The most succesful FOSS projects are written in it and if the PHP crew are going to stick to their crazy "make it work, then make it beautiful" approach, it's probably going to stay that way for a long time.
My 2 cents.
We suffer more in our imagination than in reality. - Seneca
JS on the server is clearly big contender for PHP: it's great for quick and dirty prototyping, awful for large projects, and significantly faster than PHP.
JS is the perfect recipe for language lock-in that's even stronger than PHP: front end developers already "know" it, they write a botched version of the backend code that 10 years later turns into an incomprehensible behemoth; any attempt to rewrite it will be rejected for "performance" reasons.
See the double post? You can thank beta for that. Mod this one down or turn it off if you are an editor, the one below is the final version.
No more beta for me.
We suffer more in our imagination than in reality. - Seneca
Why not use Node.js that has already got the wheel (JIT) rather than drilling holes in PHP to fit an axle?
Because PHP also has a perfectly good chassis, body, roof, steering wheel, gear shift, seats, windows, instruments, cup holders, audio, fluffy dice etc. that you know how to use and don't want to throw away.
People don't use PHP for the language (which is fugly), they use it because it has a huge collection of useful libraries, supported and well documented on the php.net site - and it is almost certainly available on your web hosting service.
Not knocking Node.js, but it is still "getting there" as far as mature library support goes: yes, there are plenty of modules, but you're still more likely to find 4 diverse, half-written modules for a particular function than one complete, well-documented, future-proof choice.
It can also be overly complex: Node's USP is asynchronous, event-driven programming, which is cool, but harder and overkill for many applications. Then there's the small matter of having to effectively roll your own web server for even the simplest dynamic web page (OK, you'll probably use a third party module - pick one and hope it stands the test of time, then learn how to configure it) and you'll still probably need a black belt in Apache to set up a reverse proxy to your app.
Mind you, the great thing about Node vs. PHP is that nobody ever has anything bad to say about Javascript as a programming language </sarcasm>
In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
Doesn't seem like a bad idea. HotSpot will likely always be faster, more secure and more reliable than any VM the PHP devs cobble together.
Mod me down, my New Earth Global Warmingist friends!
> You're talking about Python, right? It may be a lot of things, but consistent isn't one of them.
Python's inconsistencies are bizarre enough that they become easy to remember, and there aren't that many. PHP's inconsistencies are much more subtle, and are everywhere. Peruse the string functions for a good example...
> Again, Python? Also, I wasn't aware that PHP was "difficult to scale". No one else seems to have trouble with it. Well, "double-digit percentage of total internet traffic" sites excepted, of course. Though at that point, just about everything is "difficult to scale".
for web apps I'd assume python and PHP have the exact same problems, and more or less the exact same solutions. PHP is going to be slower if you use mod_php over php-fpm though, which many don't do. As well, it's a lot easier to write up performance-dependent code in C when using python than when using PHP.
> I've never seen a "web framework" I'd classify as "good", let alone "excellent".
You should elaborate on this. Are these just frameworks for PHP and Python or are you being language agnostic with this statement? I've grown comfortable limiting my webapps to just RESTful APIs that frontends use and whipping up those APIs are painless in almost any language that has something similar to JAX-RS/Flask/etc
> A language known for abysmal performance
False, an implementation known for abysmal performance, which is CPython.
I'm god, but it's a bit of a drag really...
All kinds of people have trouble with PHP, they just don't realize it. It lulls you into a false sense of security by not throwing errors or warnings with its ultra-lax dynamic typing. PHP is like silly-putty, you can quickly make any shape you want, but thinking you've built something that you understand it is just fooling yourself.
it's great for quick and dirty prototyping
I've heard this for nearly every interpreted language. The only problem is: that quick and dirty prototype almost always winds up being the production codebase.
Personally, I blame the MySQL team for nightmares like phpBB and vBulletin. After all, mysql_query is still available in the language, despite being at fault for a staggering percentage of PHP application security flaws. The PHP folks have at least finally deprecated it in 5.5, and theoretically it will go away in the future, though at this point it is so ingrained that when they do, most folks will just reimplement it using a template-based query, but with no template fields, and we'll be in the same boat as we are now.
In an ideal world, that function/method should never have existed in MySQL to begin with. But even if we accept that it was unavoidable, the function/method should have been removed from MySQL a decade ago, because even way back then, it was obvious how flawed an API it is. Had they done so, it wouldn't have continued to exist in the PHP bindings, because it wouldn't still have been in the library.
The rest of the security problems with PHP are, as far as I can tell, pretty much comparable to any other language—improper quoting of content for use in various aspects of HTML output, cross-site scripting bugs, etc.
BTW, if you want a PHP bulletin board that's more sane, check out JaxBoards, and grab my fork where I rewrote every single database call to use template-based queries. It's a fairly clean design that separates the presentation from the core to a significant degree, and whose database code is fairly straightforward. If you spot any security bugs that I haven't already fixed in my branch, let me know.
Check out my sci-fi/humor trilogy at PatriotsBooks.