We are still actively working on the spam issue.

Difference between revisions of "Pascal"

From InstallGentoo Wiki
Jump to: navigation, search
m (logo)
Line 1: Line 1:
 +
[[File:Pascal.png|thumb]]
 
'''Pascal''' is a highly-structured, strongly-typed programming language.
 
'''Pascal''' is a highly-structured, strongly-typed programming language.
  

Revision as of 12:44, 9 February 2014

Pascal.png

Pascal is a highly-structured, strongly-typed programming language.

Pascal was originally designed by Dr. Niklaus Wirth, and was first published in 1970. It began as an extension to ALGOL, a programming language which Dr. Wirth had also helped to design. The language is named after the famous 17th-century French mathematician and philosopher Blaise Pascal.

In the 1970's and 80's, Pascal became very popular, particularly in the academic field. However, its popularity started to wane when many universities and businesses began using the newly created UNIX operating system, which was programmed in the C language. Many university classes and other users switched from Pascal to C to take advantage of the new system. Another major user of Pascal, Apple, would also eventually switch to C and Objective-C.

The Pascal language has been extended many times by different groups. Borland Turbo Pascal is among the better known extensions, featuring one of the fastest compilers for PCs at the time. Turbo Pascal also popularized the usage of object oriented programming in the Pascal language.

Modern implementations

Delphi

Embarcadero Delphi is a proprietary IDE which uses a dialect of Object Pascal, a much more developed object oriented dialect than that used in Borland Turbo Pascal.

Free Pascal

Free Pascal is a free and open source implementation which supports a wide variety of platforms. It features its own Object Pascal dialect similar to that of Delphi, as well as Delphi, Turbo, and Mac Pascal compatibility. The project also develops two IDEs: the text-based FreeVision IDE, and the Delphi-like Lazarus IDE.

GNU Pascal

GNU Pascal is another free and open source Pascal implementation, maintained as part of the GNU project and built upon GCC. It focuses more on supporting the ISO Pascal standards, with several features from ISO Standard and Extended Pascal which other modern Pascal dialects like Free Pascal and Delphi do not support.

The Dev-Pascal IDE supports the GNU Pascal dialect.

Installation

Free Pascal is probably the easiest to install and use, with or without the Lazarus IDE. You can find an easy installer for most platforms at the Free Pascal SourceForge page. You can also install it through your GNU/Linux or BSD package manager.

After the compiler is installed, you can type fpc myprogram.pas in your terminal to compile the source file myprogram.pas. By default, the resulting binary would be called myprogram (or myprogram.exe on Windows). Then you can run the program by typing ./myprogram (or simply myprogram.exe on Windows).

Examples

Hello World

program Hello;
begin
  Writeln('Hello World!')
end.

Further reading

Pascal Books

Wikipedia article on Pascal

ISO-7185 Standard Pascal

ISO-10206 Extended Pascal

Free Pascal Tutorial