Functional languages are considered, by their devotees, to be higher level than third generation languages. Functional languages are regarded as declarative rather than imperative. Ordinary third generation languages such as Pascal, C (including flavours such as C++) and assembly instruct the computer on how to solve a problem. A declarative language is one which the programmer declares what the problem is; the execution of the program is a low level concern. This is an attitude shared with the logic language community (Prolog people).
Functional languages are particularly well suited to parallel processing - several research projects have demonstrated superior performance on parallel machines.
Imperative Programming & Traditional Software Engineering | Functional Programming & Formal Methods | |
---|---|---|
The Development Cycle | Using informal language a specification may be open to interpretation.
Using appropriate testing strategies we can improve confidence - but not in any
measurable way. Mistakes/bugs are common and difficult to spot and correct. |
Using logic we can state the specification exactly.
Using mathematics we may be able to prove useful properties of our programs. Mistakes/bugs are common and difficult to spot and correct. |
The Development Language | Using structured programming or object oriented techniques we can reuse code. Using structured programming or object orientation we can partition the problem into more manageable chunks. | Using structured programming or object oriented techniques we can reuse code. We can partition the problem into easy to use chunks - plus there are often "higher-level" abstractions which can be made ML which would be difficult or impossible in a traditional language. |
The Run-time System | The compiler can produce fast compact code taking a fixed amount of
memory. Parallel processing is not possible (in general). Fancy GUI's may be added. |
Code is usually interpreted, the memory requirements are large and unpredicatable. Parallel processing is possible. Fancy GUI's may be added, with difficulty. |