News for hackers. Stuff that matters.
Re:Qt for WebAssembly Technology Preview by alde on Monday April 23, 2018 @06:38PM (#16908124)
WebAssembly is binary packed bytecode and generally takes much less space than UTF-8 JavaScript source files.
Re:Qt for WebAssembly Technology Preview by kllrnohj on Monday April 23, 2018 @06:43PM (#16908155)
Your JS source files typically don't have all the code necessary to re-implement 2D drawing, text handling, i18n code, etc... That's already been downloaded & provided in the form of the browser itself.
Re:Qt for WebAssembly Technology Preview by em3rgent0rdr on Tuesday April 24, 2018 @12:51AM (#16909927)
Couldn't Qt's webassembly library be cached in your browser, to be reused by any Qt webassembly app?
Re:Qt for WebAssembly Technology Preview by spearmunkie on Monday April 23, 2018 @07:01PM (#16908264)
I don't see why we won't be able to reference common 3rd party libraries along with their version number and cache them across websites. Eventually a giant repo of common libraries will be built.
Re:Qt for WebAssembly Technology Preview by bhouston on Monday April 23, 2018 @07:13PM (#16908323)
The versioning will be very custom and generally they will not be shared across apps. Just like react.js isn't shared across apps.
Re:Qt for WebAssembly Technology Preview by imtringued on Tuesday April 24, 2018 @07:21AM (#16911590)
tree shaking optimizations will result in everyone having a different qt.wasm.
Re:Qt for WebAssembly Technology Preview by CyberDildonics on Monday April 23, 2018 @08:42PM (#16908870)
Hello world in Qt is 25MB as a demonstration of 'lightweight' Qt.
Re:Qt for WebAssembly Technology Preview by jcelerier on Wednesday April 25, 2018 @03:54AM (#16919394)
hello.cpp:

    #include <QLabel>
    #include <QApplication>

    int main(int argc, char** argv)
    {
      QApplication app{argc, argv};
      QLabel label{"hello world!"};
      label.show();
      return app.exec();
    }
build:

    $ g++ -O2 -g0 -fPIC hello.cpp -I/usr/include/qt -I/usr/include/qt/QtWidgets -lQt5Widgets -lQt5Core
    $ du -csh a.out
    16K	a.out
seriously...
Re:Qt for WebAssembly Technology Preview by joezydeco on Wednesday April 25, 2018 @03:28PM (#16925159)
Try it again with Qt configured for -static and not -dynamic.
Re:Qt for WebAssembly Technology Preview by sirspudd on Monday April 30, 2018 @08:49PM (#16963820)
I compile a Qt Quick application statically for the Raspberry Pi on a regular basis, and the whole binary is around 7 megs big. If you remove Qt Declarative (Your hello world just requires QtCore) it will be a fraction of this size.

So nice to see people fabricating numbers and passing them off as data.

Re:Qt for WebAssembly Technology Preview by joezydeco on Monday April 23, 2018 @11:13PM (#16909591)
Nobody optimizes and recompiles the libraries anymore to configure out the unnecessary parts.

The mechanisms are still there but the practice died when Qt stopped focusing on embedded targets.

Re:Qt for WebAssembly Technology Preview by ahartmetz on Tuesday April 24, 2018 @06:42AM (#16911400)
Qt does focus very much on embedded targets:

http://blog.qt.io/blog/2016/08/18/introducing-the-qt-lite-pr...

Embedded is the biggest market for Qt right now.

Re:Qt for WebAssembly Technology Preview by joezydeco on Tuesday April 24, 2018 @07:58AM (#16911788)
A few notes:

1) Qt Widgets development stopped with 5.0. I had bugs filed on the embedded Linux targets and was told "sorry, these will never be fixed".

2) #1 means that Qt wants you to use QML. I need to run a Javascript engine on my target? Note in the comments of that blog post that they hope to run on an A7 (or really fast M7)...someday.

2b) ...And if they do run on a lower end platform, you still need a POSIX O/S. uCLinux is not a great option on M3/M4 CPUs and keeping the binding dynamic on those cores to stay LGPL compliant is extremely difficult.

3) QML bindings are a pain in the ass, especially when you're trying to put a UI on legacy code.

4) Most crucial: Qt Lite and QtDC are commercial products only.

So, in my opinion, embedded is still a 2nd class player. Or, I could clarify further: low end embedded is a 2nd class player. If you're working on automotive HMI/IVI? They'd love your business.

Re:Qt for WebAssembly Technology Preview by jcelerier on Wednesday April 25, 2018 @03:59AM (#16919415)
> 1) Qt Widgets development stopped with 5.0.

http://blog.qt.io/blog/2018/02/22/qt-roadmap-2018/

> So, quite many new things for Qt Quick users, but not to worry – we have not forgotten users of Qt Widgets. On the contrary, already during the past year we have been increasingly addressing open bugs of Qt Widgets and intend to continue doing so during 2018 and beyond. Both Widgets and Qt Quick have their strong points and they complement each other nicely as fully supported parts of the Qt offering.

Re:Qt for WebAssembly Technology Preview by joezydeco on Wednesday April 25, 2018 @03:29PM (#16925167)
I'll believe it when I see it. That also kind of hints there were others like me that didn't believe in the QML future.
Re:Qt for WebAssembly Technology Preview by k__ on Tuesday April 24, 2018 @12:41PM (#16914195)
Never understood the obsession some people have with Qt
Re:Qt for WebAssembly Technology Preview by joezydeco on Tuesday April 24, 2018 @01:10PM (#16914491)
It's a solid toolkit that gets the job done and gets out of the way.

I've shipped a dozen products with it over the course of my career.

On embedded targets I'd never use anything else. The alternatives are way too simple or overscripted playback engines that have no flexibility with underlying code.

Re:Qt for WebAssembly Technology Preview by k__ on Tuesday April 24, 2018 @12:39PM (#16914175)
That's what I thought.

Web-apps are architected fundamentally different than classical software.

Re:Qt for WebAssembly Technology Preview by jcelerier on Tuesday April 24, 2018 @08:08AM (#16911838)
uh ? I have a large Qt / boost app (300kloc) that I compiled with Qt/WASM and the resulting .js is less than 20 megabytes.
Re:Qt for WebAssembly Technology Preview by CyberDildonics on Tuesday April 24, 2018 @04:34PM (#16916288)
That was for native compilation and those figures were from their own website.
Re:Qt for WebAssembly Technology Preview by rictic on Monday April 23, 2018 @09:18PM (#16909058)
Gzipped source in a high level language can be much smaller than the equivalent bytecode.

That's not why these demos "Hello Framework" demos are 3-7MB though. That's due to the cost of shipping an entire widget system that takes complete responsibility for everything between raw user input to pixels on the screen, without using many of the affordances of browser APIs. This is really awesome for emulation, sandboxing, and preservation of software, but it's not a good route for saving bytes for the user.