I finally had a few hours to work on hcOPF support for FreePascal which I had started some time ago. I downloaded the Lazarus 1.0.10 installer and ran it in my development VM. Then I continued creating new FPC projects, attempting to mirror the Delphi ones. What I found, is that as a Delphi developer, the combination of Lazarus with FreePascal is far from a seamless transition if you are trying to migrate a framework. There are numerous unit differences and the FreePascal compiler has significant differences from Delphi’s compiler even in Delphi compatibility mode. The way Lazarus handles package projects is different, as are all GUI dialogs for the compiler paths and conditional defines, and even the IDE windowing. It all takes a little getting used to.
The compile cycle seems to be longer using Lazarus, and the debugging tools are IMHO much more primitive than Delphi. For instance, you cannot evaluate expressions such as Person.AttributeByName(’FirstName’).Value like you can in Delphi. The debugger visualizers are also quite a bit different from Delphi. Due to an incomplete port, the IDE crashed while tracing the code with a 219, resulting in an empty LPI file for subsequent runs. On the plus side, it loads SO much faster than XE4, being almost instantaneous, that such crashes aren’t a real impediment and I’m sure are an unusual situation.
Of course I miss having GExperts and cnPack functionality. It’s unfortunate that no other IDE exposes the same OpenTools API interfaces used by such projects, so a developer could take them along. I also really liked the CompBar substitute for the D7 component palette, and if I could install CodeRush for D7 in Lazarus I would be sold .
There are a lot of little differences, but a lot of the time, it’s simply an issue of getting familiar with the IDE. For instance, it took me a while even to figure out that Delphi’s Browse Back/Forward is called “Jump Forward/Back” in Lazarus and was mapped to different keys. I remapped them (try that in Delphi) to use Alt+Left Arrow/Rt. Arrow and I was happily drilling through the code again.
The demo I am working on porting uses a Firebird database with the IBX connectivity layer. After looking at all the Lazarus database examples I had decided that it was going to be a longer porting effort until I ran across the IBX port from MWA Software. I downloaded and installed it, and suddenly I could use my datamodule from Delphi without a problem. I thought I was home free, until I found I needed to install some design-time code into the IDE and I couldn’t resolve “Designer.GetComponent(Value)” in a TComponentProperty editor.
I will continue working on my FPC port as time permits. Lazarus is truly an impressive IDE with some nice features such as closing All Other Pages in the editor. I am sure as I spend more time, I will discover many other tools made by developers for developers (not a marketing department), and I really like the back to basics, no fat approach. It’s as close to having an open source version of D7 as we will ever get. It is also nice to be able to choose your UI Widgetset instead of being locked into a proprietary vendor solution. What is equally as impressive is how the open source community is developing viable technologies for iOS and Android in addition to the impressive OS list that the Lazarus/FPC combination could already target.
If you are interested in learning ObjectPascal, or targeting Linux or Mac OS/X with 64 bit native code, or even considering Android/iOS development, the no cost, open source, Lazarus/FPC combination is worth a look.