Lazarus and Free Pascal

lazarys
Lazarus on KDE Neon

Recently I installed the latest stable version of Free Pascal and Lazarus on KDE Neon and I must say I was pleasantly suprised! The IDE is very capable and polished, complete with syntax highlighting, refactoring, Delphi like form design, components and packages. Free Pascal is the first class Pascal compiler, compatible with Delphi, used by Lazarus. The community has done an excellent job with these awesome tools, rock solid and very impressive.

What is Lazarus?

Lazarus is a Delphi compatible cross-platform IDE for Rapid Application Development. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces.

What can it do?

You can create your own open source or commercial applications. With Lazarus you can create file browsers, image viewers, database applications, graphics editing software, games, 3D software, medical analysis software or any other type of software.

What is Free Pascal?

Free Pascal is a 32, 64 and 16 bit professional Pascal compiler. It can target many processor architectures: Intel x86 (including 8086), AMD64/x86-64, PowerPC, PowerPC64, SPARC, ARM, AArch64, MIPS and the JVM. Supported operating systems include Linux, FreeBSD, Haiku, Mac OS X/iOS/iPhoneSimulator/Darwin, DOS (16 and 32 bit), Win32, Win64, WinCE, OS/2, MorphOS, Nintendo GBA, Nintendo DS, Nintendo Wii, Android, AIX and AROS. Additionally, support for the Motorola 68k architecture is available in the development versions.

Seriously, you can build pretty much anything with Free Pascal and Lazarus, including:

As Jon Aasenden writes on his blog, Pascal and Object Pascal are archetypal languages like C and C++, they are designed around how the computer actually works.

Mifare card encoding done on an older version of Lazarus (Linux):

Third-Party components

In addition to nearly 200 built-in components, there are a number of components available for purchase from third partys, for example TMS FNC UI Pack and Devart Data Access Components.

Write once compile everywhere

Lazarus runs on a number of operating systems. Write your code on your favourite operating system, then compile it on any operating system you want to deploy to. There is no need for cross-compiling. For example, you develop on Linux, then compile on the Raspberry Pi. The code compiles to a single executable file which makes distribution very simple.

How to install Lazarus?

Lazarus has pre-built installers for Windows and Mac, and most Linux distributions can install it from their respective software repositories. However, on Linux the repositories often contain older versions. Rather than manually building the source code, I chose to use an awesome tool call FPCUPDeluxe. Installation couldn’t have been easier. Not only did it take care of downloading and building the latest version of the software, it also simplified the installation of comon IDE extension modules, such as anchordocking. I followed this guide here, installation was flawless.

FPCUPDeluxe
FPCUPDeluxe Installation Tool

Delphi or Lazarus?

This really depends upon you, both are very capable tools. Some people prefer the open source philosophy of Lazarus, or even Lazarus itself. Previously the cost of Delphi was prohibitive for hobbists and indy developers, but now with the free Community Edition available anyone can use Delphi. Personally I prefer Delphi, I especially like FMX. However, if I’m targeting Linux alone, I’ll usually reach for Lazarus. Lazarus is a very capable cross-platform development environment.

Where to learn more?

The best place to begin would be to visit the Lazarus and Free Pascal websites. Follow this link to the Lazarus Documentation page.

Youtube has a number of Pascal and Lazarus videos available, see here.

Finally, there are a number of Pascal books available via stores like Amazon, here are a couple of Lazarus related books which can help you get going:

Getting Started with Lazarus and Free Pascal: A beginners and intermediate guide to Free Pascal using Lazarus IDE, see here.

Getting Started with Lazarus IDE, see here.

And for fun, Writing an Interpreter in Object Pascal: Part 1: Lexical and Basic Syntax Analysis, see here.

41k5sutyq4l._sx331_bo1204203200_   51tcsjb6n6l._sx404_bo1204203200_   41nbbh7rmel._sx348_bo1204203200_

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s