If you write a program in a programming language, a different program will convert the symbols in your program into symbols the computer understands. Sometimes this takes several steps. For example in C:
- User writes program in high-level language (C) which is not understood by CPU, but is directly understood by the programmer (we hope!).
User writes program in high-level language (C) which is not understood by CPU, but is directly understood by the programmer (we hope!).
- Compiler convertes C into Assmebly language, which is not directly understood by the CPU but is easy to convert into something else that is...
Compiler convertes C into Assmebly language, which is not directly understood by the CPU but is easy to convert into something else that is.
- Assempler converts Assembly into sequence of binary codes that are directly understood by the CPU.
Assempler converts Assembly into sequence of binary codes that are directly understood by the CPU. Some compilers skip the above step (step 2) and produce the compiled binary directly from the source code.
To guarantee that the computer understands your program, the compiler or interpreter will give you an error and usually halt if it encounters something that is not compilable, such as a syntax error. If your program cannot be compiled, it can never get to the stage where your program will try to run it and fail because it did not "understand" it.
To create a new language, you first design your high-level language and then you have to find a way to map the symbols of your new language to the assembly language commands that your CPU understands.