Embrace Modern Technology: Using HTML 5 for GUI in C++ - Borislav Stanimirov - CppCon 2019

preview_player
Показать описание



HTML 5 is likely the most widely used development stack in history. Because of this, there is an abundance of development tools and resources, and, more importantly, experts. HTML 5 is all about multimedia presentation. It's designed to allow any look and feel with ease. Modern browsers are among the most sophisticated pieces of software ever produced. It's hard to compete with what they achieve in terms of performance, security and stability.

HTML 5 is for web pages...

... or is it?

This talk introduces using HTML 5 as a graphical user interface framework for C++ native applications. In it we will explore several approaches and discuss their pros and cons. We will present several examples and demos which can help you start working on your own HTML 5 GUI right away.

Borislav Stanimirov
ViewRay
Software Engineer
Bulgaria

Borislav has been a C++ programmer for 15 years. In the past 11 he has been programming video games. He has worked on C++ software for all kinds of platforms: desktops, mobile devices, servers, and embedded. His main interests are software architecture and design, and programming languages.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

was this presented to a remote audience? the jokes should have got more laughs.

multiHappyHacker
Автор

Great talk and interesting ideas! BTW the idea of using HTML/CSS/JavaScript for GUI in C++ desktop apps was implemented in Molybden SDK I have been working on.

Epic Games launcher, Steam Client, Razer Sypanse, GeForce Experience, GTAV online store, and many more proved that combining both worlds (web technologies for the modern and beautiful app UI and the power of C++ with close integration with operating system) can let developers create great desktop apps users love.

Ikryanov
Автор

I'm currently using CEF inside a project and the major drawback of this method is libcef is 1 Gb, your application is 300 Mb (disk and RAM) uses 4 forks just for painting a button.

quentinquadrat
Автор

To make it really useful you would need a cut down browser engine a normal browser has way too many features that are not needed when you control the content being loaded. All you need are the HTML, CSS, JS, renderer/interpreter and DOM. Adblock, DNS, Bookmarking and even security is not as important. You could never run a full webkit browser on a small MCU and that is where this stuff is the most interesting because on a system with a browser you also have other GUI options such as QT and TK etc. The maker community has many young users for whom the Web stack is a lot easier to learn than C++ and their hardware can not run QT and other GUI libraries.

excitedbox
Автор

This is something I've wanted to do from the start. I know enough of all these (HTML, CSS, and C++) to make something interesting, but until we can build the bridge, to allow for this capability, we're stuck where we've been for the last decade, in toolchain, framework, ide/editor and cross-platform "HELL", with our software dreams reliant not on what we would like, but on what we can get to work. Whatever solution you come up with doesn't have to be simple, but it has to be portable with C++, and straightforward with reliable documentation that's easy to understand and implement, regardless of Microsoft, so that we're not forced to use Visual Studios, or some overly complicated combination of libraries and frameworks that have to be precompiled.

There's also a need for in-depth help with examples, and contextual help, so that you don't have to go chasing all over the internet for 4 to 10 year old search results, or having to remember a username or password to log into some website you hardly visit, just for a quick solution.

...otherwise, it's just MORE of what we've been getting!

We're not asking for a "skynet" IDE that makes everything easy, while hogging up valuable system resources in the process, lest we lose the true spirit of "C++ programming", and how to compile and link libraries from the command prompt. TODAY, there's no such thing as "Standard C/C++", as if you haven't noticed there are over 20+ standards that leave you scratching your head, wondering what's changed, what's new, and no longer supported, and that's before we even get to compiler prejudice!

haroldmcbroom
Автор

IMHO, modern browsers are heavy, memory hungry and rather slow at the same time. Qt is much better answer: crossplatform, resource efficient, simpler for making gui interfaces. And there is QML if some wants simpler solution, it still faster than html5, more gui oriented and js may be used for gui and even business logic stuff. HTML was developed for documents and making app logic is in fact struggle against its purpose.

wdnick
Автор

This is cool, and definitely an interesting solution to the problem, but as others have said it is *far* from effectively using modern technology. It's these sorts of solutions which are why it so much modern software gobbles up way more memory that otherwise equivalent older software: unnecessary additional layers of libraries and interpreters and VMs.

That being said, they definitely can speed up development times immensely, especially for less experienced programmers wanting to do more complex things. I guess the problem only comes when the crutch keeps getting used past the point where it should. For example, it's fine to use MIcrosoft Word to do research/engineering papers, but it's a problem if it's a reason not to learn LaTeX instead of what you use while learning LaTeX.

Julietmindset
Автор

Haha personally I was looking for this topic only to know if it was posible to embed HTML/CSS into C++ code. CSS is my key for any GUI, as there is already a crazy ton of resources out there. I've been very curious about this topic since I got to try KaiOS, where everything is a webapp yet it still manages to run smoothly somehow.

MthaMenMon
Автор

Html5 for gui for c++ I'm shocked intrigued and a bit discusted but interested (especially that I more or less know both html css and c++)

crusaderanimation
Автор

Please don't. I'm so infinitely fed up with non-native UIs for desktop applications.

Spiderboydk
Автор

IMHO this will most prolly end up messed though.
Good & Intriguing talk though 👍

kg
Автор

Can script make immersion in boot sector? Manage memory…

__hannibaalbarca__
Автор

20:20, reinterpret_cast was too much. Why not a static 1?

MrAbrazildo
Автор

So bookmarking single pages in SPAs is done how...?

fredoscott
Автор

Great talk, very interesting stuff; I wasn't aware of these websockets, that really makes dynamic web pages alot easier to write without your project have to generate html and be the http server

maasteeve
Автор

Great talk! I’m especially intrigued with the CEF demos. RmlUi bringing customised HTML/CSS into C++ UI land is also a cool find, though I’d think that bringing C++ into the web (approach 4) would be the more ubiquitous solution. Hopefully it’s limited API access to resources will patched up in the years to come.

As a web dev guy, thought I pointed these out:

- Webpack is not a package manager; it’s a module bundler for JavaScript libraries.
- HTML/CSS are not programming languages; the more accurate term is that they are markup languages that express structure and styling.
- React is a UI library not a framework.

LeeZhenYong
Автор

Por lo que se, la misión SpaceX usa esta tencología: C++ y HMTL.
Estamos hablando de tecnología que permite que un cohete llegue a su destino con humanos dentro. Me parece muy interesante.

As far as I know, the SpaceX mission uses this technology: C ++ and HMTL.
We are talking about technology that allows a rocket to reach its destination with humans inside. I find it very interesting.

mexxiano