WGPU and Dawn (WebGpu) - webgpu

I am trying to understand the general concept of wgpu and Dawn.
As I understand it, there are two main implementations of the WebGPU standard from Khronos: wgpu from Mozilla and Dawn from Google.
Do I understand correctly that:
-wgpu: is it a C/Rust library that can be compiled from into an executable file of the Operating System and into WebAssembly code for the browser ?
-Dawn: Can only create Web Assembly code for the browser.
And I also wanted to ask: can wgpu create WebAssembly code, does wgpu convert only its API code or C/C++ code too? I can't figure it out.

Basically, wgpu and dawn are the WebGPU spec implementations for Firefox and Chrome browsers respectively.
Currently, dawn is the most advanced implementation of the WebGPU spec, and will officially support WebGPU 1.0 in Chrome around May 2023.
A wgpu-based project compiled as a wasm target will be able to run on all WebGPU-enabled browsers.
More than that, the wgpu APIs is based on the WebGPU spec, but it can runs natively on Vulkan, Metal, Dx12, Dx11, and OpenGLES, and also provides additional features support for native applications.
For example, wgpu-in-app demonstrates how easy it is to integrate wgpu into iOS and/or Android app

Related

How can I easily develop an app such that it will run on every major OS?

Everything that I have coded upto this point has been launched from Command Prompt or the IDE itself. I would like the ability to deploy an application such that launching it doesn't require a tutorial for novices. .exe, .apk, .app, ELF. Double-click and go.
I recall creating .exe files from Python as being restrictivly difficult. I was thinking C# and found .net/maui. It doesn't support linux, which I could maybe look past, but it also doesn't appear to support creating .exe files.
Java is more low level than I would like to deal with. Learning a new language that runs virtually could be the solution. I havn't done much investigating as this wouldn't be the ideal. (Edit: JVM requires an additional install, so that's not going to work.)
I don't have any experience with web developement, but it seems like a promising route none the less. It is not clear to me if I can create a local icon-launchable webpage that will run an application in your browser sans-server. Additionally, I am not sure how far my known languages will take me before I have to then learn CSS or whatever.
Thoughts?
Electron seems to be popular choice for cross-platform development in case you don't mind developing with JavaScript.
QT is another cross-platform framework that was around for a long time.
Specifically for .NET, there's MAUI (mobile-focused, no Linux), Avalonia UI, Eto Forms, AlterNET UI. The last one is desktop-only and still in beta.

a comparison in cross browser plugin's frameworks

I have found that there are plenty of frameworks for browser plugins.
my first question:
which one of the following frameworks specified for plugins and which one is not specified for plugins:
FireBreath, OpenForge, Kango, BabelExt, Nixysa project, JUCE project, QtBrowserPlugin project .
my second question:
Is there another popular plugin's framework other than those mentioned?
my third question:
What is the main differences of these popular plugin's frameworks?
Indeed is there any comparison of these frameworks, the comparison could be in each of following terms:
usability (for a page as a NPAPI plug-in or for a browser as an
add-on extension),
simplicity (in developing),
speed (on execution),
extensibility (of developed add-on),
availability (in Windows 86x and 64x, Unix, Linux, mac and other
platforms and also mobile platforms specifically android, ios, ...),
flexibility (for new technologies),
reliability (in terms of security),
accessibility (open source or not),
portability (in Fire-fox, chrome, IE, Safari, Opera, ...),
applicability (in drawing, communicating, calling from external
server, threading, network accessing, etcetera),
stability (in changing the policies, for example in deprecating
NPAPI)
Also I have read Cross-Browser Extensions API? which I think it is about extension's framework (not plugin's framework)
I'll be honest -- this seems like something you should be able to answer with some google searching. I appreciate that you're at least trying to apply suggestions on how to better ask questions, though, so I'll respond on the few that I know something about.
FireBreath is a C++ framework for creating browser plugins, not extensions. It works as an NPAPI plugin for browsers supporting NPAPI plugins (previously this was all but IE, but Chrome dropped support for them this year and Firefox plans to at the end of 2016) or as an ActiveX control, giving it equivalent functionality to a browser plugin in Internet Explorer. FireBreath 2, which is working but poorly documented so far, changes the APIs from being synchronous between the browser and plugin to being asynchronous and adds an emulation layer to let them work with Google Chrome using Native Messaging. It's the most complete and up to date of the plugin frameworks, as far as I am aware. I am its primary author, so feel free to get your own confirmation of that.
Nixysa is a tool that takes definition files and outputs code for a NPAPI plugin. I haven't used it, so I can't tell you exactly what it's capabilities are. It hasn't been updated since 2012, when PPAPI support was added; this is unlikely to be useful, though, since PPAPI has changed significantly since then, and also since the only PPAPI plugins that can run without special command-line flags to chrome are ones specially blessed by the Chrome team.
JUCE is a GPL library with a commercial licence available which has some support for creating browser plugins. I have no idea as to how powerful it is these days; it seemed well written when I last looked at it, and takes a much more minimalistic approach than FireBreath does; FireBreath gives you a framework and tries to make everything Just Work, whereas JUCE seems (I could be wrong) to be more of a "provide the building blocks, but don't try to make everything look the same" type of thing.
QtBrowserPlugin is a defunct unmaintained project which at one time allowed creating browser plugins (probably just npapi, but not certain) with QT. Indications are that it probably doesn't work anymore.
I have no idea what the other projects are. If I were you, I'd try doing some research. Google is your friend.

What is the technical difference between a browser extension and a plugin?

From a user's perspective, an extension seems to be something that you go to the Chrome Web Store to get to extend the browser's functionality, whereas a plugin is something that you have to go to an external third party's website to get to extend the browser's functionality.
From a technical or implementation perspective, what is the difference between the two? I saw a similar question here (Is phplivex a extension or plugin?) but didn't get the answer I was looking for.
I am after the difference in the way an extension or plugin is developed and deployed (if any), and if there is any overlap between the two.
The words "extension" and "plugin" have lots of different (but related) meanings accross software products. These words are used interchangeably by many users (and developers). In browser extensions, they have a precise meaning, which is also visible through the UI. E.g. extensions (and apps) can be managed at chrome://extensions/, while plugins can be managed at chrome://plugins/ in Google Chrome.
In Chrome, Firefox, Opera and Safari, browser extensions refer to pieces of software that augment the browser using the browser extension APIs (see extension docs for Chrome, Firefox, Opera, Safari). Most of the modern browsers require extensions to be written using JavaScript. Extensions are usually platform-independent and run within a limited environment (Firefox is a notable exception to the latter). Extensions are usually deployed as a bunch of JavaScript files, other assets (HTML, CSS, media, ...) and configuration bundled in a browser-specific archive. Browser usually offer a seamless way to install the extension directly in the browser.
Plugins refer to NPAPI plugins, which are pre-compiled binaries that enhance the functionality of browsers via NPAPI. These plugins are invoked by inserting an <embed> or <object> tag in the document with a specific MIME-type. NPAPI plugins are OS-specific (though the source code can be platform independent) but not specific to a single browser. The capabilities of NPAPI are not constrained by the browser, so a bug in a browser plugin often have huge security implications (think of Java, Adobe Flash Player, Adobe PDF Reader). This is one of the reasons why NPAPI support is in the process of being completely dropped from Chrome. NPAPI plugins are usually installed outside the browser, e.g. via MSI installers on Windows.
As said in the introduction, "plugins" and "extensions" are used interchangeably. If you hear anyone talking about "(browser) plugins", odds are that they actually mean browser extensions.

CSS parsing libraries for iPhone

I'm looking for some static library or open source project (in obj-c, released under some permissive license) to parse CSS in iPhone. Any recommendations?
OK, I found good library for parsing CSS - libCSS from the NetSurf web browser project. Released under MIT license, can be used without problems for commercial iPhone applications distributed via the AppStore.
It requires some code for the programmer to write (e.g. you need to provide your own DOM hierarchy handlers), and there are no examples available... but people from the NetSurf dev mailing lists are very helpful. In case of problems you can search the list for my questions.
libCSS
NetSurf dev mailing list
I would recommend htmlcxx. It's pretty actively maintained, written in C++ and you can use it to parse HTML and CSS.
Of course, since it's written in C++, you can use it in your iPhone application with no problems at all.
I've taken this project and made it easy to add to your iOS or OSX projects. Clone my github project and add the html (and or css) folder to your project. There is an Xcode project too - so you can build and run the simple test provided by the original authors

How can I make my application support plugins?

I'm work in an aplication that need be capable of support plugins, but i dont know how this work.
See Design Pattern for implementing plugins in your application?
The answers tend to get very platform specific. It also depends on how much control of your core app data and logic the plugin must have.
The C++ QT4 book has a good description of adding a file-type plugin to it's architecture, there area also a bunch of modeling apps (openscenegraph, blender, povray ) that have good documentation for their plugin architectures.
You need to design your application's API in such a way that plugins can be created, and you need to add the necessary plugin management interfaces and supporting code to invoke the plugins. There is no catch-all way of managing plugins.
Take a look at the open source application called Rawr (c#). Each addin is a seperate .dll and the main app uses reflection to access the code. Very nicely done.
www.codeplex.com/Rawr