7 ms·
Qt for WebAssembly Technology Preview
- jkollross 8y agoHow long until someone uses this to make an Electron app?
- weberc2 8y agoOnce we compile Chromium to webassembly, we can run Qt in Chromium in Chromium in Slack!
- cmsj 8y 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 8y 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 8y 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.
- ghettoimp 8y agoI don't disagree that the best native apps are amazing. But it seems so wrong to regard a desire to build cross-platform software as some kind of scheme by developers against their users. In so many cases, being able to use a program/service on many platforms is a huge part of what makes it valuable to the end-user. You can get your gmail from your computer, or your phone, or from a web cafe, and have it all work the same. You can share google docs with anyone and know they'll be able to access them. You can decide you're fed up with windows/macos/android/ios and you want to switch to something else, and most of your software will still be there waiting for you on the other side...
- drb91 8y ago> In so many cases, being able to use a program/service on many platforms is a huge part of what makes it valuable to the end-user. Sure, some users, in some cases, may happen to use some features that are new. The pitch isn't "this is a good tool", it's "you have to use this tool to interact with others or retain data portability." Seems pretty user hostile to me.
- pjmlp 8y agoWell it would be great if there weren't hundred of FOSS desktop variants....
- kuschku 8y agoThere are only a handful you'd ever care about, and Qt apps work fine on all of them.
- weberc2 8y agoBut Qt itself is a dumpster fire. It just happens to be one of the least bad toolkits for Linux. Disclaimer: My last job was Qt developer.
- michaelmrose 8y agoThis seems to be a common complaint as if we were all standing on a life raft pushing it down with the collective weight of our respective keisters. If only some people would stop contributing to creative work you don't see the value of and distributing it for free on the internet! At present you have Debian and a bazillion ubuntu derivatives using a debian package. ubuntu/debian are going to have different versions of some libraries but you can package deps with your app. Arch and derivatives have a pkgbuild. This is quite simple if anyone cares about your app your arch users will probably upload one for you to the arch user repo. Fedora and suse have rpms. These will be similar but not identical. 3 packages and you can cover most of your potential users. In the future you reasonably may expect to be able to distribute a flatpak and be done with it.
- pjmlp 8y agoIt is not only about package formats, since even when the format is the same, the expected directory layouts or installed libraries will be completely different. No one really took FHS seriously, each installation is a special snowflake with its own GUI and dynamic libraries story across Linux variants is even worse than it was on other OSes.
- michaelmrose 8y agoThe cross platform part is called source code. If all the chunks you use to build your app are cross platform packaging wont be horrible.
- oblio 8y agoQuick example: to delivery safely my app with an web app, I need to add HTTPS and that's basically it. These days I can add Letsencrypt trivially. With modern Windows, macOS, Linux, iOS, Android, I'm going to have to run around for ages figuring out how to sign my packages. Despite what you might say, it's never easy or pleasant.
- laythea 8y agoAs long as performance is important, native software will always have an edge. Depends on the application.
- weberc2 8y agoI’m a big fan of native UI, but I doubt this particular claim. The web stack is almost certainly more performance than GTK, for example.
- laythea 8y agoApologies, when I say native software, I don't just mean the UI.
- weberc2 8y agoI don't agree on this count either. You can have performance and maintainability by writing your business logic in a daemon. Only very few applications will find this IPC cost unacceptable, and WASM promises to raise the performance ceiling even further. There are lots of good arguments for native software, but I don't find the performance argument to be particularly compelling.
- kodablah 8y 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 8y 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 8y agoSo, you're saying I could use a QTWebView in the browser?
- alde 8y agoYo, I heard you like browsers, so we put a browser in your browser, so you can surf while you surf.
- withjive 8y 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 8y agoWhat would be the security model of such a browser environment? Maybe like an iframe?
- beached_whale 8y agoI suspect similar to wt c++
- codetrotter 8y 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 8y 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
- keyle 8y ago"Because you can doesn't mean you should." -common sense. But then again, since 2017, anything that can happen will.
- deleted 8y ago[deleted]
- ehsankia 8y 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 8y 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 8y 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 8y agoThis (assuming it's Qt Quick) opens the door for a competitor to HTML for web apps.
- gmueckl 8y 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 8y 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 8y 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 8y 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 8y agoRight in the feels bro...
- alde 8y agoI think this is misdirected criticism. WebAssembly runs at almost native speeds on a single very lightweight "VM".
- k__ 8y agoThe problem here is probably more download time, not run performance.
- alde 8y agoWebAssembly is binary packed bytecode and generally takes much less space than UTF-8 JavaScript source files.
- kllrnohj 8y 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 8y ago[deleted]
- em3rgent0rdr 8y agoCouldn't Qt's webassembly library be cached in your browser, to be reused by any Qt webassembly app?
- giancarlostoro 8y 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__ 8y 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 8y 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 8y 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 8y 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__ 8y 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 8y 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__ 8y 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 8y 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 8y agoI can see where web assembly could take us, but I am confused about why people seem to want to go there.
- emilsedgh 8y 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 8y agoTried on iPad, constantly running out of memory.
- methyl 8y agoNo example is working for me.
- realusername 8y agoI just have "NetworkError" for all of them.
- car_invasion 8y agoIt's rare I have to disable ublock, but that helped me.
- realusername 8y agoaaaah, thanks a lot! I did not made the link with the error name...
- mappu 8y 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 8y 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 8y 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 8y 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__ 8y 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 8y 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 8y agoAgreed Qt is a great framework and I'm excited to see this development.
- mozumder 8y 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 8y 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 8y 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 8y agoIt would be great if this could be done with JUCE too!
- CyberDildonics 8y agoAlso FLTK, both would be very small compared to Qt.
- mwcampbell 8y 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 8y 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 8y 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 8y 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 8y 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 8y agoIs it common for people to call it YavaScript?
- pier25 8y 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 8y agohttps://github.com/msorvig/qt-webassembly-examples https://github.com/msorvig/qt-webassembly-examples
- chuckdries 8y agoHonestly, I can't wait to try it. This is exciting.
- grondilu 8y 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 8y 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 8y agoNo demo page?
- alex7o 8y 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.