Is OpenLaszlo's dual-runtime approach (HTML5 and Flash/SWF) still valid?

I started using OpenLaszlo back in 2004 after I concluded at the time there was no better free, open-source RIA tool for my needs.

My apps currently leverage SWF and JavaScript runtimes. So just because they aren't in the now-dead Laszlo showcase doesn't mean there aren't large apps out there leveraging both runtimes. I've been working on my apps for 7 years. Gliffy is a tinker toy in comparison IMHO...I've yet to find any OL apps more complex than mine. Doesn't mean they aren't out there, but if they are I haven't seen them.

My apps would not be feasible with just one or the other runtime. So for me, having both runtimes is essential. HTML5 is too slow for certain things, while SWF10 offers the most consistent cross-browser experience.

Haxe is no OL replacement, that's for sure. The value of OL to me has been the productivity boosts gained from constraints, instance-based programming, and the ease in binding data to views. I could not have built my products on my own using any other tool. I looked far and wide. With OL in decline and now all but dead, I keep looking, too. OL's HTML5 runtime doesn't work in the latest IE versions, which stinks...but it can be made to run via IE7 emulation mode or the Chrome frame plugin (which is actually essential due to IE's crappy JavaScript engine).

Whether or not you need both runtimes depends on your project. While it probably doesn't make sense for compiler makers to be thinking that being able to emit both SWF and HTML5 runtimes is desirable, since OL has been able to do it for years now there are some systems out there like mine taking advantage of that capability.

As an example, my system is being used on military classified networks that don't allow the Flash plugin...so for those installations I must rely on HTML5. When not running on classified networks, my system leverages the runtime performance and other capabilities of the SWF runtime when it is advantageous. The hybrid approach is essential for me. If I had a SWF-only app it wouldn't be allowed on classified networks, but if it were HTML5-only portions of the app would be less than stellar due to browser limitations.


I'll caveat this first by saying that it isn't going to be a complete answer; however, hopefully some of the information will be useful to you.

I looked at OpenLaszlo recently in relation to another question on Stackoverflow and it seemed to me to have all the hallmarks of a moribund project (on review, evidence here supplied by Raju in the comments).

In relation to Gliffy, this article provides a bit of insight into their rationale for abandoning OpenLaszlo. In particular, they mention the problem of compilation times and the effect this was having on their development time.

It definitely doesn't tick all your boxes (specifically, I don't believe there is support for a declarative XML-based UI language), but Haxe / NME appears to cover your core requirement of being able to compile to both Flash and HTML5.

Fair disclosure, I haven't actually used it but I keep hearing good things about it (I've just been to a creative development conference where I heard at least 2 speakers raving about it). It's essentially ActionScript 3.0 minus the major annoyances and plus the major omissions (Abstract classes for example). It should be easy to pick up, therefore, if you already know ActionScript 3.0, and a pleasant experience to work with either way.


Even in 2012 web developers are still facing the problems Laszlo tried to solve when the company initially created OpenLaszlo. 10 years ago Flash was the only cross-browser technology delivering a pixel-perfect rendering for 97% of the desktop browsers, where the plugin was installed.
JavaScript engines, HTML and CSS have a lot more to offer now: Audio and video playback, embedding fonts, CSS based animation, hardware-accelerated rendering of content, drawing APIs, lately video conferencing support in some browsers (Chrome, Firefox, and Opera based on WebRTC). Modern browsers offer almost the same features Flash does, but there's still certain percentage of users browsing the web with an earlier version of Internet Explorer than IE9.
The requirements for consumer facing or business applications are still different: Many enterprises

Cross-browser application development
If you know the APIs and differences between browsers, you can easily achieve 80-90% of what you can with Flash based on open standards. But you still depend on the expertise of your developers, with Flash you have one ActionScript API, which you use across all browsers (at least for Windows and OS X, Linux has some limitations and is not well supported).

The LZX language vs pure JavaScript
LZX is still a fantastic language for building great UIs, using an established development approach. LZX has evolved a lot: CSS support, mixins, support for coding classes in JavaScript instead of XML, ability to embed ActionScript 3 code into the language are some of the new features.
6 years ago - long after LZX had been created - many developer didn't know how to write good JavaScript code. The prototype based development model wasn't well documented, and developers tended to use JavaScript like Java/OOP - resulting in horrible code. And even in 2012, with many good books on JavaScript out in the market and millions of excited JavaScript developers, building complex interfaces using pure JavaScript it not an easy task. There's a reason for the popularity of languages cross-compiling to JavaScript like CoffeeScript.
A large number of the developer who have used OpenLaszlo's LZX language and moved on to using JavaScript frameworks like jQuery or Prototype complain how much code is needed to achieve what can be done with a few lines of LZX code using datasets, databinding, replication, and the layout system. Many of the Flex developers switching to HTML5/JavaScript development complain about the same things. Having the power of LZX, and being able to cross-compile to both SWF and JavaScript is therefore still something extremely valuable.

OpenLaszlo and the Adobe AIR SDK
With the ActionScript 3 based SWF10/11 runtime, any OpenLaszlo application can be easily compiled into an Adobe AIR for Android or iOS application. Check this video I created back in 2010, showing an Apache Ant script compiling an OpenLaszlo app into an AIR for Android application and deploying the app to the phone. That workflow works with the latest (unreleased) version of OpenLaszlo 5.0. What's missing is, that there is no component set optimized for mobile and touch for OpenLaszlo at the moment. But it would not be too much work to create such a component set, if the active community members would be willing contribute to such a project. That means, you can use LZX to develop mobile applications with good performance on modern smartphones and tablets, without the need to learn Objective C or Java for Android development. Haxe is another open source project heavily using cross-compilation to target even more runtimes: JavaScript, Flash, NekoVM, PHP, C++, C# and Java.

Dual-runtime and cross-compilation for a better user experience
There have been a number of technologies in the past years enabling mobile app developers to code an app in one language, and cross-compile the code other mobile platforms. You can do the same with OpenLaszlo, and you could add other runtimes easily due to the modular architecture (components written in LZX, LFC written in LaszloScript/JavaScript, kernel written in runtime specific language, e.g. ActionScript3). But in my eyes there's an even more important reason to use a language like LZX, and cross-compile to JavaScript, ActionScript 3 or other languages or VMs. It has to do with the ability to create stunning visual effects and unique user experience, which is enabled by LZX, and difficult to achieve with pure JavaScript development.
Laszlo Systems and David Temkin (the former CEO and CTO of Laszlo) established the term Cinematic User Experience:

Cinematic user experience conveys first of all that you aren’t just watching you are interacting – the “user experience” part of it. We thought cinematic was an intriguing term, that had a non-techie spin to it. It was something that when non-techies saw it, they instantly understood this is a completely different type of product category and yet industry insiders would look at it and say things are moving on the screen, maybe you have a different technical architecture…

One of the goals of OpenLaszlo and LZX was to enable the creation of such Cinematic User Experience, by giving UI engineers the APIs and the tools in the programming language (LZX) to exactly reproduce the experience created by UX designers using tools like the Flash authoring tool.

Here's a quote from a book on iOS app development, showing that other companies see the value of such an approach:

One of the concepts that Apple engineers like to talk about when they’re talking about beauti-ful user interfaces is the concept a “cinematic user experience.” A cinematic user experienceessentially is a user interface that looks like something from a Hollywood movie. It looks futuris-tic and smooth, and it uses animation to enhance the feeling of working with physical objects.
Apple user interface designers have specifically given you a set of tools that enable you to buildthese types of cinematic user interfaces. Tools like Core Animation give you the power to builduser interfaces that involve elements that slide in from off-screen rather than just appearing,and elements that scroll with an almost physical weight to them

LZX and the cross-compiler give us the tools to create this special user experience. You could do the same with JavaScript, but it would be more code, and probably much more difficult. A good example is the first OpenLaszlo application running in DHTML, the LzPix demo: Created in 2006, it's still an amazing UI - and I haven't seen anything like it built with JavaScript frameworks.

Dual-runtime is still valid
Yes, the dual-runtime approach is still valid. There should be more applications in the showcase using the DHTML runtime, and I don't know why that's not the case. The fact that OpenLaszlo has not been optimized for the iPad or tablets is definitely a disadvantage, but the DHTML runtime could be optimized for iOS and Android. If the desktop browser quirks are removed, a new component set would be created optimized for mobile browsers (utilizing HTML canvas and CSS2/3 to render the compoents), you'd have a solid mobile runtime for OpenLaszlo.