Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall
Hack language is a programming language designed by the Bryan O ' Sullivan,julien Verlaguet and Alok Menghrajani of Facebook's Irish engineers over the past few years, unlike other languages, hack can detect problems before the system crashes.
By working with other social network internal engineers, hack is further refined so that programmers can build complex code while maintaining faster programming speed and code accuracy, and few of these features are currently available for common programming languages. Hack has been using Facebook for a year, and most of its Web site is built using hack, a language that has successfully propped up the social network that serves 1.2 billion people around the world.
O ' Sullivan, an engineer involved in hack design, said hack had passed the test of full practice. O ' Sullivan, a veteran engineer at the technology company Sun Microsystems and Linden Laboratories, has played a key role in Haskell language research and development.
O ' Sullivan announced the hack language to the world this morning, declaring it a "open source" programming language that, while sharing the language, hopes programmers around the world will be able to further refine hack.
Software coding never lacks programming language, new language is not uncommon. But if you try to experience hack, or if you know the background of the hack designer, you know it's not ordinary. David Pollak, a computer programming expert, first heard of the existence of the language of hack yesterday, saying that "if it was O ' Sullivan's work, I would try it anyway." ”
Zack launched Facebook in the second half of 2003 and chose the popular PHP programming language to build the site. PHP is a "dynamic language", does not require the programmer to spend time defining the specific parameters of each variable in the program, the completion of a piece of code can be run immediately, and save the compilation process, the compilation process in the program is written while running in the background.
But as Facebook's users expand to tens of millions, PHP begins to show limits. When the PHP site expands, it requires more processors to run the site than any other language, and is prone to failure. Web site size is large enough, it is best to use static language to the framework, such as Java, easier to manage a variety of variables, the need for fewer servers, easier to manage. But there is another limitation to this language: The architecture is slow and needs to be completed and compiled to run.
Last year Facebook's three top engineers proposed a solution to the limitations of PHP: Running programs on the PHP Code virtual machine HHVM (Hip Hop virtual Machine), HHVM a new foundation for Facebook, Dramatically reduces the number of servers needed to run a Web site. As for the limitations of static code such as Java, it is solved by this new programming language, Hack makes it easy to simplify the process of code editing while reducing the error amount.
"The motivation to develop hack languages is to improve the productivity of our program developers," O ' Sullivan said. With the expansion of the engineer team, because of the characteristics of the PHP dynamic language, so that their work complexity greatly improved, the work of the code to predict the ability to decline, more prone to error. ”
Hack is a new type of PHP? You may think so. Hack can also be run on HHVM virtual machines, but programmers can write them either dynamically or statically. This mode of operation is called "gradual typing". This method of writing has only been put forward in laboratory research, Hack first realized its "real industrial value" in reality.
With the hack,facebook can gradually use it to replace the existing PHP program, the original dynamic editing system into a static editing system. O ' Sullivan explains, "This language allows authors to freely choose the level of dynamic or static, such as the use of dynamic language to start, and then gradually add static statements, so that the two different characteristics of the language advantage to maximize." ”
Other benefits of hack include a more precise editing language to reduce error rates, a "safety net" for programmers (safety net), and the ease with which engineers can read and so on when they re access code.
Hack provides these advantages without impacting the programmer's speed. Unlike other static languages, hack can run directly without compiling. After the completion of code writing, you can run directly on the Web page and get the results of the operation, as described in the following diagram, there is no normal static language editing and running delays, while ensuring security (timely error correction) and speed.
User feedback: Nils Adermann is Forumatic's software engineer and co-founder, and he also uses hack language. Adermann says the language transcends any other language. Pocketrent's engineers James Miller and Simon Welsh also apply hack and endorse the above evaluation. They think the closest hack language is Haskell,haskell is a static compiler language, code feedback is fast, can dynamically view the editing effect, but hack obviously do better at this point.
Adermann says hack is a big attraction for websites that have PHP editors, "Ironically, the main reason PHP uses hack is because it differs from PHP." "These networks can also mimic Facebook and transform it from PHP to hack." But Adermann believes that even engineers who have not yet used PHP are aware of the usefulness of hack, because PHP is the most commonly used language in the current network architecture, and hack solves a major flaw in its consistency, allowing the availability of existing languages to expand dramatically. ”
But the biggest affirmation of hack is the successful application of Facebook, the world's largest social network. It is rare for a new language to be recognized by the industry in such a high-profile way. But some people have questioned the identity of hack: not a substitute for PHP, more like a php patch. So what is Facebook's attitude towards that voice? O ' Sullivan laughs that this is a good topic for a gossip debate.
Original Author Introduction: Cade metz,wired.com Science and Technology website edition.
(via wired translation/fast carp)