Who Came First: The Source Code Or The Compiler?

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, May 11, 2015

Follow me on Twitter as @mattiasgeniar

Let’s get philosophical for a second.

The dilemma of who came first, the chicken or the egg, is an old one. And still up for debate.

From a modern scientific perspective, the chicken came first because the genetic recombination that produced the first “chicken” occurred in germ-line cells in a non-chicken ancestor.

Another literal answer is that “the egg” in general came first, because egg-laying species pre-date the existence of chickens.

To others, the chicken came first, seeing as chickens are merely domesticated red junglefowls.

Chicken or the egg

Do we have the same philosophical question in IT?

After all, imagine the following scenario for compiling the gcc compiler from source.

  1. Download gcc source code
  2. Configure the different options of gcc
  3. Compile gcc from source … using gcc?

How do you compile gcc from source when it requires gcc in the first place? As the installation docs describe it:

When configuring a native system, either cc or gcc must be in your path or you must set CC in your environment before running configure. Otherwise the configuration scripts may fail.

gcc configuration

When you try to compile gcc without the gcc binary present, the build will indeed fail.

$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
...
configure: error: in `/usr/local/src/gcc_test/gcc-5.1.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Is this the Chicken or the egg equivalent of software engineering(1)?

(1) Yes, I know there are ways around this, but it just struck me as a funny comparison.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.