Pascal, for a rigorous programming
From Blaise Pascal to Niklaus Wirth
Pascal was designed in 1970, before C and after Basic, by Niklaus Wirth and impose programmers a structured programming style.
To avoid the difficulties that had its predecessor, Algol to be implemented, Wirth choose to compile the Pascal code in intermediate code, easy to port on all systems. It was even ported on Apple][.
Pascal was the language of the MacIntosh, before being replaced by Objective C, the language of Next, that Steve Jobs brought with him when he returned to Apple in 1997.
The principle of the intermediate code or bytecode, for portability, was later picked up by Java, C# and by LLVM. But the bytecode is now compiled just in time and no longer interpreted.
Pascal had successors, Modula and Oberon, which add modules
and access to system resources.
But these features has been added to Pascal itself by the implementation of Borland.
The modernized version of Pascal, Delphi is a specialized client-server programming tool and its IDEs allows to build easily applications.
However, Pascal is less and less used, particularly because Java or C# allow to program more easily the same tasks.
We can consider that the current successor of Pascal is Scala, not for the syntax that is similar to that of Java, but for its academic spirit and willingness to influence how must be written programs.
Pascal was widely used - and is still - in education for learning to program rigorously, because actually it was especially designed to avoid spaghetti code like in Basic:
- Strictly structured programming.
- The code is divided into procedures and functions, the latters returning values, not the formers.
- imports allows including functions from external modules, with no headers required as in C.
Objects were added further.
An example of code that displays the letters of a string shows the cumbersome syntax:
cont str = 'demo'; var i:int; len:int; begin len:= length(str); for i:=0 to len do begin write(str[i]); end; end;
You may program in Pascal with Free Pascal,
an object oriented port, near Turbo Pascal 7 from Borland.
It can produce binary code or byte code for the Java virtual machine (JVM), is free and open source.
The Lazarus development environment is multi-platform and continuously updated.