C021TV-I3-S2
I.3 Programming Machine code Bugs Humans and languages Higher level language and compilation Bugs Humans and languages
Compilation ? Idea 2
Compilation ? Idea ⇓ Main aspects 2
Algorithm + data structure Compilation ? Idea ⇓ Main apsects Algorithm + data structure 2
Algorithm + data structure Compilation ? Idea ⇓ Main apsects Algorithm + data structure Program 2
Algorithm + data structure Compilation ? Idea ⇓ Main aspects Algorithm + data structure Program Machine code 2
Algorithm + data structure Compilation ? Idea ⇓ Main apsects Algorithm + data structure Program ⇓ Compilation Machine code 2
Compiler? A compiler is a program! As a first approximation, It takes a text in a specific language (C, C++, OCaml. . .) It sends back either a text or an executable as an assembler. There are also interpreted languages where the program is dynamically executed by the interpreter.
Compiler ++ Moreover, the compiler Checks there are no syntax errors Checks there are no type errors (depends on the language) Can check a certain number of simple criteria and issue warnings (such as unused variables). So it checks(at least) that the program can be transformed into an executable. 4
Compiler ++ Moreover, the compiler Checks there are no syntax errors Checks there are no type errors (depends on the language) Can check a certain number of simple criteria and issue warnings (such as unused variables). So it checks(at least) that the program can be transformed into an executable. But that does not guarantee the program will do what we want it to do! 4