Lazarus

I've been a user of Delphi for quite a few years now, mostly in it's C++ Builder incarnation. Because of this (my "C-weenieness") I've not done a tremendous amount of coding in Object Pascal, But I have done some, mostly at a very low level in components and libraries as the base (the Visual Component Library or VCL) of C++ Builder is all written in Delphi Pascal.

I noted with some interest last year that Codegear was working on a cross platform product, bringing Delphi to the Mac (and back to Linux). This was pretty exciting to me, because there's an increasing pressure at work to develop Mac solutions (and I'm sure they'll catch on to Ubuntu eventually). This would be an ideal solution, as it would leverage our existing codebase to new platforms.

The problem is that Codegear is taking their sweet time. And we needed a solution now - products have to ship! And I found a solution - Lazarus.

This isn't a "write once, run anywhere" environment (like Java promised to be), nor is it a cross compiler (exactly). It's a "write once, compile anywhere" RAD IDE for Object Pascal, with a component library that mimics the VCL but ties to an underlying widget set that's platform specific. Carbon (and some Cocoa) widgets are supported on the Mac, QT and GtK on Linux platforms and Win32 (or WinCE) on Windows. Processor support includes PowerPC, Intel and ARM. And it works.

I can write a program on a Windows box that compiles on my Mac - and on Windows it looks like a Windows app, and on the Mac it looks like a Mac app. There are a few platform specific ifdef's in the code, to be sure, but remarkably few. Most of the OS dependent stuff is handled transparently under the hood, including the crazy stuff like path separators for file access. It's really quite amazing.

I'm finding myself becoming quite enamored of the language itself, too. Sometimes my fingers move faster than my brain (especially on things like the equality operator - in Pascal, it's := as opposed to just =, which is the comparison operator) but overall the syntax is strikingly similar to what I've been doing with C++ Builder. This is mostly due to the nature of the underlying framework.

The developers of Lazarus have done one heck of a job with the LCL (Lazarus Component Library) and the FCL (Freepascal Component Library). These do much more than merely mimic the VCL - they extend it in very logical and useful ways. Unicode support, graphics support, even compression support are all built in. It's actually fun to write code in this thing.

And they did a smart thing with licensing, too. While the IDE and compiler are GPL, the frameworks and libraries are all LGPL. Which means no restrictions on us in commercial programs.

In short, I'm throughly impressed. If you need a cross platform dev tool, don't let the "Old School" rap of Pascal put you off. Check out Lazarus - you'll be amazed at what's possible today.

11:48 /Technology | 1 comment | permanent link