QT 5 launched by new owner, Digia
digia.com
digia.com
And of course Qt will be the main SDK for both Blackberry 10 and Jolla's Sailfish.
It made me wonder whether BeOS might not make a great mobile OS. Designed for limited hardware, excellent multitasking, and an opensource version in alpha status now.
Put UI handling in separate threads/processes (Amiga "Tasks" would've been processes in a memory protected OS, but since AmigaOS isn't, for all intents and purposes a Task behaves like a thread in modern OS"s), and prioritise input and UI control handling threads higher than others.
Lack of UI responsiveness under load in modern OS's is down to laziness - this was largely a solved problem 20 years ago, on hardware magnitudes slower.
To the extent that Microsoft removed all blocking calls from the API, forcing the programmer to use asynchronous APIs (which, admittedly, works well enough given language advances).
My old iphone 3G stalls for seconds at a time due to memory pressure; Windows stalls for seconds at a time due to CPU pressure. So does Linux with X; I have no experience with Android, but I'd be surprised if it is different.
So apparently, it IS a challenge, even though there is no rational explanation why it should be.
* APIs blocking on network operations (e.g., gethostbyname())
How does BeOS avoid/avoid lagging with these things?
Be Inc did 2 things well in this regard
* They designed their API/App Framework so that launching threads was easy, and passing messages between threads was safe & easy
* They developed a culture (both within the organisation and also within their developer community) of using those features everywhere.
Those two things are more closely linked than they may appear. The framework was explicitly message-based. You interacted with different components by sending and receiving messages. And it was heavily threaded (Be called it "pervasive multi-threading"), to the extent that every window had its own thread, separate to the main app thread.
By having those features, and not having any particularly good way to write apps except by using the official framework, the developer community was forced to learn how to develop multi-threaded, message-passing apps.
And once developers started to think in terms of messages and threads, it was natural for them to use those elements to solve all sorts of problems, so that no self-respecting BeOS developer would ever think to do significant processing inside any of the UI handling threads.
And like node.js, they tried to avoid blocking APIs (and mostly succeeded), but provided a very simple way to "outsource" them to other threads. You can do that in C or Java as well, but it's not as easy or as pervasive as it is in BeOS.
Windows and Unix app developers have been used to doing everything on the main app thread, and everything is geared around that.
The Amiga couldn't afford to do that, as the machine was so slow that the UI would be unbearable. Modern OS's get away with an architecture that makes it ok to be lazy, because the machines are fast enough that it's just an annoyance.
Consider for example, that to make cut and paste fast on AmigaOS, one "Task" (thread/process) would send a message stating what parts of it's UI data it wanted copied to the clipboard. Another task would then copy the data, and confirm and write the data to the clipboard. Why? Because the clipboard could be on a very slow device (in theory on a floppy, though usually no slower than a slow harddisk).
AmigaOS was infused with design decisions like that: UI "gadgets" (widgets, buttons, whatever you want to call them) using the basic Intuition (AmigaOS GUI) functionality would largely be handled in a separate high priority UI task. Keyboard and mouse input were handled by separate high priority handlers. Window rendering were given high priority.
Something as simple as the terminal / shell which in Linux is typically a terminal application talking to X, in AmigaOS consists of several components, each running in it's own task, some of them providing services that can be reused:
- an input handler, processing keyboard entry, which sends messages to the console device.
- The console device provides a stream oriented read/write interface that hooks a keyboard and mouse to a rectangular section of a Window (you can attach a console device to any window to get an ANSI/VT100 like terminal). It provides the text rendering, and "cooks" the keyboard input into escape sequences etc. It exchanges messages with the console-handler.
- The console-handler, which provides a higher level wrapper around the console.device, providing additional services such as command line editing, history, and manages the window the console.device is instantiated in. In AmigaOS you can open a console-handler by writing to the special filename CON: which will open a console window for you and give you a file handle to interact with it.
The shell is comparatively "dumber" than on Linux as a result of this structure, as the console-handler is expected to handle most stuff like line editing.
A typical AmigaOS app - even if the developer did not take care to thread the app explicitly - would usually end up splitting it's processing over many threads by virtue of making use of OS services that were explicitly message passing, and where stuff dealing with the UI would get priority.
It made it very easy to ensure the UI remained responsive, and was a cornerstone of a lot of the early OS friendly demos of Amiga features: Run whatever you wanted in multiple windows. The OS would still always prioritise the stuff that would make user-interaction feel snappy, unless you actively worked to prevent it (doing your own component rendering in your apps main thread, for example, like lots of modern software ends up doing by virtue of stupidly lazy frameworks...)
These features were available in libraries on other platforms since forever (I remember a Herb Schildt book from 1988 that presented an implementation in C for DOS!), but were culturally ingrained in the Amiga, and are still essentially fringe in other ecosystems.
QT5 is a dream come true, and when it becomes omni-deployable (android, ios, raspberry pi) it will be even better.
For people doing lower-end embedded stuff Qt5 isn't going to give you much, if you can run it at all.
Umm, okay, can you point to anyone that mentioned that Qt5/V8 would be good for those chips? It's not like anyone came in the thread writing that "Oh, QT5 javascript scripting would be great for my 360 MHZ R1".
Oh and my CPU doesn't have any hardware OpenGLES acceleration. How should I work on that?
You shouldn't and nobody said you should. Just like nobody said it would be fine to program Big Blue with, or Arduino.
Sure, you will take a runtime performance hit if you do a QML UI because all the QML needs to be parsed.
But then again, no it's not all javascript and no it will not suck up all of your CPU. When you write simple bindings (for example someProperty: otherPropert ? "yes.png" : "no.png") the QML engine actually detects these simple cases and doesn't invoke the javascript interpreter when it needs to evaluate the expression, but handles it internally instead. Also if you don't want to do things in javascript you really don't have to as calling QObject slots is super easy. If you stick to simple bindings and write your logic in C++, the javascript interpreter won't have much to do.
What professor overhead? It's 2012. Our quad core processors sit idle most of the time -- and even those in our phones aren't particularly challenged.
Plus, what "interpreter"?
For one, V8 uses JIT, second, it's way faster than Ruby/Python (languages that are also used for app development), and in Qt5 V8 is just the logic layer, the GUI/scene-graph parts are C++ and accelerated.
For people doing lower-end embedded stuff Qt5 isn't going to give you much, if you can run it at all.
Well, DUH! Who said anything about them? These people can't even afford to use Java or C#, much less V8 bindings for a UI toolkit, and even the C++ Qt5 part is not targeted to them anyway.
Thanks for reinforcing my point. Qt5 is more of a smartphone platform than a GUI toolkit for embedded systems now. There are still a lot of low-end chips that need graphics toolkits and the new whizbang stuff just can't work on these systems. Don't tell me QML2 is great for prototyping GUIs when I can't even run it on my platform.
I completely understand why the switch in focus came along, especially when Nokia took over. I still have bug reports from 2-3 years ago that have been marked "don't care, won't fix" by Nokia. My anecdata comes from actual years of experience making Qt work smoothly on lower-end hardware.
http://www.youtube.com/watch?v=3QgG9oYhH-c
Slides for this and other Qt talks are available here:
Assuming it comes up to speed with Qt5, I'd like to try this with clojure.
Anyone have any experience with Qt and Java/Clojure?
https://qt-project.org/wiki/PySide-Tutorials-by-Experience-L...
There is a book out there called "Rapid GUI Programming with Python and Qt The Definitive Guide to PyQt Programming by Mark Summerfield" Code downloadable here: http://www.qtrac.eu/pyqtbook.html
Full text: http://ebookbrowse.com/summerfield-rapid-gui-programming-wit...
In all the code in that book you can just substitute "import PySide" for "import PyQt4" and pretty much everything works. In addition, if you install Qt4Assistant you will have a searchable tool for all classes and documentation.
That said, QMake and CMake both deal with the preprocessor for you.
Are we talking about significant rewrites and with what compiler? I don't see vendors reaching compliance for at least a year.
Was reading to find answers to some of my own questions and found this link helpful regarding use of c++11 in Qt5 [0]. Use of c++11 features seems limited in the first release which makes sense.
I was doing Qt development in the 3.0-4.0 timeframe (3.x was release, 4.0 was in beta) back in 2004/2005 when Trolltech was independent and I attended a Trolltech sponsored conference at which all the "Trolls" called it "Cute". You can't pin this one on Nokia.
FWIW, despite knowing the "real" pronunciation, I refuse to call it anything other than Q-T ("Cue-tee") aloud
All these cutesy insider pronunciations only serve to confuse and alienate the uninitiated, it's elitist nonsense.
I don't fight my colleagues when they say "Suss" rather than the correct pronunciation of Suse Linux, because when it comes down to it, language is just an agreement that certain sounds mean something to the group that they are being spoken to. There's nothing inherent about the sanctity of language. If you can't be flexible, you might not be cut out for it.