r/AskComputerScience • u/lepriccon22 • Jul 11 '16
How do you program a programming language?
I.e. How do you get a computer to understand a language? How does it actually make the transition from that language into assembly language?
45
Upvotes
16
u/simonorono Jul 11 '16
First, you define your language. Define its syntax, its semantics, everything.
Then, it comes the hardest part: developing a compiler/interpreter for it.
A compiler is just a translator, it takes source code from the language you defined and pours the equivalent program in another programming language (generally, with a lower level).
For example, the C compilers, read C code and translate them to assembly, them an assembler converts this assembly code into an executable.