Languages And Translators Flashcards
What are the 2 low level languages you are expected to know?
Machine code and Assembley language
What is low level language
A low level language is close to the processor
What is a high level language
Written using English like words and are platform dependant
What are a few examples of a high level language
C, C++, Java, Visual Basic, JavaScript, Perl, Python, Ruby, SQL, MatLab, HTML, Mercury, OPS5, and Prolog
What is first generation language and an example of one
Languages interpreted directly by the processor e.g. machine code
What is second generation language and an example of one
Used in Kernels and hardware drives e.g. Assembly language
What is second generation language and an example of one
Used in Kernels and hardware drives e.g. Assembly language
What is third generation languages and an example of one
These are imperative(step by step instructions) languages e.g. C, C++, Java, Visual Basic and Javascript
What is fourth generation language and an example of one
These consist of statements that are more like statements in the human language e.g. Perl, Python, Ruby, SQL, MatLab and HTML
What is fifth generation language and an example of one
These have visual tools to develop a program e.g. Mercury, OPS5 and Prolog
What is machine code
A language consisting of binary or hexadecimal instructions which a computer can respond to directly
What is assembly language
A symbolic code, using mnemonics that is platform specific
Name a pro and a con of using Machine code
Pros
Programs run quick
Programmer interfacing directly with the processor and has more control
Cons
Long winded
Error prone
Not portable between processors
Hard to debug
Detailed knowledge required
Name a pro and a con of using assembly language
Pro
Easier than machine code and take less mem than high level languages
Programmer directly interacting with registers, more control
Cons
Code is difficult to read than high level
Detailed knowledge required
Machine dependant, not portable without modification
Name a pro and a con of using high level language (HLLs)
Pros
Uses English language like keywords, therefore easy to understand
Platform independent
No knowledge of hardware required
Cons
Programmer must rely on the compiler to optimise the code
What are the three translators
Assembler
Compiler
Interpreter
What does a translator do
It produces machine code from a source
What is a compiler
Translates the whole source program into machine code in one pass
Name a pro and a con of using a compiler
Pros
Once source code has been compiled you no longer need the compiler or source code
Customer does not need to buy a compiler
Programmer does not need to distribute their source
Cons
Debugging code will be slower than using an interpreter
The object code will only run on the processor type it was originally compiled for
What is an interpreter
Translates each line and immediately performs the required action before translating the next line
Name a pro and a con of using an interpreter
Pros
Programmer gets immediate feedback while they are developing
Cons
Same section/line of code may be translated over and over, complied programs would run faster
Programmer needs to distribute their source, and customer needs to install an interpreter
What is an assembler
Takes basic computer instructions and converts them into a pattern of bits that the computers processor can use to perform basic operations
What is bytecode
An instruction set, used for programming, that can be executed on any computer which has a virtual machine installed. Usually the source is compiled to bytecode then bytecode is interpreted