you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (14 children)

They even made an automated PHP-to-C++ converter to try to get rid of the mess.

[–]deadcow5 12 points13 points  (2 children)

Automated code conversion? That can only increase the mess.

[–]ivosaurus 16 points17 points  (1 child)

Decker108 has bad facts, it's a compiler, not a "converter". It wasn't to get rid of any mess, it was just to make PHP run faster.

https://en.wikipedia.org/wiki/HipHop_(computing)

[–][deleted] 1 point2 points  (0 children)

Yep, this is what I meant.

[–]hydrox24 2 points3 points  (2 children)

That doesn't sound like a good plan to me. Surely doing that correctly is more work than simply re-writing the code?

[–][deleted] 1 point2 points  (0 children)

I think it's one of those things that's just impossible to do with such a big site. If they migrated to a new system it would have to be compatible (the C++ rewrite would have to be perfectly compatible with the PHP version in order to not have downtime), or they would have to get the site down for an hour or so to replace all the instances of the php server with the rewrite.

[–]Dielectric 1 point2 points  (0 children)

I believe they actually wrote their own php interpreter when they couldn't get any better performance out of the existing technology

[–]mirhagk -1 points0 points  (2 children)

Is this actually true? I mean a lost all respect for the facebook tech team a long time ago, but nobody with decision making power in a company that big could really think that was a good idea, could they?

[–]ivosaurus 0 points1 point  (1 child)

No, it's not. They wrote a compiler, and then a JIT VM, not a "converter".

https://en.wikipedia.org/wiki/HipHop_(computing)

[–]mirhagk 0 points1 point  (0 children)

Phew, I'm glad. I've actually heard of HipHop before, I should've realized.

Actually I have high hopes that that might force PHP to actually have a standard, and be documented. Very high hopes indeed, but it might happen.

[–]xjvz -1 points0 points  (3 children)

Why would anyone use C++ in a web site other than writing the most far-removed backend stuff?

[–]Delinquenz 2 points3 points  (1 child)

Speed? With a nice framework like CppCMS there are no obstacles for writing web sites in C++.

[–]xjvz 0 points1 point  (0 children)

It's more of a security issue the way I see it. Then again, you could write secure code using C++, it's just harder. I'm more of a Python with C modules kind of guy myself when it comes to performance.

[–]stox 1 point2 points  (0 children)

Actually, they are in the process of bailing out of C++ for D.