Mozilla's Rust language was conceived by its designers as an option to write many kinds of software quickly and safely -- including full operating systems.

Over the last several months a team of developers has been busy doing exactly that: using Rust to create Redox, a full-blown Unix-like operating system designed as a radical rethinking of the Linux approach.

[ InfoWorld unveils the Bossies -- the best open source products of the year. | Track the latest trends in open source with InfoWorld's Linux report newsletter. ]

Clean slate

Redox uses Rust for its kernel-level code to provide more memory safety considerations than C allows by default. But the project doesn't simply rewrite Linux in a new language. Redox discards as much from Linux's version of the Unix tradition as it keeps.

As explained in the project's wiki and design documents, Redox uses a minimal set of syscalls -- a deliberately smaller subset than what Linux supports so as to avoid legacy bloat. The OS also uses a microkernel design to stay slender, in contrast to Linux's monolithic kernel.

Many of the OS's internal behaviors have also been rethought. Unix and Linux both use the notion of every item as a file. Redox goes a step further and treats everything like a URL, so it's simple to register handlers for events, and it provides a consistent manner to perform other kinds of abstractions.

https://github.com/redox-os/redox Redox, written in Mozilla's Rust language, has a minimal feature set compared to Linux and breaks from many of Linux's traditions, including licensing, kernel design, and APIs.

The plan, though, is not to replace Linux, but to provide a useful alternative that can in time run Linux software as-is. There are already a few hints: Many common Unix (and thus Linux) commands are supported, and there's a work-in-progress port of the ZFS file system.

Another radical break from Linux isn't in the software but in the licensing: The entire project is MIT-licensed and not GPL. The rationale is that the MIT license encourages downstream adoption far more readily than GPL, "since downstream is what really matters: the userbase, the community, the availability."

The long road ahead

Even though ISOs of Redox can be downloaded and booted, you aren't likely to ditch Linux for Redox in production any time soon.

For one thing, Redox is untested, with many missing features and a great many incomplete ones. Redox's developers also admit that it won't be possible to establish "complete 1:1 Posix compatibility" (because the OS omits many Unix syscalls), so existing Linux software will probably need a support layer on Redox to run -- a roadblock to its adoption.

Linux's legacy code base also won't be easily shrugged off. Decades of development and thousands of human-years of work have been invested in it and the C language development environment. The Rust language, by contrast, has existed for a few years, and only very recently reached a state of stability sufficient for most people to build large, ambitious projects with it.

Still, a project like Redox is valuable. If Redox can make good on its promise of being more secure by design, many of the embedded-device scenarios currently targeted by Linux might be better served by Redox. Mozilla has already talked about Rust as a language for Internet of things devices, so this would be a natural extension.

Redox can also serve as an example for approaching operating system issues differently, exerting long-term evolutionary pressure on Linux. If Linux isn't going anywhere -- all signs show it isn't -- then it's best to find ways to force it to become better.