Meta selects four programming languages ​​as preferred languages, official: each language has been strictly screened

Author | Dongmei

Python, C++, Rust, and Hack are designated as preferred languages ​​by Meta, each with specific use cases.

On July 27, local time, according to The Register, Meta announced Hack, Python, C++ and Rust as the languages ​​of choice for employees and developers to build software on its platform.

Meta told The Register that among the many programming languages, deciding which one to use as the preferred working language is not an easy task.

“It’s important that each language we use has specific use cases that are best suited for it, so we evaluate each programming language very rigorously,” Meta said. “Once a decision on which language to choose, we This decision will stick with us, so we want to be well thought out from the start to give our engineers the best possible tools.”

At Meta, once a decision has been made to choose a language, it is the programming language that provides a great experience for both internal and external developers in terms of code editing, debugging, building, core libraries, and interoperability. In addition, the company guarantees that people who write code in a company-approved language will not be asked to convert the code to a different language.

Each language has specific application scenarios

Python is one of the most popular programming languages ​​out there and is widely recognized. Meta recommends Python for data science, ML applications, and Instagram related code.

Another widely used general-purpose programming language, C++, is used in Meta’s backend services.

Of the four most popular languages, Rust is a much-loved systems language that originated at Mozilla and is now overseen by the Rust Foundation.

Rust is also used in performance-focused backend services and CLI tools. “We’re using Rust more in our products and services, and we’re committed to using Rust long-term and welcoming early adopters,” the company said.

As expected, Meta has designated the self-developed, open-source Hack as the programming language of choice. Hack is a type-safe PHP variant that relies on the HipHop Virtual Machine (HHVM) and is the basis for much of Facebook. Meta recommends Hack for business logic and relatively stateless applications.

Hack project address: https://hacklang.org/

The popularity of Python and C++ doesn’t need to be said much, and it makes sense for Meta to use the self-developed Hack language. So, how did Meta introduce and use Rust?

The use and development of Rust at Facebook

2016-2017: Early use for source control

When the Rust programming language was introduced, Facebook wasn’t called Meta.

The oldest Rust codebase dates back to 2016. At the time, the source code change rate in Facebook’s monolithic repository started to “encroach” on the maximum commit rate Mercurial source control management tools could keep up with. In response, Facebook’s source control team launched a rewrite project called Mononoke, which aims to increase Mercurial’s commit rate by orders of magnitude to satisfy Facebook’s thousands of developers and automate processes.

Initially, developing Mononoke in C++ was an obvious choice. At the time, Facebook’s backend codebase was heavily C++ heavy, which meant that Mononoke was implemented in C++ by default. However, the source control team needs to consider the reliability needs of the source control management backend, and if the service is brought to a standstill due to downtime or corruption, reliability becomes a primary consideration. Therefore, the team chose to use Rust instead of C++.

Mononoke is an excellent testing platform because of its natural barriers to other Facebook systems. If Mononoke was able to talk to client services using the Mercurial protocol, and to communicate with some storage systems using the Thrift protocol, choosing Rust wouldn’t affect anything other than the work of the source control team.

Source control teams are willing and able to support their own use of any Rust-specific tooling and infrastructure. Mononoke has been the production backend for our monolithic warehouse since 2019 and has successfully scaled up over the past few years.

2017-2019: Adoption Curve

Mononoke was enough to demonstrate that adoption of Rust was feasible, and over time other projects began to consider and adopt Rust. In the beginning, these projects are usually developer’s tool projects, they don’t need to integrate with the wider service infrastructure, and they don’t need small services/daemons, just a few hand-written wrappers around some C++ client library will get the job done.

Among the Rust engineers at Facebook, many with backgrounds in Python and JavaScript, appreciate Rust’s combination of high performance and compile-time error detection. As more and more success stories (such as 2 to 4 orders of magnitude improvement in performance, etc.) are circulated within the company, there is a growing interest in using Rust to implement backend service code and explore its application in mobile applications. thicker.

2019~2020:

Rust gets some dedicated support

From 2017 to 2019, the source control team became the unofficial Rust support team within Facebook. By 2019, the number of Rust developers at Facebook had grown exponentially to over 100.

One of the reasons behind the growth is that Rust is the primary language for developing the Diem (formerly Libra) blockchain, overseen by the independent Diem Association of which Facebook’s digital wallet Novi is a member. The Diem blockchain is primarily written in Rust and covers 94% of the open source codebase.

Given the increased demand, part-time assistance from the source control team is not sufficient to support the number of teams that benefit. So Facebook created a small Rust Developer Experience team that worked on tooling and integration challenges, like the mechanics of using the language’s open source package registry ecosystem in production non-cargo builds. The team established a central connection point for Rust developers across the company to unlock use cases, prioritize short-term developer experience issues, improve core libraries, and succeed when the fledgling Rust codebase passes the million-line mark Lay the foundation.

Despite its reputation for being hard to learn, Rust has gained a lot of traction over the past few years thanks to its memory safety features. It has been adopted by Microsoft, Google and Linux kernel developers, not to mention Apple, Amazon and Dropbox.

Facebook self-developed programming language

The disappearance of Move

In addition to the four programming languages ​​mentioned above, some other programming languages, such as Java, Erlang, Haskell, and Go, are approved for specific use cases, but not adopted outside these cases.

In 2020, when the cryptocurrency is on fire, Facebook also launched a self-developed Move language, which aims to lay a secure and programmable foundation for the Libra blockchain.

Libra (previously known as: GlobalCoin or Facebook Coin) is a cryptocurrency proposed by Facebook Corporation (now Meta Corporation), which was originally planned to be released in 2020, but has been suspended due to many controversies.

Move is a secure and flexible Libra blockchain programming language, an executable bytecode language for implementing custom transactions and smart contracts.

But as Zuckerberg’s “stable currency” dream was broken, Move gradually withdrew from people’s vision.

The text and pictures in this article are from AI Frontline

loading.gif

This article is reprinted from https://www.techug.com/post/meta-selects-four-programming-languages-as-its-preferred-language-officially-each-languagec58fd666029a51fbb0e8/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment