Thursday, March 17, 2011

Introduction and Installation

This 'blog site provides a journal on using Free Pascal and Lazarus, the Delphi-compatible object development suite on a Linux system. It is designed to provide a practical introduction to structured and object-orientated programming with a language that is easy to learn, is free and open-source, and is in widespread use and development.

Pascal has been known since the 1970s as a language particularly good for educational purposes. It teaches people good programming practises which they should continue to use if they need to use other languages. A brief essay by Niklaus Wirth, the inventor of Pascal, explains its history.

In terms of other metrics, Pascal is readable and maintainable, but very powerful. Compared with other languages, Pascal has the advantages of quick compilation, fast executables, and low memory consumption. Free Pascal has excellent assembler integration for those who are super-programmers and highly portable, following the principles of "write once, compile anywhere (WOCA)".

There is no other language that can claim all these features. It is surprising, in my opinion, that Pascal is not the language of choice for most programmers.

This journal will begin with installation on Intel/i386 or AMD64/x86_64 CPUs. The most simple method of installation is package based, either through RedHat packages (rpms) or Debian packages (debs). Or one can install from source. The commands for the latter version are as follows:


root@squirrel:~# mkdir -p /usr/local/src/freepascal
root@squirrel:~# cd /usr/local/src/freepascal
root@squirrel:/usr/local/src/freepascal# wget ftp://ftp.freepascal.org/pub/fpc/dist/2.4.2/i386-linux/fpc-2.4.2.i386-linux.tar
root@squirrel:/usr/local/src/freepascal# tar xvf fpc-2.4.2.i386-linux.tar
root@squirrel:/usr/local/src/freepascal# ./install.sh


The shell script will provide all the options. The only variation from the default that I recommend is the installation path, which I used /usr/local/freepascal/2.4.2. To test to ensure installation simply type fp from the console. A text-based integrated development environment (IDE) should execute. Congratulations, you're on you're way towards programming in Pascal!

No comments: