4.2 Types of programming languages, translators, IDEs Flashcards
What are the 2 types of programming languages
High-level languages
Low-level languages
What are High-level language
how is it executed
knowledge required to write HLL?
programming language that is independent of computer hardware, a program written in a HLL needs to be translated into machine code before it is executed.
No knowledge of hardware and instruction set of computers are required
Adv of HLL
- ease of reading and writing code
– ease of debugging code
– machine independence
Disadv of HLL
Programs are larger
Programs take longer to exec
Incapable of direct manipulation of hardware
What is LLL
Low-level languages - a programming language that is dependent on computer hardware
Adv of LLL
direct hardware manipulation
can write code that doesn’t take up much space
in primary memory
can write code that performs a task very quickly
Disadv of LLL
Takes longer to write and debug programs
Harder to understand
What is an assembly language
a form of low-level language that uses mnemonics
What is an assembler
a computer program that translates programming code written in assembly language into machine code
What is a translator
converts a program written in a high-level language program into machine code
What is a compiler
3 characteristics
a computer program that translates a source program written in a high-level language to machine code
An executable file of machine code is produced.
One HLL statement can be translated into several machine code instructions.
Compiled programs are run without the compiler
What is an interpreter
3 char
a computer program that analyses and executes a program written in a high-level language line by line
No executable file of machine code is produced
One HLL program statement may require several machine code instructions to be executed.
Interpreted programs cannot be run without the interpreter
Compiler vs interpreter vs assembler
what does it do?
Compiler - Translates a high-level language program into machine code
Interpreter - Executes a high-level language program one statement at a time.
Assembler - Translates a low level assembly language program into machine code.
Compiler vs interpreter vs assembler
Executable file of machine code?
Compiler - yes
interpreter - no
assembler - yes
Compiler vs interpreter vs assembler
How they are translated, what is required, etc
Compiler - One high-level language statement can be translated into several machine code instructions.
interpreter - One high-level language program statement may require several machine code instructions to be executed.
Assembler - One low-level language statement is usually translated into one machine code instruction.
Compiler vs interpreter vs assembler
How are programs run
Compiler - Compiled programs are run without the compiler.
Interpreter - Interpreted programs cannot be run without the interpreter
Assembler - Assembled programs are used without the assembler
Compiler vs interpreter vs assembler
Where are the programs distributed
A compiled program is usually distributed for general use.
An interpreter is often used when a program is being developed
An assembled program is usually distributed for
general use.
Adv and disadv of interpreters
easier to debug
quicker to test
easier to edit
DURING DEVELOPMENT
disadv:
programs cannot be run without the interpreter
programs can take longer to execute
Adv and disadv of compiler
adv:
Executed without the compiler
Takes up less space in memory when it is executed
Executed in a shorter time
disadv:
it takes a longer time to write, test and debug programs during development
What is an IDE
Integrated Development Environment -
a suite of programs used to write and test a computer program written in a high-level language
Features of IDE
» code editors
» a translator
» a runtime environment with a debugger
» error diagnostics
» auto-completion
» auto-correction
» an auto-documenter and prettyprinting
What is a code editor (IDE)
A code editor allows a program to be written and edited without the need to use a separate text editor
What is a translator (IDE function)
Translators are provided that enable a program to be executed (compiler and/or interpreter)
a runtime environment with a debugger (IDE function)
Find errors in a computer program running or tracing the program
what is a report window
A separate window in the runtime environment of an IDE that shows the contents of variables during the execution of a program
What is auto-correction (IDE function)
Dynamic error checking finds possible errors as the program code is being typed
What is auto-completion (IDE function)
offer context-sensitive prompts with text completion for variable names and reserved words.
What is pretty-typing (IDE function)
displaying source code using different colours and formatting, which make the code easier to read and understand
error reports
compiler vs interpretter
- A compiler provides an error report for the whole
code if errors are detected - An interpreter stops execution when an error is
found