What is Source Code?
Source code is the program code that is written by a programmer. Most source code programs are text files that can be created using a simple text editor.
When does source code need to be translated before it can be executed?
What does machine architecture–dependent mean?
To run a program, the source code must be translated into object code according to the low-level features of the operating system and the instruction set has to be hardcoded into the computer’s chipset
What are high level languages?
Give 2 examples
Python, Java
What are low level languages?
Give 2 examples
- Assembly language, Machine code
How is it determined which translator is used to translate a high level language?
It’s determined by the particular implementation of a programming language, some provide only one option, some provide both
What does a compiler do?
It translates the code all at once but does not execute it
What are the advantages of using a compiler?
What does an interpreter do?
Interpreters translate and execute each line of source code one by one
What are the advantages of using an interpreter?
What does an assembler do?
Assemblers translate assembly code programs into machine code.
What is Bytecode?
Bytecode is source code that has been compiled into low-level code designed to be run on a virtual machine so it speeds up the translation process.
2 advantages of using Bytecode
How does an assembler translate code from a high level into a low level?
It translates the source code (the input) into the equivalent 1’s and 0’s in machine code, producing object code.
How does a compiler translate code from a high level into a low level?
It scans over the source code several times performing checks and building up tables of information to produce the final object code
How does an interpreter translate code from a high level into a low level?