Search code examples
compiler-constructionprogramming-languages

Programming language and compiler


I was having this discussion with my friend and realized this might be the best place to ask this question ?

How is a new language born ? This new language NEW must be written in some old language OLD (eg C++ was written in C in initial stages), or how is this created ?? And, how does this language NEW can work itself if there is no compiler for it ? So, there must be some compiler for it ? Who writes compiler for it ?

So, how does all this work together, new language and its compiler, relation of new language with its old base language ?


Solution

  • You write the compiler in an implementation language until such time that the compiler can begin to compile enough of the new language to be used to implement the rest of the new language.

    That's how it works.

    Edit: Just to clarify, the commentors on this answer are also correct. The compiler doesn't HAVE to be written in the new language unless you want to. As said, some don't go that route and stay with the original implementation language.