QML support for Golang
plus.google.com
plus.google.com
My main complaint about QML is that it really needs to ship with some desktop widgets. Without common desktop widgets, developers are forced to basically reinvent the wheel, and redefining common controls using primitives like rectangles, text, etc. Once this problem is solved though I really hope QML will take off in a big way.
Unfortunately it doesn't look like these are available yet in Python, as Python doesn't seem to have bindings for QtQuick 2.1, at least based on my googling. Hopefully that will come soon though!
(and the latest installer tagged Qt5.1.0 contains a QtQuick.pyd)
While I see the benefit of using python for brevity in areas Ecmascript doesn't cover (file access, pipes, io, etc) I'd personally just write whatever scripts I was going to use inline with qml as js, because I already can assume v8 is running underneath the platform, and js is pretty fast, so think about it as an interim solution. You can actually write whole qml apps that never compile and just run on the qmlscene binary (which is just a shim frontend to the qtquickengine internals of qt to run qml files).
Is it possible to just manually install relevant QT 5 development packages, and not use the ubuntu-sdk package?
From a perusal of its Wikipedia page, I'd say it looks more like JavaFX Script.
Using that license just leaves things totally clear and unambiguous, if you're using the language you must already be okay with the license. I've worked with a number of companies that just don't want to touch anything *GPL with a 10 foot pole in Go where static linking is non-optional other than over a CGO bridge (which makes Qt's own LGPL usage palatable). This may be a sticking point for them even with the exception (just because of the extra work required in getting legal clearance, not because the license as written actually harms them).
License aside, this is a pretty great library and this is what I think is the most practical solution to providing a cross-platform GUI solution for Go in that it puts all the heavy lifting of platform independence on Qt without having to expose the entire large Qt API to Go via wrappers.
I was actually working on something like this a few months ago (mentioned in HN comment: https://news.ycombinator.com/item?id=6055043) but got side-tracked due to serving jury duty on a 6 week trial (ugh). This solution is a lot further along and benefits greatly from Go 1.2 support of compiling cpp files in CGO (mine was being written against Go 1.1 and required an extra intermediate static library build step). I may possibly continue working on mine anyway just to side-step the licensing issue altogether (which, again, I think is more of a perception problem than an actual practical problem, but still a problem).
And by the way, Qt is also LGPL, so not wanting to link with LGPL software when working on linking with LGPL software is also a curious choice.
Go presents a similar issue to the iOS one in that dynamic linking of Go code to Go code is not an option (at least not without using gccgo), but it is easy to explain this away when using CGO linked code like Qt itself which lives in its own .so/.DLLs because they already understand that the dynamic link barrier shields them from the LGPL issues. But getting them to use Go code with LGPLv3 with exception that will statically link with their own Go code requires some direct involvement from legal/IP to "okay" it. Which could range from being a minor annoyance to a showstopper depending upon the company, in my experience.
https://github.com/niemeyer/qml/blob/master/LICENSE
> "As a special exception to the GNU Lesser General Public License version 3 ("LGPL3"), the copyright holders of this Library give you permission to convey to a third party a Combined Work that links statically or dynamically to this Library without providing any Minimal Corresponding Source or Minimal Application Code"
I'm not sure if there are any other issues with using LGPLv3?
I wish some ideas from QML made their way to the web. The anchor system, for example, is really powerful for layout.
It also requires a Go compiler that works with your preffered platform. I'm not sure on the availability of Go compilers for ios or Android.
https://github.com/visualfc/go-ui
It is unmaintained and has some very serious issues with 64-bit cleanliness (it assumes C int being the same size as Go int, but C int is virtually always 32-bit whereas Go int is either 32-bit or 64-bit depending upon GOARCH).
The same author has another project here which was meant to be a second pass at this (from what I can tell):
https://github.com/visualfc/goqt
But as far as I know nothing was ever released on that project.
The approach used here of exposing QML is the most practical one, IMO. The Qt API is huge (not to mention C++ as opposed to C based) and creating a monster wrapper around it in Go is no easy task (especially if you wanted it to feel like Go) and would be a bear to maintain. Sticking with QML gives you a much smaller surface area to worry about while still giving you most of the benefit of using Qt as a GUI toolkit (at least with Qt 5.1+).
The 5.1 controls module is 95% of the way there to fully native looking QML. At that point, qt widgets are just a fallback.