Wednesday, March 25, 2020

Rust at Apple

I recently saw the following job advertisement at Apple, posted January 29, 2020. (I assume the link will eventually go away once the job is filled, but the text of the ad is what is pertinent here.)
We are seeking an experienced software engineer with a passion for computer networking and security. Be part of a small, highly skilled team building network infrastructure services at Apple. 
The Apple Cloud Traffic team provides a secure networking layer to underpin consumer-facing applications. Based on a custom implementation of IPsec, it must handle the encryption of every packet passing between servers within and across vast data centres, with minimal overhead. Custom-built secure RPC protocols manage the keying, authentication and authorization of all traffic flows. 
The performance and security of the systems we build are critical. We interface directly to low-level Linux kernel interfaces, using asynchronous I/O and threads to distribute workload. Following a very successful first foray into Rust we are migrating an established codebase from C to Rust, and building new functionality primarily in Rust.
 Here are a few aspects I would like to highlight:

  • They are migrating an established codebase from C to Rust. This suggests that the well-known problems in C of insecure memory accesses and undefined behavior are impairing the stability of the system, and that the safety guarantees of Rust are expected to eliminate those problems. Code migration is a lot of work!
  • They are making significant use of multithreading, another strong point of Rust. The compiler's ability to prevent race conditions in RAM will be a big advantage here.
  • Overhead needs to be minimal. The high performance that Rust facilitates will be helpful here.
  • The system is making direct system calls to the kernel. Again, the ability of Rust to compete with C in the low-level systems space is emphasized.
I expect we will see more and more similar advertisements as the benefits of Rust continue to become better known.