• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1060
  • Last Modified:

How Was First Compiler Invented? How Machine Could Read First Compiler? What Was There Before Compilers?

I'm wondering, if compilers are written in human readable way, then how come the machine could read the compiler?

If machine could read the compiler - which is by itself is not a machine language, why don't the machine just read the high level programming language directly? As it is known, machine only can understand in binaries. If the compiler was written in binaries, in such a way that these binaries can fetch the high level language and translate it back to machine language, it would make more sense, but compilers are not in binaries, so there should be something else.

If a language needs a compiler, then how come a compiler is invented, since this compiler is a language and it will a compiler, see its confusing now!

I'm sure there are experts here who knows the answer. Waiting your reply.
0
F-J-K
Asked:
F-J-K
  • 2
1 Solution
 
F-J-KAuthor Commented:
No one knows?
0
 
zstapicCommented:
Hello!
Do you know the legend of the German  baron and bootstrapping? According to legend, he was drowning in the sea, and pulled himself out of the water by pulling his bootstraps :)
Look it up ;)

The thing is, first computers ware programmed in binary, then assembly was invented to. So the job of the compiler was just table mapping values. It was a program written in binary code so when it saw something like "ADD $00000101 #R1" it translated the mnemonic ADD to some code like 001010010 and the computer was sending this information to electronic part for addition function, flowing the binary value 5, and register 1, where code $ was direct input and # was symbol for memory register 1. In this respect, the calculated sum will be stored in register R1. (the values are just an example, hence different microprocessors have specific registers and accumulators and therefore assembly mnemonics)
So you see, it's just mapping values, the next step is some language like C, know you can write in assembly how to translate C code in actual assembly commands. No matter which generation language you have, it allways ends up in assembly, and eventualy in binary code.
I suggest you to write a simple program in C++, just a hello world. - And then find some dissasembiling program on the Internet. - this is the actual way that crackers crack software :(

Cheers
0
 
F-J-KAuthor Commented:
well done!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now