home  >  software  >  rusts-complexity

Exploring Rust’s Complexity

About Complexity

To preface this post, I would like to talk about complexity in software.

Complexity in software is an odd problem. The difference between building a bridge and building an operating system, is that we have a pretty good idea of what a good and what a bad bridge looks like and what laws govern it (the laws of physics). And often we can look at nature to copy from it or maybe even find something better to learn from (like we did for the dynamics of cars, trains and planes). Now where in nature do we look for, when trying to figure out what a good operating system looks like? What might be a good cpu architecture? What would make a better Photoshop? Well, we usually have to start from scratch and go by trial and error.

How does nature do trial and error? If we look at evolution, it is actually pretty simple. Organisms live their life with a certain set of features. They eventually die, and their offspring - born with a slightly modified set of features - lives on, trying to navigate their environment and the organisms that received an advantage through their modifications, will statistically produce more successful offspring. Rinse and repeat for billions of years, and you get mind boggelingly complex organisms, with brains, immune systems, lungs, a stomach and so on.

But operating systems do not produce “baby” operating systems. Engineering does not work like that. We build it. We test it. We use it. But now, that the whole world runs on software, it is also dependend on it. Unlike in nature, where offspring dies, the software we use does not die. The software that makes most bank transactions work is sometimes decades old, written in COBOL (An ancient programming language, for software standards anyways). And we can not just discard all that code, rewrite it and improve it. In theory yes, we could, but in software there are always economics and politics involved.

So where am I going with this? The tl;dr of this section is: The field of software is still in its infancy. We do not have anything comparable in our environment that could give us guidance. It is a painstakingly hard process and requires immense effort of some of the smartest mathematicians, computer scientists and programmers to figure out and produce better things. So when we see complexity in software, it is sometimes hard to tell if it is necessary or avoidable complexity. We would not know, because we are generally pretty bad at software.

But now to the good stuff, the topics that are very complex in Rust.

Since there is a lot to cover, I decided to break up the article in seperate posts.

Sources