+----------------+
| Source Code |
+--------+-------+
|
+------+-------+----------------+
| |
+---v---+ +-----v-----+
|Compile| |Interpret |
|Program| |Program |
+---+---+ +-----+-----+
| |
+---v---+ +-----v-----+
|Machine| |Execute |
|Code | |Line by |
+---+---+ |Line |
| +-----+-----+
+---v---+ |
|Run | |
|Machine| |
|Code | |
+---+---+ |
| |
+--------------+---------------+
|
+-------v-------+
| Program Output|
+---------------+This flowchart starts with the Source Code as the input.
There are two main paths:
- Compilation path: The source code is first compiled into machine code, which is a low-level code the computer understands directly. Then, the machine code is run by the computer's processor. This produces the program output.
- Interpretation path: The source code is interpreted line by line by an interpreter program. Each line is executed immediately without creating a separate machine code file. This also produces the program output.
Both paths end with the Program Output, which is what the user sees or the result of running the program.