Mike MacDonagh's Blog

Somewhere in the overlap between software development, process improvement and psychology

Linux GUI Development: Lazarus 0.9.30 review and screenshots

This blog is part of a series looking at programming tools on linux and covers Lazarus 0.9.30

EDIT: Since I wrote this Lazarus v.1 has been released  so I’ve updated my review here.

 


 

I’ve always liked Wirthian languages since programming in Modula-2 and university and Delphi late because they’re very readable and promote good programming practices in the structure of the language. Also, I like Wirth’s law “Software is getting slower more rapidly than hardware becomes faster.” from A Plea for Lean Software even if it wasn’t actually him that came up with it.

When I made the jump from Windows to Linux I was on the search for a nice high level language to do GUI development stuff in. In searching I came across Lazarus. Lazarus is a free cross-platform IDE which provides the Delphi experience for Linux (and Windows). Rather than Java’s “write once run anywhere” Lazarus aim’s for “write once compile anywhere” courtesy of the Fee Pascal Compiler (FPC). On top of the compiler Lazarus comes with the LCL (Lazarus Component Library) which gives a single interface for GUI programming despite underlying differences in implementation.

Lazarus is at 0.9.30 so it’s not a v1 product yet… However I’m not going to give much benefit for that since it’s been around for both windows and linux since 2008 and is available from the Ubuntu Software Centre.

Installation

Oh dear… the most important part of a software package, since if it fails your software doesn’t get used and for Lazarus it just sucks! When I first tried to install Lazarus it took me over 20 times to get it actually working. A comment from the Lazarus forum replied: “…20 times isn’t that much…” as if this is acceptable. Ok, so it’s free and open source but if it’s not accessible people won’t use it. It’s so hard to get running I’ve posted twice on the topic (and had a significant amount of hits from people with the same problems).

Worse, upgrades to Ubuntu have totally broken the installation and it’s not properly compatible with the new Ubuntu overlay scrollbars leading to focus problems with windows, text boxes and menus.

Basically, unless you really care it not going to be easy to get going. 1/10

First Impressions

Once I finally got it running my immediate reaction was summed up by the word “w00t“. Despite the always ugly multi-window layout here was an environment and language I knew like the back of my hand (so long as I rewind my memory 15 years) and could quickly put together good looking cross-platform apps in minutes 🙂

Normal multi-window interface for Lazarus

Lazarus as a single window IDE

It is possible (by recomiling the IDE) to get a single window mode which is a bit more modern. I was little disappointed to see that it didn’t have multi-project support but at least it’s solid and works if a little old-fashioned feeling. 6/10

WARNING: Due to problems with focus, the current version is close to unusable in Ubuntu 11.10.

GUI Designer

The GUI designer is solid and works well. Guidelines, alignment indicators and a pretty good set of visual components make putting together a simple form trivial. There’s no layout controls as you get in many newer GUI IDEs (flex boxes, tables, fixes vs.s flow etc.) but the use of anchors and panels means this isn’t a problem. The GUI designer feels a lot like the Delphi designer 9/10

Code Editor

The code editor features all of the old colour schemes and look and feel of Delphi with all of the modern stuff you’d expect like code folding, code completion etc.  The link between code and visual elements is easy to manage, especially with the excellent Actions feature. The Lazarus code editor is actually an improvement over the old Delphi editor 9/10

Language Features

Global variables are still there, I understand taking them out would cause problems for supporting old code bases but it’s still a shame.

The language is a good simple OO implementation but it misses out on some modern features like extension methods, anon methods, iterators, code attributes/decoration, multi-cast events…

Generics have been added but they feel a bit like a bolt on in this version, especially as when compared to their simplicity in languages like c#. Here’s the same example I used in the c# mono review in Lazarus.

generic TGList<T>; = class
  Items: array of T;
  procedure Add(Value: T);
end;

TBlobList = specialize TGList<Pointer>;

....

sb := TStringList.Create();
for n :=0 to Length(blobs.Items)-1 do
begin
  sb.Append(blobs.Items[n].name);
end;
Memo1.Text:= sb.Text;

I’ve created my own base generic collection here and then specialised it for a custom type. All seems to work pretty well.

Finally.. there’s no (limited) garbage collection. Although visual elements are dealt with when you close a form (it’s normally too late by then if there’s a problem) there’s no garbage collection which means in that code above I need to change the TStringList.Create to:

sb := TStringList.Create();
try
   ...
finally
sb.Free;
end;

All in all, although it used to be a neat elegant language, and it still is Object Pascal just feels a bit old fashioned and clunky now. Sadly I’m going to have to give this 6/10

Feedback Process

The main feedback mechanism is the Lazarus site with wiki and forum. The forum’s fairly active but there seems to be an acceptance of problems such as the installation issues which is worrying.  7/10

Conclusions

Although the current version doesn’t really work with Ubuntu 11.10 the previous (and I hope future) configurations provide a pretty easy to use solid GUI design and code experience if a little old fashioned.

The community is reasonably active but a lot of the Lazarus usage seems non-English meaning the resources are sometimes a little hard to understand for me and since Pascal is  a bit of a niche language these days there’s not much non-Lazarus resources that can apply (except for old Delphi resources).

Although I’m predisposed to be positive about Lazarus to be honest I can’t really recommend it unless:

  • You’re an old Delphi developer looking for some nostaligia
  • Someone who hasn’t accepted Delphi is dead (even the website set up to refute this http://www.isdelphidead.com/ is dead!)
  • You need to quickly produce something very simple for multiple platforms and don’t know any other languages
Category Score
Installation 1/10
First Impressions 6/10
GUI Designer 9/10
Code Editor 9/10
Language Features 6/10
Feedback process 7/10
Overall 63% – Sadly not good enough
Advertisements

17 responses to “Linux GUI Development: Lazarus 0.9.30 review and screenshots

  1. Pingback: Moving from windows to Ubuntu, music, media centers, office and more « The Mac Daddy

  2. Felipe November 18, 2011 at 2:53 am

    One advantage that you must remember: Lazarus is one of rarely cross-plataform ide´s that compile native applications in Windows / Linux. For example, you must develop an application that will run directly from CD in a remote computer with no internet access and, maybe, no java and/or .net installed.

  3. Chris December 4, 2011 at 4:20 pm

    Good overview. Presumably the generics issues you found were because you instantiated the parameterised type with Pointer rather than TTestBlob – you seem to have just recreated the old TList class, rather than a list of TTestBlob specifically.

    That said, the FPC team are currently implementing (or trying to implement) the Delphi generics syntax, which behaves (if not completely looks like) the C# 2.0 one – there’s no ‘specialisation’ in the FPC sense, and a constraints system is used (FPC acquired its own ‘generics’ before Delphi did, which is why there’s the discrepancy in implementation). Delphi also has C#-style attributes and anonymous methods FWIW, though the FPC developers don’t seem to be interested in copying them.

    As an aside, someone who hasn’t accepted Delphi is dead would probably just stick with Delphi – Lazarus fans (if not the people who develop FPC and Lazarus itself) can be embarrassingly whiny about Delphi in the same way Delphi fans can be embarrassingly whiny about .NET…

  4. mikemacd December 5, 2011 at 3:04 pm

    You’re quite right, thanks for spotting that. The correct way to declare my generic list is

    TBlobList = specialize TGList;

    and then I can use it without typecasting like this:

    sb.Append(blobs.Items[n].name);

    Cheers 🙂

  5. John December 27, 2011 at 8:02 pm

    > Finally.. there’s no (limited) garbage collection.

    This is a *good* thing. Because there is no garbage collection, there is no *overhead* associated with garbage collection. It’s simple…you create an object, then you have to free it.

    • mikemacd December 29, 2011 at 6:14 pm

      Sure, it’s simple enough as I showed by writing out the code above. Simple, but inconvenient, and it makes for big ugly code. If you’re writing for efficiency, to the extent that GC overhead could be important, you’re probably going to choose c/c++ anyway.

  6. Cesar January 7, 2012 at 3:23 pm

    I guess Lazarus is a bit out of it`s time. Should it become availabe earlier then a lot of people that used to program with Delphi wouldn’t leave for Java nor .Net…
    Anyway, as an old fashioned Delphi 5 programmer, I was pretty satisfied with the produced result.
    By the way, did any of you used RealStudio?
    Cesar

  7. Markus January 8, 2012 at 10:58 am

    Could you please explain how you come to a 38% rating?
    If I weigh all your categories equally and sum those up I get 3,8. If I now divide it by 5 (number of categories) and multiply it by 100 to get % I get 63%

    That’s a huge difference so would you care to explain it?

  8. mikemacd January 8, 2012 at 2:45 pm

    Hi Markus, thanks for pointing that out it was a mistake. I posted these entries from a little bit of software which had a bug in it. It’s still my fault though because I wrote the software! I’ve corrected the number above.

  9. Arny February 12, 2012 at 12:57 am

    One more thing about GC… it’s actually a feature of the backend – Java or .NET’s VM, not of the language itself. All the languages which compile to those VM’s can have GC (including a Pascal derivative, Oxygene), yet languages compiled to native code normally don’t have that feature. It could be done for Object Pascal too, but there actually isn’t much interest for it because the language itself is not prone to some common mistakes (like dangling pointers) and the compiler detects many of them. The others can be easily solved by using some good practices (like the example you gave above), and I do believe that programmers should not learn to be careless.

    I personally wouldn’t trade the GC for the ability to compile to independent native code (e.g. by switching to .NET)…

    • mikemacd February 12, 2012 at 10:38 pm

      Arny, GC doesn’t have to be part of a VM, just a runtime. Lazarus (and Delphi) have a runtime it’s just embedded in the exe’s it produces rather than a separate set of files. This is why Delphi/Lazarus compiled programs have sometimes faced criticism for being a bit bigger than other languages. GC and native code compilation are not mutually exclusive, and indeed I wouldn’t make that trade either, I want both.
      Here’s some blurb I found about it before: http://wiki.freepascal.org/garbage_collection

  10. Juan March 25, 2012 at 9:07 pm

    Maybe it’s a bit late for this comment, but after trying to install some components of lazarus, like lazreport and didn’t have any success, I gave up with lazarus. A few days ago I heard about codetyphon, which is lazarus itself but, with steroids. I mean, it comes in a huge package +400 mb but, with this package you can install lazarus under any windows, linux or freebsd, and a lot of components and all the required libraries are included. Now it’s working like a charm in my Ubuntu 11.10 machine and with all the components ( I know that I won’t use many of them ) but is a complete RAD and without headaches for installation!!!

    • mikemacd March 26, 2012 at 9:56 pm

      Never too late. I’ll check it out, thanks for the recommendation 🙂

    • mikemacd April 18, 2012 at 10:21 pm

      I’ve tried codetyphon now, it installs well (which is a great improvement) but the version of Lazarus it uses is flaky and the docking doesn’t work well. I wouldn’t use codetyphon over Lazarus at the moment and it’s important to point out that it’s really just Lazarus plus some extra packages. The install experience is significantly better though.

  11. Ken Kinder February 5, 2013 at 4:16 pm

    Nice. Thanks for your review, Mike! Something I’ve been looking around for is an O’Reilly book (or similar) on Lazarus. Any recommendations? I’m a Python programmer with some C++ and a little Java experience, and I think I should learn Lazarus on the weekends.

What do you think?

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: