0
votes

All programming languages are translated to machine code which is then executed by the hardware interpreter. However what translates the code of translators such as compiler code and interpreter code? A compiler translates source code but compiler also written in some language so what translates the compiler code/interpeter code?

Thanks

1

1 Answers

0
votes

All programming languages are translated to machine code which is then executed by the hardware interpreter.

That's not necessarily true. Barring JIT compilation, interpreters usually don't translate the given language to machine code.

However what translates the code of translators such as compiler code and interpreter code?

If you write your interpreter or compiler in C (for example), it will be translated to machine code by a C compiler - just like any other C program would. Compilers and interpreters aren't special in that regard.