Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What language features are required in a programming language to make a compiler?

Programming languages seem to go through several stages. Firstly, someone dreams up a new language, Foo Language. The compiler/interpreter is written in another language, usually C or some other low level language. At some point, FooL matures and grows, and eventually someone, somewhere will write a compiler and/or interpreter for FooL in FooL itself.

My question is this: What is the minimal subset of language features such that someone could implement that language in itself?

like image 216
Matthew Scharley Avatar asked Oct 05 '09 07:10

Matthew Scharley


People also ask

What language is used to make a compiler?

Compilers are often written in the language of said compiler. For example, a C compiler is typically written in C.


1 Answers

Compiler can be written even using a Turing machine - a Universal Turing Machine is basically a compiler/interpreter of any Turing machine, so any Turing-complete language should be enough :)

like image 123
Marek Avatar answered Nov 07 '22 18:11

Marek