How Compilers are Made

Hello everyone :D

I am interested in Compilers and how they work. I'm not going to make one because it it too hard for me, but I was wondering how the first ever compiler was made. I've searched the web but I wasn't able to find a lot of information.

Could anyone please offer me any help?

Thanks,

Muhasaresa

I think it goes something like this:

First generation: (machine code)
The original computers were programmed directly with binary numbers to represent instructions and data.

Second Generation: (assembly language)
Then they made "assemblers". These allowed programmers to use descriptive words (mnemonics) to represent each instruction number that the computers understood. After a time the assemblars became more sophisticated and common tasks could be placed in "macros" to make life easier. A "macro" is where one word represents a whole bunch of assembler "mnemonics", perhaps with some substitution.

Third Generation: (c, pascal etc...)
Eventually more complex computer languages developped that provided higher level constructs that would each generate a whole bunch of assemblar mnemonics. True function calls could now be made using a single high-level instruction. Programs written in these 'third generation' languages would be converted into assembly language and then assembled into machine code. The conversion from a third generation language (3GL) into assemblar is called "compiling".

So the very first compilers were written using assembly language, which is very close to machine code. Afterwards (as in today) they were written in the third generation languages.
Last edited on
If you're interested in the how, as well as the history, this article might be of interest.

"Writing Your Own Toy Compiler Using Flex, Bison and LLVM"
http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/
Thanks for the help :D
Topic archived. No new replies allowed.