Building a C++ compiler - A mind game
Some time ago, I had a funny conversation with a friend of mine. We both have some (not always glorious) background in C++ programming. While we were talking, we came up with the following strange mind game:
Imagine you were thrown into our world in a state like the Stone Age. No civilization exists, and you are the only human person on earth (maybe you can take a colleague with you, doesn’t really matter. You cannot get any descendants, however!). In addition, you have some basic knowledge about computers, software etc. The only thing you are given as your journey begins is quite a large book with all the specifications of the latest C++ programming standard. You cannot die and your only chance to escape your solitude is to write a working C++ compiler software. How long would it take?
We had a lot of fun imagining this situation and maybe this would be a cool scenario for some satirical video game. The final amount of years it would take depends, of course, on a large number of variables, like if you have to eat and care for shelter, in which place on earth you start and if a nasty alien invasion destroys your efforts every 10,000 years or so.
But even if you put these tiny details aside: it’s interesting to think about how much work and knowledge it actually takes to accomplish this task from scratch. You would have to invent electricity, learn a lot about semiconductors and transistors and establish your own factory with clean rooms, robots and so on. However, in order to build a factory you must have decent knowledge about engineering, you need machines, have to gather the material etc. And it gets even more ridiculous: If you didn’t start in a material-rich place with rare-earths, you might have to learn how to build ships, sail and cross the ocean. Understanding the C++ standard is only the frustrating tip of the iceberg, as you will have already judged yourself.
My previous considerations might have sounded obvious to you, and you are probably right. But I, however, think that this thought experiment is suited to make a specific point very clear: Our individual success in the modern world, be it of financial, scientific or any other kind, is based on thousands of years of hard labour and efforts, that our ancestors have made. We, on our very own, cannot achieve very much, and everything we do today is largely dependent on a long history of ideas and technological progress. Of course there have been outstanding humans all around the globe that achieved more than others or who lead to a bigger leap of progress. But in the end only cooperation and united efforts brought us where we are today.
In a society that cares very much about individualism and individual achievements, this might sound disturbing and disenchanting at first. However, it can also be a release when you realize all these expectations that society sets on us about how good we have to be and how much of an impact we must create in our world. They are based on a story of individual success, yet we, alone, have so little time and power. You should, of course, not stop doing your cool research, social engagement or whatever. Just remember that cooperation is key and that change might take a little longer than you would expect (from yourself).
All this being said, I think there is another aspect about this mind game. And it is the reason why I like it in particular. In science there is the famous saying of “standing on the shoulders of giants”. It describes this very idea, that all our scientific discoveries and our intellectual history are based on the work of major thinkers that have preceded us. This thought resembles our mind game above a lot, but it lacks a crucial point: Think in-depth not only about all the inventions and sciences that are necessary to fulfill your crazy task of writing a C++ compiler from scratch. Like we considered above, there is also so much pure manual labour necessary to achieve it, that it seems almost impossible to be carried out by just a single person (or even two unfortunate ones). I think this is very important to consider. Maybe the saying above is even somewhat arrogant in missing the point that our “gigantic” research would not be possible without all the “small” women and men who are doing care work, who are building our universities, who are cleaning them, who care about our food and much more.
This insight sheds light on how inequitable recognition and appreciation is spread in our world. And how dependent we all are on each other, making the fight for good working conditions and fair salary a fight that every one of us should support on a global scale.
Finally, I will not give a definitive answer to the question of the mind game, how long it would take to achieve our task. Our guesses ranged from 10,000 to 100,000 years, but maybe even that could be too short considering how hard it can be to be stuck on errors on your own, bare of any solution and external input. However, if somebody likes to come up with a solid estimation, I would be happy to hear about it!
Comments