15 ms·
Qt for WebAssembly Technology Preview
- kodablah 9y agoThere is emscripten-qt that built Qt apps w/ Emscripten for a while now[0] (since asm.js and WASM should not change anything even though it hasn't had updates in a few years). Appears this uses Emscripten as well. I wonder how this compares at a tech level. 0 - http://vps2.etotheipiplusone.com:30176/redmine/projects/emscripten-qt http://vps2.etotheipiplusone.com:30176/redmine/projects/emsc...
- TazeTSchnitzel 9y agoThank you for pointing to this, I'd seen it before and was reminded of it. It's impressive and exciting it can run a full app like KATE. It feels as if you're running a Linux VM inside the browser, but no!
- arusahni 9y agoSo, you're saying I could use a QTWebView in the browser?
- alde 9y agoYo, I heard you like browsers, so we put a browser in your browser, so you can surf while you surf.
- withjive 9y agoThis would be for the QtQuick backend. The QTWebView is a separate plugin component with its own set of dependencies. You wouldn't want to do that anyways, much more effecient to just communicate from Qt to Javascript webviews (but I'm sure you know that :))
- marshray 9y agoWhat would be the security model of such a browser environment? Maybe like an iframe?
- beached_whale 9y agoI suspect similar to wt c++
- codetrotter 9y agoNo no no. Obviously you should compile your existing Qt application to webassembly, put that in a QTWebView and have that be your application.
- gpm 9y agoAnd we will run this all on nebulet, an OS being written for a pure web assembly user space [0]. But seriously, you say this like it's horrible, but a bytecode/VM that allows us to abstract over code that runs in a browser/code that runs a native app/code that runs in a device driver is really exciting. The fact that it allows infinite nesting is a inevitable mildly beneficial side effect to having interoperability. [0] https://github.com/nebulet/nebulet https://github.com/nebulet/nebulet
- infinite8s 9y agoSo basically Squeak, a 25 yr old technology that still runs bitexact across all it's virtual machines.
- deleted 9y ago[deleted]
- deeringc 9y agoI think you should run your QT app inside Electron!
- jkollross 9y agoHow long until someone uses this to make an Electron app?
- weberc2 9y agoOnce we compile Chromium to webassembly, we can run Qt in Chromium in Chromium in Slack!
- cmsj 9y agoSee also https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death... You jest, but this sort of thing probably is the death of almost all native software, sadly.
- oblio 9y agoThere are some things we mourn. Nobody mourns cross platform distribution of native apps. Anyone who does hasn’t had to manage the insanity of installer apps and of papering over a million different OS versions and app versions. It’s 2018 and we still don’t have a common, wide spread, OSS framework for self-updating native apps that runs on all the major desktop operating systems. And let’s not even go into app store territory...
- drb91 9y agoThe best native apps aren't cross platform. The worst native apps often are (at least from a mac perspective). We are simply moving to the lowest common denominator for all platforms, to the profit of business and the loss of the end-user. We can now develop software that is equally shitty for everyone much cheaper than we could before. Is that the end of the world? No, of course not. But we aren't building better tools over time--for instance, google docs is distinctly worse than the word I used on macintosh back in the 90s for all the use cases I care about. So is pages! All this software is more complex, and generally for little benefit.
- keyle 9y ago"Because you can doesn't mean you should." -common sense. But then again, since 2017, anything that can happen will.
- deleted 9y ago[deleted]
- ehsankia 9y agoOn the one hand, I find it funny that people are using bloated electron to avoid writing Qt code, and now you can write Qt code even on the web! On the other hand, if you already do have a Qt application, then you can maybe get a webapp for almost free?
- joezydeco 9y agoSee, this is what I get for procrastinating. I've been asked by a customer to port my recent Qt app to iOS. Got the equipment, was about to get the development environment set up, got XCode installed....and now this. This is pretty exciting if it all works as expected. EDIT: aaaaaaand after trying some of the demos at https://github.com/msorvig/qt-webassembly-examples https://github.com/msorvig/qt-webassembly-examples using a brand new iPad (iOS11/A10 Fusion core) using Safari, half the examples run out of memory, and the other half aren't touch enabled. Hmm. EDIT2: Firefox iOS, same set of crashes.
- joezydeco 9y agoEDIT3: got it to cross compile and load off a server. And....ugh. It's got a long way to go. It works, at least. Still too large for a mobile device however.
- solarkraft 9y agoThis (assuming it's Qt Quick) opens the door for a competitor to HTML for web apps.
- gmueckl 9y agoExcept this looks like it would be a big download, wouldn't it? And how would this UI interact with assistive applications like screen readers?
- candiodari 9y agoAccording to my chrome network tab cnn.com now comes to 1.7 megabyte. Without ad blocking, over double that. Let's say 20% of that is images (it's actually less) ... it is not a problem to fit quite an extensive C++ program in that.
- gmueckl 9y agoHave you checked the sizes of the Qt libraries lately? QtCore or QtWidgets larger than 5MB each. Qt is simply an enormous amount of code. I currently can't get any of the wasm files for the demos to load to compare those, though.
- keyle 9y agoThis reminds me of a time, when I used to work for a very large company. After an unfortunate amount of meetings and powerpoint presentations about ubiquity and compatibility, we ended up putting a Flash VM inside a Java client, to read HTML. Oh boy, sometimes you just walk away from a crash, but you're never the same.
- tzahola 9y agoRight in the feels bro...
- alde 9y agoI think this is misdirected criticism. WebAssembly runs at almost native speeds on a single very lightweight "VM".
- k__ 9y agoThe problem here is probably more download time, not run performance.
- alde 9y agoWebAssembly is binary packed bytecode and generally takes much less space than UTF-8 JavaScript source files.
- kllrnohj 9y agoYour 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.
- deleted 9y ago[deleted]
- em3rgent0rdr 9y agoCouldn't Qt's webassembly library be cached in your browser, to be reused by any Qt webassembly app?
- giancarlostoro 9y agoSay what you will, we need these kind of projects in order to push forward WebAssembly (and eventually JavaScript may not be the only dominant language for front-end web development). I'm curious how much of the canvas they're taking advantage of if any of it. It's quite exciting. I might wind up porting one of my existing Qt applications just to try this out and see what that would be like.
- k__ 9y agoWasn't it more like: most people know JS so everything (server, mobile/desktpp apps, etc) was made with it. And not like: JS is so shitty, better we make everything with it, even if there are better alternatives. ?
- Xuper 9y agoIt was the latter I am afraid. Then the general hype started and now we have insanity like Electron etc. Don't worry web assembly is here to help JS, not to replace it ;-).
- giancarlostoro 9y agoI wouldn't be surprised to see WebAssembly only applications once WebAssembly matures and can "stand on it's own free" honestly. JavaScript for sure will hold dominance for many, many years however.
- emilsedgh 9y agoI'm seeing a ton of snarky comments, but isn't this what exactly WebAssemly is about (which I see people praising everyday as it opens up possibilities)
- k__ 9y agoI had the impression WASM was about writing parts of web apps in it, so they get more performance. I can't imagine many people would like to download a 60GB AAA game or something like Photoshop to run it in the browser.
- lotyrin 9y agoHow do people install their AAA games and Photoshop today? I'd think the majority downloaded them, right? There are plenty of downsides to having ubiquitous WASM-compiled cross-platform "browser-native" apps, and having basically everything forcefully turned into an experience akin to ChromeOS out of convenience for app developers, but that doesn't feel like one.
- k__ 9y agoI mean, web apps today are optimized to get a click-and-play feeling. Software like Photoshop or GTA5 isn't optimized for that, you need to download and install them for hours.
- eslaught 9y agoActually, if I could have Photoshop run in a browser, with its full feature set, and running at >90% of full native speed, that would be pretty awesome. And I'd even be willing to wait for the multi-GB download as long as it only happened once (with small deltas thereafter). Not saying we're there yet, but it's not hard to see where WASM could take us.
- ori_b 9y agoI can see where web assembly could take us, but I am confused about why people seem to want to go there.
- emilsedgh 9y agoI could find a few live demos [0] although some are broken [0] https://msorvig.github.io/qt-webassembly-examples/ https://msorvig.github.io/qt-webassembly-examples/
- xenator 9y agoTried on iPad, constantly running out of memory.
- methyl 9y agoNo example is working for me.
- realusername 9y agoI just have "NetworkError" for all of them.
- car_invasion 9y agoIt's rare I have to disable ublock, but that helped me.
- realusername 9y agoaaaah, thanks a lot! I did not made the link with the error name...
- mappu 9y agoNote that Qt has two separate technology previews for porting Qt apps to run in the web browser: Qt WebGL streaming (qplatform/qpa plugin): The Qt binary runs on your PC as normal, but instead of opening an X11/Win32 window, opens a network port. You can open the URL in a browser to see the interface. Only one connection is allowed / only one user can interact with the app at a time. Technology preview since 5.10, will be "TP2" status in 5.11. See http://blog.qt.io/blog/2017/11/14/qt-webgl-cinematic-experience/ http://blog.qt.io/blog/2017/11/14/qt-webgl-cinematic-experie... and http://blog.qt.io/blog/2017/07/07/qt-webgl-streaming-merged/ http://blog.qt.io/blog/2017/07/07/qt-webgl-streaming-merged/ Qt for WebAssembly: The entire QtWidgets / QML libraries are compiled to WASM and run clientside. There is no server-side component. Will be released as a technology preview in the upcoming 5.11 release.
- bhouston 9y agoThey should port the rendering of the qt components to Dom/css with a web assembly backend. That would seem like a web app but allow for c++ code reuse.
- emilsedgh 9y agoI don't think it's doable on a Dom/css in a meaningful way as the semantics are too different. But a webgl canvas id doable and I think what they are aiming for. Which would be great for QML.
- mwcampbell 9y agoI think that would be more feasible with something like wxWidgets or libui [0], which already use each platform's native widgets. [0] https://github.com/andlabs/libui https://github.com/andlabs/libui
- bmn__ 9y agoGTK isn't native on a huge number of users' desktops, including mine. It wouldn't be so bad if the GTK CADTs would stop breaking style configuration with each release.
- freedomben 9y agoReally surprised and saddened by the negative comments here. Qt is an amazing framework that has been around for nearly 30 years. Developing with it is a great experience, probably the most enjoyable coding I've done. I have faith that the Qt project won't spend time shipping this if it doesn't offer advantages. Give them time, and a little benefit of the doubt based on a very long history of excellence.
- Havelock 9y agoAgreed Qt is a great framework and I'm excited to see this development.
- mozumder 9y agoQt is great and probably the best cross-platform app-development environment. Given that, why would you use this instead of just building a compiled package for a targeted platform?
- freedomben 9y agoSorry, I'm not sure I understand your question. Every project I've been part of does build a compiled binary for each supported target platform.
- xpaulbettsx 9y agoI'm not sure I buy that, are you saying that the only reason that Qt hasn't completely taken over writing native software on (even desktop! not to mention mobile where Qt also works), is a marketing problem? I would argue that Qt's problem is: * Licensing is expensive (look it up, you can't just use it for free for large-scale commercial projects, contrary to what many people believe) * Getting started with Qt is painful and integrating it into an existing codebase even moreso - get ready to suffer with C++ linker nonsense * You have to write in languages that are not particularly enjoyable to ship a production application (C++, JavaScript but without The Nice Parts of modern JS web dev) * The "deploy" bit is completely left to the reader, Qt doesn't help you write apps and ship them end-to-end. Contrast this with Electron which has a pretty strong (albeit a bit mysterious) packaging and auto-update pipeline Qt experts will argue on all these points, "It's a library, it shouldn't do XYZ", but at the end of the day, Qt is a means to ship Desktop and Mobile Software, and by ignoring the entire Developer Experience from end-to-end, they miss the mark.
- zengid 9y agoIt would be great if this could be done with JUCE too!
- CyberDildonics 9y agoAlso FLTK, both would be very small compared to Qt.
- mwcampbell 9y agoUnfortunately, this port seems to lack accessibility for blind people and others that require assistive technology. My conclusion is based on the demos linked elsewhere on this thread. [0] I have no idea how to make a conventional GUI toolkit accessible with ARIA, but I hope the Qt developers figure it out. Edit: Forgot to mention that I tested on Windows with a screen reader and Chrome. [0]: https://msorvig.github.io/qt-webassembly-examples/ https://msorvig.github.io/qt-webassembly-examples/
- kuschku 9y agoAccessibility like that likely won't be possible, as the only way to get accessibility in browsers is with the DOM, which is very limited in functionality. If you wish to have accessible applications, you'll need to run the native applications instead.
- mwcampbell 9y agoWhat if some application developers don't make a native version available? Accessibility should be the default on all platforms, not something that application developers have to go out of their way to support.
- kuschku 9y ago> Accessibility should be the default on all platforms, not something that application developers have to go out of their way to support. Complain to the browser developers then, they’re the reason why this is so hard for Qt running on the web.
- brian_herman 9y agohttps://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death... The end is neigh
- pier25 9y agoIs it common for people to call it YavaScript?
- pier25 9y agoApparently it's a joke: https://www.quora.com/JavaScript-programming-language-Why-does-Gary-Bernhardt-say-YavaScript-instead-of-JavaScript-in-his-talk-The-Birth-and-Death-of-JavaScript https://www.quora.com/JavaScript-programming-language-Why-do...
- IncRnd 9y agohttps://github.com/msorvig/qt-webassembly-examples https://github.com/msorvig/qt-webassembly-examples
- chuckdries 9y agoHonestly, I can't wait to try it. This is exciting.
- grondilu 9y agoLooking at software that uses Qt[1], I'd say I'll be impressed once they have compiled one of them, say for instance Stellarium, to Wasm. It'd be great to see how a full software, not just a toy demo, behaves in webassembly. 1. https://en.wikipedia.org/wiki/Qt_(software)#Applications_using_Qt https://en.wikipedia.org/wiki/Qt_(software)#Applications_usi...
- davidkhess 9y agoOn a comment to the article: > To give an example, the app I’m working on (https://github.com/OSSIA/score https://github.com/OSSIA/score) is roughly 300kloc of Qt / C++ code and compiled in WASM almost from the first try. I’m still having freezes in some places but overall it’s working great.
- thomasfl 9y agoNo demo page?
- alex7o 9y agoIf everybody has a problem with Qt why don't we see gtk on more systems. The last time I checked you can use gtk on win/Linux/Mac it is free, and it sort of works.