The DeisLabs team from Microsoft recently opened a new Rust-based software, Krustlet, that can be used to run WebAssembly modules on Kubernetes. Kubernetes is an open source container cluster management system from Google, written primarily in the Go language. And what’s behind Microsoft’s choice of Rust to write this Kubernetes-related project?
Taylor Thomas, a senior software engineer at Azure Deislabs, explains that one of the main motivations is Rust’s compatibility with WebAssembly, abbreviated as WASM. WASM is a portable, abstract syntax tree that allows developers to compile using their familiar programming language stoym and run in the browser by the virtual machine engine. Compiled WASM binaries, or modules, can run on any system, and Rust is one of the few languages that provides native build support for these binaries.
In addition to compatibility, another big reason the DeisLabs team chose Rust was its “robust security.” Thomas says that while Rust’s borrow checker can cause some trouble early in the project, it is very efficient to write with Rust once you’re learning and using it. The team spent about a week learning how to work, and after two weeks efficiency increased by 50 percent, and by one month, everyone could easily write code and achieve maximum efficiency.
Most importantly, because of the strict rules of the Rust compiler, it is able to contain some errors at the source. Rust saves a lot of time and increases productivity compared to late-stage maintenance and commissioning.
For the newly developed project Krustlet, Kubernetes has a lot of custom data, and cloud computing is distributed. According to the team, Rust’s adoption “has these protections and security assurances at the compiler level that give us confidence in the code we are writing.”
The Krustlet project is marked as “highly experimental” and is not currently recommended for use in production environments. Thomas also points to Rust’s asynchronous runtime problems and learning curve issues. “It takes weeks of effort to learn how to code correctly in Rust before the learning curve levels down. However, due to the above security features, this upfront effort can be richly rewarding. Once developers have moved beyond this initial curve, they can easily contribute to the code as easily as in any other language. “
The “learning curve” was also seen as a major factor in developeradoption of Rust in the Rust Language Annual Survey, released last week. Rust is in the spotlight at the moment, but it’s still not popular because of all the obstacles. Nevertheless, the Microsoft DeisLabs team said in a blog post that they see a bright future for Rust in cloud software and will continue to try to adopt Rust in a variety of appropriate projects.