Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Chapter 1 The Architecture of Lazarus

By Mattias Grtner

Lazarus is an integrated development environment (IDE) for the Object Pascal language. The Free Pascal Compiler provides the backend for Lazarus. This combination of backend engine and integrated development environment is comparable to Visual Studio for C++ or Borland Delphi. It yields efficient, highly optimized native source code. Whereas Java and C# development environments produce bytecode that must be interpreted in a runtime environment or converted into poorly optimized code by a JIT compiler. Among the strong points of the Lazarus IDE are its RAD capabilities, which greatly simplify and accelerate the development of graphic programs. They are largely similar to Delphi's capabilities. However Delphi is based on the Delphi compiler, while Lazarus is based on the Free Pascal Compiler (FPC), which is broadly compatible with Delphi 2007. In addition, Lazarus runs not only under Windows, but also in native mode on Linux, MacOS X, BSD and other platforms. The Free Pascal Compiler is itself written in Pascal, just as Lazarus is written entirely in Lazarus. FPC also includes language extensions from other Pascal dialects, which makes it easy to port existing source code. In line with its strong focus on platform independence, FPC detects code that may not be portable and generates a warning. Lazarus's graphic component library is called the Lazarus Component Library (LCL). Many of its units, classes and identifiers have the same names and work the same way as in Delphi, so Delphi code can be ported directly to Lazarus. However, Lazarus is not a Delphi clone, but instead an extension of the Delphi concept that supports platform independence using native applications, with no need for emulators. The price that must be paid for this is that full compatibility with Delphi's component library (the VCL) is not possible. The LCL has native components. On all platforms LCL-based applications look the same as other native applications, and they are used the same way. The LCL achieves this by using native widget-sets, such as WinAPI for Windows, Gtk 2 for Linux/BSD, and Carbon/Cocoa for MacOS X.
Lazarus - the complete guide

Chapter 1 The Architecture of Lazarus .

The main differences from Delphi are that Lazarus is fully open source, that it currently runs on more than fifteen platforms, that it is free even for commercial users, and that it is based on a flexible licensing scheme. Thanks to the efforts of the open source community, many Delphi libraries have been ported to Lazarus and extended to other platforms. Also new libraries that are only available under Lazarus have been written. Numerous forums, mailing lists and websites offer fast, straightforward help.

Figure 1.1: A familiar environment for Delphi users: Form Editor, Object Inspector and Code Explorer The Free Pascal Compiler and its accompanying libraries form a sound foundation for Lazarus. Although they are closely related, FPC and Lazarus are different projects. The first version of Free Pascal appeared in 1993, while work on Lazarus began in 1999. Free Pascal is a 32- and 64-bit compiler for Windows 32, Windows 64, WinCE, Linux, FreeBSD, MacOS X/Darwin, DOS, OS/2, Netware (libc and classic) and MorphOS, running on the Intel x86, AMD64/x86_64, PowerPC, PowerPC64, Sparc and ARM architectures. Like Delphi, the compiler is very fast, but not quite as fast as Delphi because FPC is optimized for more than one platform in the interest of extensibility. In terms of size and speed, under Windows the resulting compiled code is comparable to that produced by Delphi (sometimes FPC is better, and sometimes Delphi), and under Linux or MacOS X the code is comparable to that produced by the GNU C/C++ compiler. 2
Lazarus - the complete guide

You might also like