blog

XUL + Pascal    Jan 06, 2007 11:28

As part of my cross platform GUI survey, I decided to look at the Mozilla framework. I still believe that the Groovy/Swing combo is going to be the most productive, but I wanted to share some of my thoughts about the Mozilla platform and relate them to CodeGear, Delphi and in particular Free Pascal.

Let me quickly digress and explain some of the parts of the Mozilla framework to the degree that my shallow understanding is able to do so.

XUL is cool - XUL is the granddaddy of the whole using "XML to declare a GUI" movement embraced by emerging technology like XAML and XForms. It has various xml tags that when rendered draw labels, buttons, panels, text boxes, tabs, etc. At this point in time, I suspect that XUL is the most successful, mature and widely deployed technology of this kind. It's skinnable and supports l10n/il8n.

XBL is a binding language that can decorate/modify the various widgets declared in XUL with content, behavior, fields, properties, methods, event handlers. JavaScript is the language used within XBL and script code is placed within various XML tags to implement various methods and handlers.

XPCOM is very much like MS' COM. The main difference is that "XP" stands for "cross(X) Platform". XPCOM's "InsSupports" interface is exactly like IUnknown: QueryInterface, AddRef, Release. XPCOM has XPIDL, typelibs and a notion of registration. Mozilla ships with a lot of functionality wrapped up in XPCOM objects including Gecko (HTML renderer), SpiderMonkey (JavaScript engine), and Necko (Network/Internet library).

XULRunner is the Mozilla platform runtime that wraps up Gecko, Necko, XUL, XBL and XPCOM objects into a distributable package. For version 1.8.0.4, there are three pre-built releases: Windows, Linux and Mac OSX.

The Mozilla platform is a framework just like Java and .NET. It provides a bunch of stuff to build all sorts of applications. It's language neutral, although IMO, it would work best with C++. CodeGear has a good opportunity to revive the CBuilderX product and use XUL instead of wxWidgets.

Interestingly enough, there is a good deal of work done by a company named Kama Software to bring XUL to Delphi. It's been almost a year since Kama Software has done anything with their DINO framework and a lot has changed on the Mozilla side. I've been watching it for a while now and finally looked at all the bits in their demo download while going through this learning process about the Mozilla Framework.

I was surprised at how much code they included in the demo download and by reading some of the code, I have a better idea of how their DINO adaptation works. I do have some implementation concerns and some ideas about how to do things a bit differently to make things more Delphi-like, but I admit to be just learning about the technology so it's best to be quiet. :) The bottom line here is that Kama Software's DINO framework proves that integration of XUL and Pascal is possible.

Considering how Delphi's cross platform priorities have changed (read: nullified), my belief is that it would be better suited for FreePascal. ISTM, the Lazarus IDE project, while it is making progress, is holding FPC back from bigger and better things.

Building an IDE is a tough job. I think the FPC guys should consider taking a page out of JBuilder's playbook and adopt Eclipse as their IDE core. Don't spend time reinventing the wheel, use something that works.

I also believe that the whole "choose your favorite GUI toolkit" strategy is too onerous. What I want is one consistent cross platform GUI; no futzing between VCL and CLX, or deciding if QT or GTK is better, etc. Just give me one that looks good and works well. I don't think I'm alone.

IMO, HTML/JS, XForms, Swing and XUL/XBL fit the bill; Flash and WPF/e might as well. Pick one and build the best support you can for it. My choice is XUL/XBL. And if XUL is chosen, another benefit in building off of Eclipse is the possibility of leveraging existing work like a XUL designer. FWIW, that particular XUL designer isn't a full blown visual WYSIWYG designer, but it's certainly a start towards IDE integration and could serve as a base for future development.

If I were a bit smarter, more in love with pascal and weren't too lazy/overcommitted, I might get involved in a project to bring Free Pascal to Eclipse and leverage XUL in the process. But right now, I think my choice for cross platform GUI development is Groovy and Swing development using NetBeans 5.5 for an IDE.

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code:
 
Johann
Posts: 4
Comment
WAML
Reply #1 on : Sat November 15, 2008, 02:42:11
Our company is using WAML (Web Application Markup Language) to make our UIs. It is simpler than XAML and much more powerfull than XUL. It is also same as HTML and JavaScript. There is a *very* nice free WAML viewer created by a company "Alfega".