Computer Science : S4 : L4 : High and Low level Languages
People and computers use different languages. People write programs in order to communicate.
Low-level languages consist of machine language and assembly language which talk directly to the machine. You need to know binary and assembly language to understand instructions.
Low-level languages allow programmes to express programmes using similar commands which can be translated into machine code. Assembly languages are now reserved for specialist situations like embedded systems and device drivers. They cannot be transferred to other processors and only work for an individual processor.
The assembly code only needs an assembler to translate it.
Pro :
They are very efficient
Takes up less storage
Con :
Is difficult to write and understand
High-level languages consist of Fotran, C, Pascal, and OO visual language
Short code is the first known high level language. It uses statements in mathematical expressions instead of machine instructions. High level languages enable a programmer to focus on the problem to be solved and require no knowledge of the hardware and instruction set of the computer that will be used in the program. Many high level languages are portable and can be used on different types of computers.
The source code can either by translate using an interpreter then becomes machine conde. It can also be translated using an compiler which produces object code which then can link with a library. It can go straight to machine code or intermediate code which needs to be interpreted.
Pro :
Portable and can be used on different processors
Easier to write and Understand
Con:
Slower than low language programs
Less efficient than low language programs
Translator Types :
Interpreter - An interpreter reads and executes the code immediately line by line. This means that the source code is executed in real time, without needing another step. Interpreted languages are easier to debug as it executes in real time and you can see the result of your code. Interpreters
are used when you are writing the programmes as it runs it line by line.
Pro :
Easier to debug
More portable
Easier to use
Con :
Takes up more storage
Is slower than compiler
Compiler - A compiler translates the entire source code without executing it. The machine code is normally saved as an executable file, which can be run independently on the compiler. Compiled language tends to be quicker because it only needs to translate one. Compiler are used once you have already written the code to.
Pro :
Takes up less storage
Is quicker to use
Con :
Cannot execute in real time so cannot see code straight away
May need certain platforms to run
Entire source code has to be correct before it can execute