High and low-level languages Flashcards
What is a program?
- A computer program is a list of instructions that enable a computer to perform
a specific task.
Examples of high level languages
Python, C++, C, and Java
Adv. and Disadv. of high level languages
- Generally slower than assembly code - have to be more extensively translated - Resemble human language - Faster to write - Easier to debug - Easier to maintain
Low level languages + examples
- Relate to the specific architecture and hardware of a specific type of computer
- Assembly Language
- Machine Code
Adv and disadv of assembly languages
- Used with specific hardware, not generalizable
- Code is extremely fast and doesn’t take up much memory
- Can be difficult to write for programmers
Why would a programmer use assembly language?
To make use of special hardware
To make use of special machine-dependent instructions
To write code that doesn’t take much space in primary memory
To write a code that performs task very quickly
Info about machine code
Not written by human programmers
- Assembly language or high-level languages are all translated into machine
code before being fed to the processor
Translators
- Computers can only understand binary code, so high-level languages and
assembly code need to be translated
Compiler
A compiler translates a high-level language like Python into machine code
- This machine code is stored in a file than can then be executed in the CPU.
Interpreter
Rather than translating a high-level language into machine code, an
interpreter directly executes a program in the CPU, line-by-line