Compiler Design- BootStrapping

Rating 4.00 out of 5
[?]

Bootstrapping (Compilers)

We got an assignment to find out about bootstrapping in our very first class. I found about it and thought of sharing the same with you all.

We all know that the Java Compiler is written in C. Generally the compiler is not written in the same programming language it has to compile. But if we think of the very early compilers, how would they have been developed, here comes in bootstrapping. The concept is the answer to “Hen egg problem in case of compilers”. For those who didn’t get this yet, well think about how would the very first high level programming language would have been implemented? Did they use assembler? If they used assembler, how did the assemblers come into existence? Hope now its clear.

Bootstrapping: It is a means of developing a compiler in the target programming language which it is intended to compile.

Lets take an example and see this. Consider an Assembler, we can define a language as a subset of another. So lets say we have “subset 1” contained in “subset 2” which is contained in “subset 3” and so on.

One might first write an assembler for “subset 1” of Assembler in machine code, perhaps on a load-and-go basis . Lets say that this subset assembler program might, perhaps, do very little other than convert mnemonic opcodes into binary form. One might then write an assembler for “subset 2” of Assembler in “subset 1” of Assembler, and so on.

This process, by which a simple language is used to translate a more complicated program, which in turn may handle an even more complicated program and so on, is known as bootstrapping, by analogy with the idea that it might be possible to lift oneself off the ground by tugging at one’s boot-straps.

Anshuman

About Anshuman Pandey

Computer Engineer ... Endurance Runner ... Physics Geek ... Genius
Bookmark the permalink.

2 Comments


  1. Actually, the Java compiler is written in Java. The very first Java compiler was written in C++. If you examine the javac.exe executable in Windows you’ll notice it make a JNI call to a Java program that performs the compilation.


  2. Thanks a ton mate! I’ve got an exam tomo, your simple explanation just saved my butt :)

Liked it? Share Your Thoughts!