OpenLaszlo is a framework which, officially, is for creating Rich Internet Applications. It takes a higher level markup language Laszlo and converts it into SWF Flash or DHTML. Like many other tools, you are not bound to create only Internet Apps using OpenLaszlo; go ahead if you wanna create your restaurants digital menu card, interface to your car's sensors or for create a skinned menu for your phone.
I just wrote my first piece of code in OpenLaszlo and the experience has turned out be pretty ambivalent. On one hand I feel having lot of power and control to generate a Flash application. On the other hand I feel very restricted due to poor documentation, lack of supporting editors and a language I feel isn't powerful enough and hence inappropriate.
Let me share my experience:
I saw OpenLaszlo couple of years back and thought it to be pretty cool, but kept on my stack of to-learn technologies until yesterday when I encountered a simple problem: My friend had to prepare his PhD proposal defense presentation and he wanted me to create him a three minute count down timer animation for a particular slide. I thought I'd generate an SWF using Flash and embed it in PowerPoint. Then I thought maybe it is a good oppurtunity to learn OpenLaszlo. Alas, this simple problem which I estimated to be a one hour excercise turned out to be 8 hour long nighter marathon; even at the end I couldn't produce something really impressive.
The main reason I took time was lack of good documentation and examples. The basic tutorial is pretty neat but afterwards everything is messed up. I thought maybe I should, just like learning any other language/tool, take a look at examples on net but it turns out that there are few examples as opposed to one would expect. The reference is pretty complex and the guide is not only hard to understand, but seems outdated as well. I couldn't get some things running which were stated in the documentation (I'm pretty sure I was doing what the documentation says).
But that is Ok as with any open source project, documentation and support gets mature over time. However there are other things that deter you from using OpenLaszlo i.e. lack of tools. The running process is horrible for the first time user. There are no editors out there. The best I could do was use Notepad++ was HTML or XML as language. The most annoying this is that there is no debugger. There IS a debug console but not a debugger.
To me, the biggest limitation was the language, the markup language. I felt that I had to hit the keyboard five more times as I would in a scripting language like Python to achieve the same task. For simple UI element level stuff it seems OK but whenever I needed to introduce some logic, I felt as if I were writing code in machine language: so much stuff to do.
For instance, take a look at this piece of code:
<class name="box" bgcolor="red"
height="100" width="100" />
<class name="borderedbox" extends="box"
width="${size}" height="${size}"
onmouseover="this.changeSize(50)"
onmouseout="this.changeSize(-50)">
<attribute name="size" value="100"/>
<attribute name="bordersize" value="3"/>
<view bgcolor="yellow"
x="${parent.bordersize}"
y="${parent.bordersize}"
width="${parent.width - parent.bordersize*2}"
height="${parent.height - parent.bordersize*2}"/>
<method name="changeSize" args="pixels">
this.animate('size', pixels, 500, true);
</method>
</class>
If instead of a Markup language, had it been modeled in an object oriented script language it would have been much more succinct and readable. Let's see how almost same thing could be modeled in Python:
class Box:
height=100
width=100
bgcolor="red"
class BorderedBox(Box):
bgcolor="yellow"
size=100
bordersize=3
unnamed_view = view(bgcolor="yellow", x=self.bordersize, y=self.bordersize,
width=self.width - self.bordersize * 2,
height=self.height - self.bordersize * 2)
def __init__(self):
self.width = self.size
self.height = self.size
onMouseOver=lambda:self.changeSize(50)
onMouseOut=lambda:self.changeSize(-50)
def changeSize(self):
somehow_embed_js(""" this.animate('size', pixels, 500, true); """);
Of course it has its own limitations and cannot achieve all what the markup can, I still think that the trade-off would deter people from using it.