Rust

Rust

Rust is a programming language used to write very fast software while ruling out a whole class of typical errors before the program even starts. It is considered a modern alternative to the older languages C and C++ and is used, among other things, in operating systems, browsers, and cloud services.

Rust is a programming language. A programming language is a fixed notation in which humans give instructions to a computer. Rust was developed starting in 2006 at the company Mozilla, which also builds the Firefox browser, and appeared in its first stable version in 2015. Its goal is a rare combination: programs should run as fast as in the old languages C and C++, but contain significantly fewer dangerous errors. The decisive trick is that a checking program inspects the written text before it is even executed and simply does not let certain errors through. For several years now, Rust has therefore regularly appeared in tech news whenever large companies rebuild their software.

Why memory errors are so costly

A program stores its data in the computer’s memory. In languages like C, the programmer himself must ensure that he only accesses valid locations. If he forgets this, the program reads or overwrites foreign areas. Such memory errors not only cause crashes, they are also the most popular gateway for attackers.

The numbers on this are remarkably clear. Microsoft and Google have independently reported that around 70 percent of their severe security vulnerabilities are due to memory errors. The US authority CISA also publicly recommended in 2023 that companies switch to memory-safe languages. Rust is the best-known language that meets this requirement without becoming slower in the process.

The economic point behind this is simple. An error that a checking program finds while writing code costs minutes. The same error in a shipped product costs a security update, trust, and sometimes customer data. This is exactly how companies justify their investments in Rust.

Ownership and borrowing of data

The heart of Rust is a rule called ownership. Every value in the program has exactly one owner. Once the owner is done, the memory space is automatically freed. The programmer therefore neither has to clean up himself nor hope that some background management will eventually do it.

Other parts of the program may borrow a value. A strict condition applies here: either one part may modify the value, or several may only read it. Both at the same time are forbidden. You can imagine this like a textbook from a library. Many may read it, but only one may write in it, otherwise the content contradicts itself.

The borrow checker, a part of the compiler, watches over these rules. It rejects code that violates the conditions. This is frustrating for beginners, because the program often does not compile at first. In return, crashes disappear that would otherwise only have been noticed weeks later in operation. Incidentally, the same rule prevents many errors when several parts of a program run at the same time.

Rust in the Linux kernel and in the cloud

Since 2022, Rust has been allowed in the Linux kernel, i.e. in the core of the operating system that powers almost all servers and all Android phones. This was a minor sensation, because this kernel had consisted practically only of C for over thirty years. Windows now also contains Rust parts. Android has significantly increased the share of new Rust lines of code and, in doing so, measured a clear decline in memory errors.

In the tech industry, you often encounter Rust indirectly. Amazon Web Services uses it for building blocks of its cloud, Cloudflare for processing internet traffic, Discord for servers under high load. Many modern developer tools are also written in Rust, because it makes them noticeably faster to start. The language also appears in the AI space, for instance in tools that prepare text for language models.

A common misconception is that Rust is a competitor to Python. That is rarely the case. Python is easy to learn and intended for experiments, Rust for software that has to run fast and stable over the long term. In surveys among developers, Rust has ranked number one among the most loved languages for years. At the same time, it is considered hard to learn, which makes getting started its own selling point in job postings.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.