compiler-constructioninterpreter

Is compiler common to all programming languages


For different programming languages, is there different compiler or the compiler will be common to all the programming languages? In which language compiler will be written.


Solution

  • A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor . The file that is created contains what are called the source statements . The programmer then runs the appropriate language compiler, specifying the name of the file that contains the source statements.

    So clearly, every language has its own specific language supported compiler to convert source code into machine code.

    refer to this link for more information related to language in which compiler is written : How was the first compiler written?

    I agree with above answer that java or other high level programming language's compiler must be written in C etc because it is a language closely related to machine.