+ 1
High-level language to machine code questions (See description)
Are all programming languages converted to a computer's machine code just before execution? If so, where does this happen? Are .exe files filled with machine code? I'm just trying to get an idea of the process of how a code from any programming language is converted to machine code that the cpu executes. Sorry I'm a noob..
2 Answers
+ 4
Suppose you have a C++ source code. We all know that C++ is a compiled language, but what does it mean? It means that a compiler translates the code into a binary file. Wait, what is a binary file? A binary file is a file containing solely machine instructions, not readable by humans(well, some of them). If you analyze each byte of the binary file you may be able to know what the program does, but you need to know asm for that. And yes, a .exe is a binary file.
Now suppose you are coding with your favorite language(python). Python is an interpreted language. This means the interpreter translates the code into machine language BUT line by line as its being executed, so it is slower.
But yes, every programming language translates code into machine code. If they dont, how would the computer understand what instructions are you telling him to do? A computer only understands one universe, and that universe is just filled with machine instructions.
0
Thanks!!