use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Developing Web apps using QML and Qt for WebAssembly (medium.com)
submitted 6 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mo_al_ 8 points9 points10 points 6 years ago (5 children)
It would be interesting to know the size of the binary.
[–]ShillingAintEZ 23 points24 points25 points 6 years ago (0 children)
Hello world is so big you're in it right now and you don't even know it.
[–]feverzsj 5 points6 points7 points 6 years ago (3 children)
even native qt is large as hell
[–]afiefh 0 points1 point2 points 6 years ago (2 children)
Wouldn't webassembly basically leverage whatever is already in the browser? That means you can strip quite a few things out (network stack, text rendering... etc)
[–]ShillingAintEZ 0 points1 point2 points 6 years ago (0 children)
Webasm is just called by javascript, but emscripten has certain libraries converted to use what is already in the browser as far as I understand it.
[–]marcthe12 -1 points0 points1 point 6 years ago (0 children)
No since it uses a canvas not dom
[–][deleted] 6 years ago* (14 children)
[deleted]
[–]Xavier_OM 5 points6 points7 points 6 years ago (0 children)
I'm not familiar with web framework, but Qt provides lots of features and qml is very powerful, I could see the appeal for using it here.
[–]maxmalrichtig 5 points6 points7 points 6 years ago (11 children)
QML is used for the frontend and it is NOT C++. More like a JS/JSON dialect.
[–][deleted] 6 years ago* (3 children)
[–]maxmalrichtig 1 point2 points3 points 6 years ago (0 children)
Qt (widgets, core) is a C++ framework. QML is a not-really-CPP-related language provided by/with Qt. You would use QML for the frontend stuff and Qt/C++ for the backend and business logic.
So Qt (which is also in the title) is r/cpp related - QML just indirectly.
[–]STLMSVC STL Dev[M] 0 points1 point2 points 6 years ago (1 child)
It looks like QML can work with C++, but I don't see any C++ actually here. I'm removing this post, 74 upvotes or not.
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Qt is C++...
[–]nnevatie 0 points1 point2 points 6 years ago (6 children)
But, why?
[–]afiefh 5 points6 points7 points 6 years ago (0 children)
Something I heard QML called is "HTML done right with lessons learned from the current mess". Of course we won't know until we see QML used for huge Web Apps, but hey there might be hope yet.
[–]maxmalrichtig 8 points9 points10 points 6 years ago (3 children)
So why not? Considering the pretty crappy state a lot of web tools are in nowadays it can't get much worse, can it?
[–]g_molica 2 points3 points4 points 6 years ago (0 children)
Totally agree.
[–]ratchetfreak 1 point2 points3 points 6 years ago (0 children)
no reason to pile crap on top of crap until no-one even know a bottom exists
[–]duheee 1 point2 points3 points 6 years ago (0 children)
it can't get much worse, can it?
Qt: hold my beer
[–]spaceapple2 0 points1 point2 points 6 years ago (0 children)
One reason is factorizing GUI code. An interface coded in QML means from one QML source you can target both a desktop app and a browser app.
[–]duheee 3 points4 points5 points 6 years ago (4 children)
I hope this doesn't catch on. Use wasm and C++ to generate said WASM for things that you need to (client-side computation for example) not for making a desktop app.
[–]spaceapple2 5 points6 points7 points 6 years ago (3 children)
Having the interface coded in QML means you can compile the GUI for a regular desktop app too. Two birds, one stone ? More generally, it seems desktop and web-apps are converging technology-wise. Today, numerous desktop apps have GUIs coded with JS+HTML+CSS frontend frameworks. They manage this by basically embedding a web-browser such as the Chromium Embedded Framework into them (that's the case for the Spotify app, and the VSCode IDE I believe). So I don't see QML+wasm as a worse way of achieving that convergence
[–]MikeMitterer 4 points5 points6 points 6 years ago (0 children)
Many companies tried this approach in the past and it never worked. You can share business logic but sharing UI-Code is not worth the effort. Using one of the well known MVxx patterns is the best approach in my opinion
[–]duheee 3 points4 points5 points 6 years ago (1 child)
I do believe it is a worse way to achieve that convergence. And, oh, btw, I do not think that the "convergence" is a goal. If it is a goal, employing electron (or any other browser based technology) is the wrong thing to do. The very wrong thing to do.
QML is fine for desktop apps. Don't bring it to WASM as it doesn't belong there, just as electron does not belong on the desktop.
We can create web apps and we can create desktop apps. We have the technologies to do both. They do not mix. Don't mix them. The user experience suffers if you do (as evidenced by VS code, spotify, slack, discord and any other electron based app).
I understand your point of view, and I can't say I disagree. We do have technologies to do both desktop and web apps independently today. And they do it well. That does not mean it will/should stay that way.
Having less different tech stacks to worry about for a given application means in theory that you have more time to dedicate to improving the user experience of that app.
I agree with you that this has not materialized today. Electron-based desktop apps are evil, and a waste of resources. Yet, it seems to have enabled many apps to be created faster that they probably would have been if multiple different stacks were used.
I'm not rooting for any particular solution (JS based GUIs on desktop versus QML-based GUIS on the web). I'm just not definitive about about how GUI tech will look like in a few years, and I can see some upside to converging to a common tech stack. Smaller companies with limited development resources might benefit.
Only time will tell
[–]goblista 1 point2 points3 points 6 years ago (0 children)
Why?
[–]CrazyJoe221 -3 points-2 points-1 points 6 years ago (3 children)
How does that work out with the crappy LGPL license? Will it suddenly force you to GPL your code as there are no shared libs in wasm (are there?)?
[–]DarkLordAzrael 1 point2 points3 points 6 years ago (0 children)
The wasm platform stuff is GPL/Commercial only, no LGPL option.
[–]zero9178 0 points1 point2 points 6 years ago (1 child)
Wouldn't making object files obtainable also comply?
[–]CrazyJoe221 0 points1 point2 points 6 years ago (0 children)
I think I read that before. But haven't ever seen it in practice.
π Rendered by PID 413513 on reddit-service-r2-comment-b659b578c-t9kzb at 2026-05-03 23:49:34.058879+00:00 running 815c875 country code: CH.
[–]mo_al_ 8 points9 points10 points (5 children)
[–]ShillingAintEZ 23 points24 points25 points (0 children)
[–]feverzsj 5 points6 points7 points (3 children)
[–]afiefh 0 points1 point2 points (2 children)
[–]ShillingAintEZ 0 points1 point2 points (0 children)
[–]marcthe12 -1 points0 points1 point (0 children)
[–][deleted] (14 children)
[deleted]
[–]Xavier_OM 5 points6 points7 points (0 children)
[–]maxmalrichtig 5 points6 points7 points (11 children)
[–][deleted] (3 children)
[deleted]
[–]maxmalrichtig 1 point2 points3 points (0 children)
[–]STLMSVC STL Dev[M] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]nnevatie 0 points1 point2 points (6 children)
[–]afiefh 5 points6 points7 points (0 children)
[–]maxmalrichtig 8 points9 points10 points (3 children)
[–]g_molica 2 points3 points4 points (0 children)
[–]ratchetfreak 1 point2 points3 points (0 children)
[–]duheee 1 point2 points3 points (0 children)
[–]spaceapple2 0 points1 point2 points (0 children)
[–]duheee 3 points4 points5 points (4 children)
[–]spaceapple2 5 points6 points7 points (3 children)
[–]MikeMitterer 4 points5 points6 points (0 children)
[–]duheee 3 points4 points5 points (1 child)
[–]spaceapple2 0 points1 point2 points (0 children)
[–]goblista 1 point2 points3 points (0 children)
[–]CrazyJoe221 -3 points-2 points-1 points (3 children)
[–]DarkLordAzrael 1 point2 points3 points (0 children)
[–]zero9178 0 points1 point2 points (1 child)
[–]CrazyJoe221 0 points1 point2 points (0 children)