Botond Ballo wrote on 2018-07-18 09:45:
As we have some experience in the embedding space here at Mozilla, I
was wondering if anyone had feedback on this embedding library
proposal. This is an early-stage proposal, so high-level feedback on
the design and overall approach is likely to be welcome.
I'm afraid that I agree with the consensus in this thread: specifying a
web_view class isn't a useful activity for the C++ standards committee
to undertake.
The proposal notes that C++ specifies "no useful facilities" for
creating graphical interfaces, so "users either need to make use of
system-specific APIs, third-party libraries, or move to a different
programming language."
However, it doesn't explain why "system-specific APIs" and "third-party
libraries" are considered insufficient or harmful. As others have
pointed out, for languages with first-class modules and package
ecosystems, third-party libraries are a feature of a language, not a
bug. And "system-specific APIs" have their own advantages (along with
downsides).
The proposal also notes, "To be useful, we’ll need to require support
for a large number external standards (i.e., [X]HTML, CSS, SVG,
ECMAScript, and possibly others). Our three-year release cycle is likely
sufficient to maintain a proper list of such standards, but it’s still a
large list, and to be clear, the transitive closure of this list is huge."
At the very least, this statement is worthy of more careful
consideration, given the ongoing rapid change in the web platform
surface area (not to mention implementation strategies that affect
embedding APIs, such as the move to multiple content processes).
And it notes, "Surveying the current implementations has convinced me
that this kind of interface is appropriate for standardization, at least
in the sense that, while broadly useful, using these services from a C++
application today requires difficult-to-get-right platform-specific
code. Moving that burden to C++ library implementers, as a result, makes
sense."
The former statement may be true, but the latter doesn't necessarily
follow; and it isn't even clear that the former is true. The author
himself demonstrates a prototype implementation that supports multiple
platforms. And the Chromium Embedded Framework (CEF) has similarly long
provided a cross-platform API for embedding the web into C++ applications.
Don't such third-party libraries show that it *is* possible to use the
web in a C++ application without "difficult-to-get-right
platform-specific code"?
(It might be that developing such a cross-platform library is itself
challenging, but that's a burden on library vendors, not application
developers.)
Cross-platform graphical application development with C++ can be
challenging, and the web may be a solution in some cases. Indeed,
Mozilla itself has faced that challenge and used its own web
implementation to help solve it for desktop platforms. And others have
solved it via third-party libraries and system-specific APIs.
Nevertheless, while those implementations are imperfect, and there's
plenty of scope for improvement, a minimal standard that evolves more
slowly than the web and its implementations seems like it would do more
harm than good. And thus a web_view class isn't well-suited for
specification by the C++ standards committee.
-myk
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform