What are the Open Source alternatives to WPF/XAML? [closed]
Asked Answered
R

3

69

If we've learned anything from HTML/CSS it's that, declarative languages (like XML) do a good job of describing User Interfaces because:

  1. It's easy to build code preprocessors that can template the code effectively.
  2. The code is in a well defined well structured (ideally) format so it's easy to parse.
  3. The technology to effectively parse or crawl an XML based source file already exists.
  4. The UIs scripted code becomes much simpler and easier to understand.
  5. It simple enough that designers are able to design the interface themselves.
  6. Programmers suck at creating UIs so it should be made easy enough for designers.

I recently took a look at the meat of a WPF application (ie. the XAML) and it looks surprisingly familiar to the declarative language style used in HTML.

The current state of desktop UI development is largely fractionalized, otherwise there wouldn't be so much duplicated effort in the domain of graphical user interface design (IE. GTK, XUL, Qt, Winforms, WPF, etc).

There are 45 GUI platforms for Python alone

What are some Open Source GUI's that represent these characteristics:

  • standardized
  • platform independent
  • declarative markup language
  • language agnostic

WPF, or more specifically XAML seems like a pretty likely step in the right direction.

Update:

Thanks a lot for the info, keep it comin'. Here's are the options I've gathered from the comments and answers.

GladeXML

  • Editor: Glade Interface Designer
  • OS Platforms: All
  • GUI Platform: GTK+
  • Languages: C (libglade), C++, C# (Glade#), Python, Ada, Pike, Perl, PHP, Eiffel, Ruby

XRC (XML Resource)

XML based formats that are either not free, not cross-platform, or language specific

XUL

  • Editor: Any basic text editor
  • OS Platforms: Any OS running a browser that supports XUL
  • GUI Platform: Gecko Engine?
  • Languages: C++, Python, Ruby as plugin languages not base languages

Note: I'm not sure if XUL deserves mentioning in this list because it's less of a desktop GUI language and more of a make-webapps-run-on-the-desktop language. Plus, it requires a browser to run. IE, it's 'DHTML for the desktop.'

CookSwing

XAML (Moonlight)

  • Editor: MonoDevelop
  • OS Platforms: Linux and other Unix/X11 based OSes only
  • GUI Platforms: GTK+
  • Languages: .NET

Note: XAML is not a pure Open Source format because Microsoft controls its terms of use including the right to change the terms at any time. Moonlight can not legally be made to run on Windows or Mac. In addition, the only platform that is exempt from legal action is Novell. See this for a full description of what I mean. XAML is also not an ECMA standard like C#, Managed C++, and the CLR.

Update: The question has been changed from "Is there an Open source alternative to WPF? because the original question was wrong, and it sucked. The direction of this question has changed direction to match up to align with the new input. My apologies to the people who responded before it changed.

Roseboro answered 3/6, 2010 at 1:53 Comment(17)
I don't think "we've" learned any such thing, though maybe you have. After a couple decades designing and developing UIs, I think XML is just about the worst way to describe a UI. It's way too limiting and wordy.Quicken
If you want "desktop development", then use Linux. KDE (despite multiple problems, bugs, unimplemented features and linux-specific quirks) is superior to windows desktop. Simply having 4 desktops on one machine is way more efficient. And there is compiz, if you want eye-candies. As for "declarative languages"... they maybe work best when you write standard gui (you'll be stuck with predefined controls). Try to make anything unusual - and you will need real language. Oh, and for opensource alternative .. Mozilla developer XUL. Haven't used it, because of obvious GUI bugs present in firefox.Tillietillinger
@Bryan so, since you obviously have much more experience than me when it comes to UI design. What language would you code a UI in that works across all platforms (*nix, windows, OSX, etc) and all desktop languages (python, C#, C, C++ LISP, etc)?Roseboro
@Tillietillinger I do use Linux (Mint specifically). But I'm not talking about the desktop environment, I'm talking about desktop GUI application development. More specifically, cross platform/cross language UI development. Thanks, I'll checkout XUL in more deatil.Roseboro
Declarative UI has been around a long while in the open-source wxWidgets toolkit via the XRC format. It's not as powerful or as "friendly" as XAML in my opinion, but it gets the job done, and it's cross-platform/multi-language (including languages that target CLI via wx.NET).Koa
@Evan Plaice: Which toolkit? It depends on to many factors to give one answer. Normally I'd choose Tcl/Tk because of its strength in deployment and because it's generally a good toolkit with a lot of room for customization. I might pick python/wxPython for some tasks. Those are the top two candidates, but there are other choices as well, such as Groovy/SwingBuilder. Each has strengths and weaknesses.Quicken
See also: Glade glade.gnome.orgFronia
@Bryan, XML may be the worst way to do UI, it may be limiting and wordy, but it is the greatest equalizer to date when it comes to connecting disparate systems that are completely unaware of each other's API's (and possibly for market reasons, unwilling to share said information). My initial epiphany came when XML data streams helped me build a next-generation call center (telephony + legacy servers + new generation servers + desktops), and I really bought in after some hard-core InfoPath/BizTalk/SharePoint projects.Succentor
@Bryan, one more thing, I think your frustration came from not having decent automation tools. Once you abstract the XML away, I think everything will start to fall into place.Succentor
@code4life: XML is great (well, sort of) for sharing data between disparate systems, but its lousy for defining a rich UI. Maybe if you're just trying to throw up some forms on a screen it's OK, but to design truly usable user interfaces you need something more than XML.Quicken
@Bryan, have you looked at InfoPath/SharePoint/Workflows?Succentor
@code4life: infopath is for designing forms. That's not the same as designing a UI. XML is adequate for designing input forms, but that's about it. Even then, I'll argue that a skilled programmer can create a more usable form using a programming language and GUI toolkit. You can't pick a niche (creating forms) and extrapolate from that that XML is good for UI design IMO.Quicken
@Bryan, maybe I'm missing something here. I've used InfoPath for workflowing corporate loans, and I can assure you these were quite complex user interfaces with lots and lots of logic built in. It made webservice calls for populating lookups, it rendered or hid sections based on user interaction. All the codebehind for the InfoPath was done in C#, of course - I just had to sign the assemblies.Succentor
@Bryan "I'll argue that a skilled programmer can create a more usable form using a programming language and GUI toolkit." I agree but why not make it simpler and easy to the point that it doesn't require a skilled programmer to create the more mundane parts (forms, templates, etc). There's no shortage of guys walking around in sweaters and thick rimmed glasses :). Why not leave the more fun/challenging parts to the real programmers and toss the cruft to the designers? Food for thought...Roseboro
@Evan Plaice: I agree that you can use XML to define mundane portions of a UI, but that's not what this question is about. It's about designing the whole UI: "... we've learned ...declarative languages (like XML) work best to describe User Interfaces"Quicken
@Bryan Not necessarily. Even in HTML/CSS the whole UI doesn't need to be written in XML. There are instances where you might generate a 2D graph dynamically in which case you'd break out to some fancy JavaScript and/or server-side scripting and/or Flash. The XML makes up most of the UI but, for the more complicated parts the XML has an empty container element that the skilled programmer uses to do more complicated tasks. Of course, there might be inconsistencies for those parts of the code across platforms but it would be limited to a smaller set of modules not the whole UI.Roseboro
Perspex UI Framework youtube.com/watch?t=28&v=c_AB_XSILp0Transformism
B
14

Qt is developing QML, which looks a lot like XAML except in JSON. It's available as a preview built against the current version, and is available in snapshots of the next version.

Here's a little snippet from http://doc.qt.nokia.com/4.7-snapshot/declarative-ui-components-progressbar.html

import Qt 4.7
import "content"

Rectangle {
   id: main

    width: 600; height: 405
    color: "#edecec"

    Flickable {
       anchors.fill: parent
       contentHeight: column.height + 20

       Column {
           id: column
           x: 10; y: 10
           spacing: 10

           Repeater {
               model: 25

               ProgressBar {
                 property int r: Math.floor(Math.random() * 5000 + 1000)
                 width: main.width - 20

                 NumberAnimation on value { duration: r; from: 0; to: 100; loops: Animation.Infinite }
                 ColorAnimation on color { duration: r; from: "lightsteelblue"; to: "thistle"; loops: Animation.Infinite }
                 ColorAnimation on secondColor { duration: r; from: "steelblue"; to: "#CD96CD"; loops: Animation.Infinite }
               }
           }
       }
   }
}
Bedford answered 11/6, 2010 at 15:2 Comment(3)
Thanks! I figured Qt would eventually come up with something but haven't even heard of this being mentioned before. It's interesting that they chose JSON over XML. I wonder how that will pan out in the long-run.Roseboro
As someone who prefers to hand edit his XAML, I wish WPF has used JSON too. The code above is so much more readable to me.Bedford
I can't wait for a reason to try it out. I've been on the fence about GUI programming because the non-ms options are pretty diffused and obscure. As soon as I get more time I'll edit the question to provide some info/resources about QT.Roseboro
I
7
  • The Web is taking most of the steam away from desktop apps as it is.

    I think that the big reason is that everyone's so focused on the web right now. HTML5 is going to be a quantum leap forward in what the web can do. With fast JavaScript interpreters and capable browsers, the need for a desktop programs will begin to wane over time. That's the horse that Google is betting on, and to a much lesser extent, Apple as well.

  • Creating something good would have radically different implementations for each OS, so the base toolkit itself wouldn't be very portable.

    If you think about it, the Web is the only really common substrate we have upon which to develop this sort of infrastructure in a cross-platform manner. WPF is incredibly different from an architectural perspective vs. WinForms/straight WinAPI code. Adapting something like it to each OS would take a great deal of very different plumbing for each OS if you were to have a prayer of making something that performed well. (Not that web apps are very fast, mind you, but they're getting better).

  • Look and feel is always going to be somewhat of an issue.

    Whose look and feel do you use? Do you try to adapt the UI to the OS chrome so it looks "native", or do you do something like Swing did years ago and develop apps that look distinctively different from everything out there? (Ugh, that was a train wreck...) And if you choose to adapt the UI to each OS's look and feel, you may have all sorts of measurement and design issues.

Iseabal answered 3/6, 2010 at 2:20 Comment(4)
I think we're a good decade or more away from the death of non-web-based apps, if ever. There are some serious usability issues with web based apps, though hopefully that will eventually change.Quicken
are you aware of cross platform toolkits like Tk and wxWidgets? Where you do have to do a little extra work for each platform, 95% of the gui is quite portable between operating systems while still maintaining a native look. It's really not that hard; it just takes a little attention to detail.Quicken
The real meat of a browser based app is still based on javascript(only) god knows why... So sure your code that lacks operators & other basic OO programing techniques will run faster...but you still have to use a 'C' like syntax for the any real coding. Why on earth haven't browsers picked up on a better CLR, like .NET?? Or use something more to date in terms of syntax & programing power?Mew
@Mew Because IL (I think you meant Intermediate Language, CLR is MS specific) are completely unnecessary. Requiring an intermediate language will only add more complexity and inconsistency between browsers. Intermediate languages only succeed in and environment where the platform is strictly controlled. Plus, JavaScript relies on it's expressiveness and light weight syntax (vs .NET library-for-everything approach). Microsoft has done some great things with .NET but the core is becoming bloated and replicating that effort in the browser would be a bad idea.Roseboro
S
3

Novell has an open source implementation of Silverlight, with great support for XAML, called Moonlight:

http://en.wikipedia.org/wiki/Moonlight_(runtime)

http://www.mono-project.com/Moonlight

Succentor answered 3/6, 2010 at 3:46 Comment(5)
+1 He obviously couldn't have looked very much! :)Guthrie
I'm aware of moonlight. I'm also aware that, because it's derived from Silverlight it inherits a lot of complications of Microsoft's 'shared source' license. See the-source.com/2009/12/…. I'm looking for a truly open source alternative, I'm convinced that moonlight is not copyleft compatible enough to fit that profile. Thx for the contribution anyway.Roseboro
@Evan Plaice: Moonlight is not derived from Silverlight and it is an open source (X11/LGPL licensed). The only thing not open source are the optional binary codecs from Microsoft although you can use ffmpeg instead. That said, Silverlight/Moonlight != WPF.Chem
@EvilRyry My mistake. I meant that Moonlight is derived from the same underlying technology as Silverlight which Microsoft owns exclusive rights and patents to. Meaning that, at any time, Microsoft can rescind their covenants-not-to-sue and take legal action against Novell and the Moonlight project. While unlikely, it's worth mentioning. I understand that Moonlight != WPF; and since it's open source and can be run on the desktop, it's worth including in this list.Roseboro
@EvilRyry, Moonlight != WPF, true, however developers can create desktop apps using Moonlight (youtube.com/watch?v=IbMyPG4IKo8) - a demo was released showing this back in '07.Succentor

© 2022 - 2024 — McMap. All rights reserved.