Bug Vanquisher

3 November 2007

Building The Tools

Filed under: Computer Theory, Dev inside! — Tanveer Badar @ 1:12 PM

Connected with the extremely twisted last post, consider the methods of programming the machines we have seen since 1943. Let us build a hierarchy of tools we use for programming and how they must have come to be what they are right now.

ENIAC was programmed using rewiring and four years later than that for ROM function tables. Only six women programmed it. Compilers existed long before that. Assemblers came out a little late. We see the first portable programming language in 1972. High level languages soon follow, my first love enters the picture, the world is swarming with all sorts of OO and high level languages by mid 1980s. Declarative languages add to the mix at this time too. Right now, we are partying on very expressive programming environments.

Grab Visual C++ compiler, the language I use most. Or better yet csc.exe. Consider how that compiler itself must have been built. If you have seen rotor, you will know that csc itself is written in C++. Therefore, it will require a C++ compiler, definitely cl.exe because of this. Put cl.exe into the interrogation box and ask the same question, who is your mother? It will say cl.exe with a build number or version number smaller than mine.

But this isn’t a chicken and egg problem because it must have begun at the first build of cl.exe. Let’s say it was compiled with a C compiler. Then, who was the mother of that compiler? Some earlier C compiler. Who gave birth to that first one? An assembler is the most likely answer, say masm.exe. The question repeats itself, only this time in the context of assemblers. First assembler would have built the second and itself must have been built by some machine which required programming by re-wiring (only a guess, I have no proof :)).

This machine may have built a few assemblers. Those assemblers must have boot-strapped themselves and eventually one of them may have become powerful enough to build a C compiler. (Actually, from what I just read, it goes way back than that assumption. C was a transformation of B which had a compiler who origin was in BCPL’s compiler. But let us again skip the details and say BCPL compiler may have been built with an assembler.)

This early compiler must have boot-strapped itself too and built more powerful versions of it and other compilers. Definite proof for this is the C-front, first compiler for C++ which produced C code as a result which was compiled and executed. The process has been bootstrapping itself ever since and giving rise to more and more language compilers of all sort and hence, we trace the path from root to csc.exe!

If you look carefully, you will find my favorite data structure here too. Conceptually, ENIAC or something similar lies at the root. At every level, a transformation program (assemblers/compilers) is either boot-strapping itself or increase the set of available transformation programs at the next level. From ENIAC, we move to a decent number of assemblers, which boot-strap themselves to assemble BCPL (again, my hypothesis) compiler. BCPL compiler compiles B compiler which boot-straps itself and generates a C compiler. This C compiler again bootstraps and really makes the bomb go off by giving rise to other C compilers and C-front. And again, the rest is history.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: