There may be some very different reasons behind what kind of development language a website uses. In fact, what language only technical staff more concerned, but also a topic worth talking about.
Reply content:
This should be a historical reason, and any giant has grown up from a young age.
FaceBook's PHP is a binder language and turns into C + + execution.
And, as Facebook engineers say, libraries are far more important than what language they use. 1. PHP is specifically for the HTTP Server Side language
2. PHP good writing, syntax parser what is very streamlined and efficient
3. PHP overhead is low, unlike Java every time you have to get a virtual machine, very suitable for HTTP.
4. With a lot of people, developers can find Flickr's Cal Henderson This sentence to explain: "Languages's Don t scale, Architecture scale"
Actually choose a language and not why, when Mark wrote Facebook he is most familiar with PHP, he can use PHP to solve all the problems Facebook needs to solve, then choose it ah.
And it turns out that PHP is really good for webend development.
More importantly, of course, in those days, geek used PHP to write websites.
As for the compilation of C + + What, that is the development of FB back performance requirements more and more well paid had to invent the solution, and choose what language does not matter.
- Engineers find
- Low learning costs
- More flexible
FaceBook's PHP is mainly used in the front-end presentation layer, should not be simply said to be the main development language. I think FB initially did not have much choice, what language to choose depends on: 1. The first person's technical background 2. Prototype can be built quickly and efficiently 3. Follow-up technical follow-up, for example: finding PHP developers is relatively easy. Of course, FB go to a certain scale, even if it is not so easy to change, more is a compromise and compromise it. FB was really used before the hiphop PHP code to be executed on the server before the conversion to C + + code, the site was originally built on the basis of 500% to 600% of traffic processing, but this is not enough, and then they no longer translate the PHP code into C + + code, but instead of converting it directly to the native computer Code (the language that the server chip reads) and translates directly when the PHP code is executed. By tracking how the site executes code in real time, they can translate PHP code into native computer code in a better way, eventually improving the speed of the site's processing. This is a legacy of history. Facebook was the internal Web site that Zuckerberg wrote in a few days in college, and certainly didn't take into account the billions of of people who used the same thing.
On the issue of developing PHP as the core language, Facebook has suffered, and PHP's architectural problems are not solved by the framework. But it is unlikely that such a huge system, large employees, will be completely migrated to another language. So after Facebook did the hiphop pre-compilation effort, it started to do the hiphop JIT parser effort. This article explains the technical details very carefully HHVM how to improve PHP performance?
Historical reasons! For historical reasons, they regretted it. Now we're all in Python. Because open source, lamp is now the most popular gold collocation, because PHP is easy to use, but the easier it is to use the footsteps of the more memory, such as Php,js these are far from the native C + + run fast. Facebook's PHP architecture has a lot of layers to run, and they've done a lot of translating PHP into C for efficiency.