4.3.4 Explain the need for higher level languages.
4.3.5 Outline the need for a translation process from a higher level language to machine executable code.
It is programmer friendly language.
High level language is less memory efficient.
It is easy to understand.
It is simple to debug.
It is simple to maintain.
It is portable.
It can run on any platform.
It needs compiler or interpreter for translation.
It is a machine friendly language.
Low level language is high memory efficient.
It is tough to understand.
It is complex to debug comparatively.
It is complex to maintain comparatively.
It is non-portable.
It is machine-dependent.
It needs assembler for translation.
A programming language is a set of rules that provides a way of telling a computer what operations to perform.
A programming language is a set of rules for communicating an algorithm
It provides a linguistic framework for describing computations
A programming language is a notational system for describing computation in a machine-readable and human-readable form.
A programming language is a tool for developing executable models for a class of problem domains. [taken directly from this reference]
Simplicity: Simple and easy to learn and use. It provides a clear, simple and unified set of concepts, which can be easily grasped. The simplicity of a programming language affects the readability of the programs written in that language. Programs which are easier to read and understand, are easier to maintain. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple to use. However, the power needed for the language should not be sacrificed for simplicity.
Naturalness: A good language should be natural for the application area, for which it has been designed. That is, it should provide appropriate operators, data structures, control structures, and a natural syntax to facilitate the users to code their problem easily and efficiently.
Abstraction: Abstraction means the ability to define and then use complicated structures or operations in ways that allow many of the details to be ignored. The degree of abstraction allowed by a programming language directly effects its writability. Object oriented language support high degree of abstraction. Hence, writing programs in object oriented language is much easier. Object oriented language also support re usability of program segments due to this features.
Efficiency: Programs written in a good programming language are efficiently translated into machine code, are efficiently executed, and acquire as little space in the memory as possible. That is a good programming language is supported with a good language translator which gives due consideration to space and time efficiency.
Structured: Structured means that the language should have necessary features to allow its users to write their programs based on the concepts of structured programming. This property of a moreover, it forces a programmer to look at a problem in a logical way, so that fewer errors are created while writing a program for the problem.
Compactness: In a good programming language, programmers should be able to express intended operations concisely. A verbose language is generally not liked by programmers, because they need to write too much.
Locality: A good programming language should be such that while writing a programmer concentrate almost solely on the part of the program around the statement currently being worked with. [taken directly from this reference]
Fixed vocabulary (handles character encoding such as ASCII and/or UNICODE);
Unambiguous meaning;
Consistent grammar;
Consistent syntax;
Provide a way to define basic data types and operations on those types (ability to write functions/procedures);
Provide ability of Input and output handling;
Provide some kind of loop that can be stopped / conditional statement / branching (conditional and unconditional branching);
It should have variables that reference computer memory, syntax for basic arithmetic and logical operations on those memory locations;
It has to run on/be able to be processed by a computer (ie it must have a compiler/interpreter)
COBOL Business applications
FORTRAN Engg & Scientific Applications
PASCAL General use and as a teaching tool
C & C++ General Purpose - currently most popular.
PROLOG Artificial Intelligence
JAVA General all purpose programming
.NET General or web applications.
The high-level languages are much closer to human language. A programming language such as C, FORTRAN or Pascal that enables to write programs which is understandable to programmer (Human) and can perform any sort of task, such languages are considered high-level because they are closer to human languages. High level language must use interpreter, compiler or translator to convert human understandable program to computer readable code (machine code).
Easier to read, write and maintain.
High-level languages make complex programming simpler.
High level programming techniques are applicable everywhere even where computational resources are limited.
Error ratio is less in high level language
debugging (locate and correct errors in program code ) is easier.
Length of the program is also small compared with low level.
Many real time problems can be easily solved with high level language.
A computer low level language that deals with hardware registers by name known as assembly language . Assembly language is the best example of low level language, this is in between machine language and high-level language. A low-level language does not need a compiler or interpreter to run the program, the processor run low-level code directly.
Assembly Language. Assembly languages have the same structure and set of commands as machine languages, but they enable a programmer to use names instead of numbers. In the early days of programming all programs were written in assembly language but now almost programs are written in a high-level language. Programmers still use assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language. Assembly Language It uses mnemonic codes (short forms) for instructions and allows the programmer to introduce names for blocks of memory that hold data. Assembly language is designed to be easily translated into machine language.
Machine code or machine language is a system of instructions and data executed directly by a computer's CPU,
The lowest-level programming language that can only be understood by computers.
Computer language that is directly executable by a computer without the need for translation by a compiler or an assembler.
The native language of the computer,
The set of symbolic instructions in binary that is used to represent operations and data in a machine called machine code
Machine Language: “0110101100101000” machine language is a collection of binary digits or bits that the computer reads and interprets.
Machine language is the only language a computer understands, It is almost impossible for humans to use because they consist entirely of numbers.
Most programmers do not write directly in binary. They use programming languages such as Java, C++, Ruby, Python, etc.
High-level languages need to be translated into binary code before the CPU can execute them.
Their main benefit is that they incorporate everyday languages rather than sequences of binary numbers, thus people find them easier to understand.
Are encoded in a language that humans can understand more easily.
Includes both high-level and low-level languages.
More closely reflect the mechanical workings of the CPU.
One command is translated into a single instruction of machine language.
E.g. assembly language.
Are written using only the binary codes of the processor’s instruction set.
The code is dependent on a specific processor and cannot be run on a different architecture.
All human-readable programming languages must be translated into machine-readable instructions.
A piece of translator software, which is included within the programming software, converts high-level languages into machine code.
These translators are known as compilers and interpreters.
Translates a human-readable program directly into an executable, machine-readable form before the program can run.
Converts the entire program before execution.
Once the program has been compiled, it can be executed as many times as it’s required without having to be compiled again.
E.g. Java, C++, Objective C, Visual Basic, etc.
Pre-processing;
Lexical analysis;
Parsing;
Semantic analysis;
Syntax analysis;
Linking;
Optimisation;
Also translates a human-readable program into an executable, machine-readable form.
Executes the program instruction by instruction.
A program is translated every time it is run.
E.g. Python, JavaScript, etc.
Easy to learn/use;
Otherwise time may be wasted learning the new language/writing programs in this HLL;
There will be no/less compilation errors;
There will be no/less logical errors; (Reduction of time to create software;)
Future maintenance/development is possible by other programmers;
GUI;
Toolbars;
Menus;
Built in commands for inputting from touch screens;
Predicted text so that typing a class name followed by a full stop will bring up a list of methods/attributes;
Automatically use a colour to represent keywords/variables and improve readability
Must be translated from a higher level language understandable by humans/not understood by machines;
Must be translated into machine code;
For the CPU to execute the code;
Interpreter is faster/immediately warns about syntax errors/executes commands and they could use it instead of the compiler while coding and debugging their programs;
Compiler is required when there is a need to produce an executable version of a program;