Low-level languages are machine code and assembly code
Machine code is the actual binary computers interpret to carry out tasks. Very difficult to write in and mistakes are easy to make
Assembly code maps easy-to-read phrases and instructions 1 to 1 with machine code, making coding more accessible
High-level languages can map one line of code to many machine code instructions, making coding faster and easier
An imperative language executes one line at a time - often called procedural languages. They tell a computer how to do something.
Imperative languages are different from declarative languages, which tell the computer what to do, but not how
Machine-code is the least abstract. The programmer inputs 1s and 0s which directly translate into electrical signals.
Assembly languages use short words called mnemonics that map to a sequence of binary in lookup tables. It has a one-to-one relationship with machine code. They are machine-specific, and are translated using an assembler
Assembly language is very difficult to port due to it being machine specific. It is also difficult to find programmers proficient in writing it, so maintaining code is difficult. Even those who are proficient it can be time-consuming to write and bug prone
However assembly language is as efficient as machine code. You have direct access to system-level features and can create very optimised code. This makes it much faster when executing and the programmer has complete control
A translator converts code written by a programmer into machine code
An assembler converts assembly language code into machine code. Because this is a one-to-one conversion, it is very fast. They are machine-specific, because so are assembly languages and machine code.
An interpreter translates source code one line at a time, so that it is executed one line at a time. It does not check for errors before starting, so source code can be partially translated until an error is found - good for debugging!
For a program to be interpreted both the source code and the interpreter must be present. This provides poor protection of the source code. Interpreted code also runs slower than compiled code
A compiler checks the source code for errors and then compiles it all at once. Compiled code can be run without any other software.
Source code is code written by a programmer. Object code is the output of translators. It is readable by the computer and as such is machine-specific
Some compilers translate source code into intermediate code, like bytecode. This allows for platform independence, because the same intermediate code can be distributed and then run on a platform-specific virtual machine.
Interpreters are better suited to program development, while compilers are best for finished programs that might be distributed or sold.