Programming Languages Flashcards
What does a compiler do with a whole file?
Reads in a whole file and translates it at once.
Compiler & Interpreter definition
A translator that converts high-level language source code into object code, often machine code.
Object code
The translated source code.
Assembler
Translates the mnemonics of assembly language programs into machine language instructions for the microprocessor to carry out.
What does a compiler produce?
Produces an executable file.
Can the end-user see the programming source code in compiled languages?
No, the end-user cannot see the programming source code.
Is additional software needed to run compiled code?
No, compiled code does not need an additional environment/software to run.
Are executable files from compilers portable?
Executable file is portable between machines with the same architecture and operating systems.
What does an interpreter do line-by-line?
Reads, translates, and executes one line at a time.
What does an interpreter require to run code?
A special environment is needed to be installed on the user’s machine to run the code; this is machine specific.
Can the end-user see the programming source code in interpreted languages?
Yes, the end-user can see the programming source code.
Is source code from an interpreter portable?
Source code is portable to any machine with an interpreter which can run on it.
What is a similarity between compilers and interpreters related to code translation?
One line of a compiled language maps to multiple executable instructions.
What do both compilers and interpreters do?
Both are used to interpret high level programming languages.
What do both compilers and interpreters produce?
Both produce machine code from human-readable source code.
What is a key difference in how compilers and interpreters read code?
Compiler reads in a whole file and translates it at once. Interpreter reads, translates and executes one line at a time.
Does an interpreter produce an executable file?
No, an interpreter does not produce an executable file.
What is the portability difference between compiled and interpreted code?
Compiled executable runs on machines with same architecture and OS. Interpreted source code runs on any machine with interpreter.
Does compiled code require additional software to execute?
No, compiled code does not require additional software to execute.
Does interpreted code require additional software to execute?
Yes, an interpreter needs a special environment installed on the user’s machine.
Instruction set
The list of all possible commands a particular CPU knows how to carry out.
Machine code
The binary codes representing each of the instructions in the instruction set.
Translator
A program that converts source code into machine code.
Source code
The text of the program that a programmer writes.