This article was written in collaboration with Chris Konstad, a Production Engineer at Facebook.
For today’s interview, we have Chris Konstad who is a Production Engineer on the Video Infrastructure team at Facebook. The Video Infrastructure team builds world-class video infra comprising live streaming, video processing, transcoding, storage and more to ensure that we are able to deliver the best video experience on Facebook. While working on this team, Chris has been using Rust as one of the main languages for development. He works on our copyright and integrity audio and video matching systems, where he focuses on running our algorithms at scale. Let’s hear from him about how his experience with Rust has been and learn more about his work.
In what capacity have you been using Rust?
I wrote my team’s CLI tooling with Rust. It provides a human-friendly and scriptable interface to my team’s services in one package. Our CLI helps everyone on my team, from the systems engineers debugging issues in production to the algorithm developers that need to run large scale algorithm evaluations.
Why did you/your team at Facebook choose to use Rust over other languages?
We chose Rust because of the great variety of libraries and features that make writing complex CLIs a breeze:
- Structopt is awesome for CLI argument parsing, and it can be used to generate detailed –help messages
- Indicatif is awesome for helping people know how far along their job is
- the async/await syntax makes writing async code (which is most of this CLI) very smooth
Before writing that tool in Rust, I tried to use Python to write a one-off migration script for a large scale database migration. Between problems with asyncio, and unforeseen exceptions, it was hard to achieve a fire-and-forget binary that could process the amount of data that we needed to process without stopping, which would slow down our migration. I ported the tool to Rust, and it was a great experience, with incredible reliability. Ever since then, I’ve been advocating that we write our tools, and eventually services, in Rust. Forgetting all other benefits, I think that Result and Option help my team avoid 75% of the problems we’d otherwise run into in production.
What are some of the projects that you’ve worked on at Facebook that use Rust?
- My team’s CLI tooling
- I briefly worked on a project that used Rust in the server provisioning process during a Hackamonth at Facebook
- I’ve volunteered my time to work on miscellaneous Rust shared libraries
How do you feel about Rust’s growth trajectory at Facebook?
I believe that Rust is taking off at Facebook. It’s been a long process, but it is gathering more steam every week. It’s awesome to watch. By working on tooling that can lower the barrier of linking to C++ libraries, I’m seeing more and more internal library support without requiring any re-implementation.
What value does Facebook add to Rust?
Facebook’s work on cxx in particular is incredibly valuable to organizations that want to bring Rust into an existing C++ codebase. I hope to see more investment in the space, because I think Rust is particularly well-positioned to take over the systems programming space. I say this as an engineer who started off focused on writing distributed systems in C++.
How do you think Rust is growing as a language in 2021?
- cxx support leads to easier/trivial bindings to C++ code, which means it’s much easier to partially adopt Rust code
- It seems like more and more people are working on Rust professionally, which will be great for the ecosystem. I believe that those resources are the inflection point for Rust’s adoption.
Some people who have used Rust have come to really like it, why do you think that is and what is your favorite feature about Rust?
I think it’s because Rust gives you the power and (most of) the flexibility of a low-level language like C++ or C, but with the safety and expressiveness of higher level languages. I believe it leverages decades of programming language design research and experience to pull together a language and tooling environment that is awesome to use. Working with the compiler is like working with a coworker who is answering most of your questions and pointing out bugs you wrote before you noticed them.
I can’t choose a favorite feature about Rust, there are too many.
- compile time guarantees (Option, Result, borrowck)
- macros, which lead to some awesome libraries (cxx, Structopt)
- iterator API
- .await is really nice for chaining
Where can people learn more about Rust and how can they start contributing to it?
Check out the Rust book, and Rust by example. Additionally, there are some really great videos on YouTube about creating libraries in Rust. One of my favorites is creating a channel implementation in Rust from scratch.
We would like to thank Chris, for taking the time to do this interview. It was very interesting to learn how Rust is being used as a primary language to build CLI tooling and how we are learning from all the things we build here and contributing back to the Rust community for others to benefit from this as well. We hope you found this interview useful and it gave you some insight into how and where Rust is being used at Facebook. Look out for more interview blogs where we meet with many more engineers and hear their thoughts on this topic.
About the Meet the Rustaceans series
Rust has consistently been ranked as the “most loved” language for the last 5 years and we at Facebook believe that Rust is an outstanding language that shines in critical issues such as memory safety, performance and reliability and is being used widely over a large range of projects here. This blog is a part of our Meet the Rustaceans series, where we invite the engineers and developers who use Rust on a regular basis to share their experiences and tell us about the amazing products that they are building using Rust here at Facebook.
Interested in working with Production Engineering at Facebook? Check out our job postings on our Production Engineering career page here.
Facebook-Meta Earns the ‘Worst Company of 2021’ Title in This Survey
Facebook parent Meta has been named the Worst Company of the Year (2021) by Yahoo Finance respondents. According to the publication, an “open-ended” survey was published on Yahoo Finance on December 4 and 5, where 1,541 respondents participated. Facebook received 8 percent of the write-in vote, but respondents were seemingly mad about the Robinhood trading app as well. Electric truck startup Nikola, which was named last year’s worst company by the same publication also faced respondents ire.
Yahoo Finance even highlights, “At the same time, some critics, including conservatives, say Facebook over-policed the platform’s speech and stifled their voices.” Critics also blame Facebook and other social media platforms for not curbing hate speech that led to Capitol Building riots.
However, around 30 percent of Yahoo Finance readers said that Facebook or Meta could redeem itself. One respondent suggested that the company could issue a formal apology for negligence and donate a sizable amount of its profits to a foundation to help reverse its harm.
On the other hand, respondents chose Microsoft as the Company of the Year (2021). The Satya Nadella-led company touched the trillion-mark this year and introduced notable upgrades. The most notable is the Windows 11 OS update that succeeds Windows 10.
Facebook pays 1.7 Cr fine to Russia after failing to delete content Moscow deems illegal
In the latest legal tussle with Russia over controversial social media regulation laws, Facebook paid 17 million roubles (Rs 1.7 Crore) for failing to remove content deemed illegal by Moscow. With a threat of potential larger fines looming, Facebook parent company Meta, owned by Mark Zuckerberg, is scheduled to face court next week over repeated violations of Russian legislation on content, Interfax News Agency reported. As per the latest updates, the social media giant could be fined a percentage of its annual revenue.
In October, Moscow sent state bailiffs to enforce the collection of 17 million roubles. Meanwhile, as per Interfax report citing a federal bailiffs’ database, on Sunday, there were more enforcement proceedings against the company. Apart from the popular social media app, Telegram has also paid 15 million roubles in fines for failing to comply with the Russian social media legislations that came into force in 2016.
Facebook pays $53k to Russia for refusing controversial social media laws
It is pertinent to mention that Facebook has locked horns with Moscow earlier in November, resulting in it paying 4 million roubles ($53,000) over its refusal to adhere to Russian data localisation laws, the Moscow Times reported. The Moscow court on November 25 had said that Facebook paid the fine levied in February, following which all proceedings against the US-based social media giant. The payment comes against the litigation filed against the company in 2018, alongside Twitter. The tech companies were also forced to pay an additional 3000 rubles ($40) for failing to comply with user data sharing rules as per the law. The Russian authorities have also previously blocked LinkedIn, owned by Microsoft, for failing to abide by the laws.
Russian social media laws
As per Moscow Times, under the Russian social media regulation laws, all foreign technology companies are required to store data related to Russian customers and users on servers located in Russia. Additionally, the Russian tech companies will also have to share encryption data with the federal authorities as well as record user calls, messages and civil society group conversation records. The apparatus is said to be a severe breach of privacy rights and unfettered back-door access to personal data that could be used to harass Kremlin critics.
Facebook Messenger Is Launching a Split Payments Feature for Users to Quickly Share Expenses
Meta has announced the arrival of a new Split Payments feature in Facebook Messenger. This feature, as the name suggests, will let you calculate and split expenses with others right from Facebook Messenger. This feature essentially looks to bring an easier method to share the cost of bills and expenses — for example, splitting a dinner bill with friends. Using this new Split Payment feature, Facebook Messenger users will be able to split bills evenly or modify the contribution for each individual, including their own.
The company took to its blog post to announce the new Split Payment feature in Facebook Messenger. 9to5Mac reports that this new bill splitting feature is still in beta and will be exclusive to US users at first. The rollout will begin early next week. As mentioned, it will help users share the cost of bills, expenses, and payments. This feature is especially useful for those who share an apartment and need to split the monthly rent and other expenses with their mates. It could also come handy at a group dinner with many people.
With Split Payments, users can add the number of people the expense needs to be divided with and, by default, the amount entered will be divided in equal parts. A user can also modify each person’s contribution including their own. To use Split Payments, click the Get Started button in a group chat or the Payments Hub in Messenger. Users can modify the contribution in the Split Payments option and send a notification to all the users who need to make payments. After entering a personalised message and confirming your Facebook Pay details, the request will be sent and viewable in the group chat thread.
Once someone has made the payment, you can mark their transaction as ‘completed’. The Split Payment feature will automatically take into account your share as well and calculate the amount owed accordingly.
Tasneem Akolawala is a Senior Reporter for Gadgets 360. Her reporting expertise encompasses smartphones, wearables, apps, social media, and the overall tech industry. She reports out of Mumbai, and also writes about the ups and downs in the Indian telecom sector. Tasneem can be reached on Twitter at @MuteRiot, and leads, tips, and releases can be sent to firstname.lastname@example.org.