Compiler paradox | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Compiler paradox

We write codes which are compiled( or intepreted) to machine readable language. Since the compilers are also just programs, Then,.......Are they created using machine code?. And IF they aren't, where are they compiled from? (coz i get trapped thinking of the FIRST compiler, which compiled the source code for the next compiler,.....)

19th Mar 2021, 4:50 PM
Msimbuzeey🇹🇿☯🔥
Msimbuzeey🇹🇿☯🔥 - avatar
3 Answers
+ 4
Not sure how the first C program was compiled but that compiler must have been written in either assembly or some other low level language at that time. But later they have rewritten the C compiler in C itself. It has become quite common to do this. Most of the compilers for new languages were first written in C and then later on were rewritten in their own languages. Example - Java earlier had a compiler built using C and then rewritten using Java.
19th Mar 2021, 5:58 PM
Avinesh
Avinesh - avatar
0
Martin Taylor Thanks for the explanation, though I think I'll need a little bit clarification when you said "It is the job of the compiler's backend to map things to actual machine specific op codes" Please explain further, cause am actually kind of a beginner
20th Mar 2021, 4:52 PM
Msimbuzeey🇹🇿☯🔥
Msimbuzeey🇹🇿☯🔥 - avatar