A long time ago, I joked about Raptor mode for Lancelot. The idea was plausable thanks to a tool I started developing to make the Lancelot development easier. It was PUCK - the Plasma UI Compiler (as named by Danny Allen). It generated C++ code from the XML-based UI definition.
After a while, I stopped working on PUCK since Lancelot’s UI stopped changing that much. I even removed it from the build system.
Now with QML, the need for a tool like that disappeared.
YAML has its limitations, and some of them are making it a bit problematic for this use-case, but all in all I think this can work.
PUCK - the new one
Since the old PUCK haven’t been used for a long time, and the new project is kinda related, I decided to reuse the old name.
This is an example reimplementing the first part of samegame.qml from the Qt5 demos (I’m overly lazy to actually reimplement the whole example).
One of the great things about the compilation to QML is that you’ll get script errors during the build of your project and not at the runtime.
The compilation errors get reported to the console output along with the code that failed, but also inside the resulting QML as well.
Console output of a failed CoffeeScript function:
Insides of the QML file: