8 ms·
If people want to use WebAssembly to write non-browser applications, then it needs some non-browser API to replace the user interaction capabilities a browser's
by jarfil 7y ago
If people want to use WebAssembly to write non-browser applications, then it needs some non-browser API to replace the user interaction capabilities a browser's API would usually provide.
- TekMol 7y agoWhat is the benefit of replacing the browser though?
- the_mitsuhiko 7y agoThere is no browser to replace. Many of us are trying to look into WASM for loadable modules or entire binaries.
- pjmlp 7y agoI thought I already could do that since the late 80's.
- TomMarius 7y agoI tried and ran into many (well known, at this point) problems. WASM solves them.
- wffurr 7y agoWith what? lisp? Java? MSIL? https://hacks.mozilla.org/2019/11/announcing-the-bytecode-al.. https://hacks.mozilla.org/2019/11/announcing-the-bytecode-al.... "secure-by-default foundations for native development that are portable and scalable."
- pjmlp 7y agoYou can compile Hearbleed to WASM, secure by default, as long C or any of its derived languages are not used.
- wffurr 7y agoSure, you can build a flimsy deathtrap house on top of a solid foundation in a lot of contexts. But if the foundation is unsound, it doesn't matter if your Ada is formally verified or not.
- pjmlp 7y agoAt least the Ada folks acknowledge that the language isn't perfect, and don't pretend they were the very first one on its field.
- wffurr 7y agoI don't see anyone pretending any such thing about WebAssembly or WASI. If anything they are drawing on the decades of experience with bytecode formats and security research.
- pjmlp 7y agoApparently not, otherwise bounds checking inside of the same linear memory segment would actually be supported. Likewise, they wouldn't "forget" the formats that already had support for languages like C when talking about what is "new" with WebAssembly.
- imtringued 7y agoI'm not sure I understand what you're saying. There are two core principles behind WebAssembly. First of all you can run low level programming languages like C on any architecture. This is possible if the code is available and you are willing to compile the C code before installing the application (see gentoo). Secondly the libraries/APIs that the program depends on must be available. What you're saying is that every vendor shipped their software with source code and only used cross platform APIs. Is that right?
- gdxhyrd 7y agoEh, no. Vendors everywhere will package things for your architecture and give you binaries. That is how it has always been done and is still done. Yes, you can do it differently with an IL, but that isn't new either (Java, .NET, etc.).
- pjmlp 7y ago> First of all you can run low level programming languages like C on any architecture Just like with TIMI, MSIL, EM, ADF, TendDRA, PNaCL among others. > What you're saying is that every vendor shipped their software with source code and only used cross platform APIs. Is that right? Rather that this is nothing new, and the formats listed above, already offered the same capabilities, without the same marketing.
- the_mitsuhiko 7y agoI don’t see how asmjs/wasm’s marketing would be much different to the one of pnacl/nacl. It’s just fundamentally better and that’s why people are excited.
- pjmlp 7y agoSo much better that PNaCL still outperforms WASM. https://www.pdftron.com/blog/wasm/wasm-vs-pnacl/ https://www.pdftron.com/blog/wasm/wasm-vs-pnacl/ And it doesn't offer any significant security improvements, in spite of its marketing, compiling Heartbleed into WASM is still possible.
- jarfil 7y agoThe same as from using Electron, but a step further: less overhead from unneeded browser features, ability to lock the user into a kiosk/fullscreen mode, while most of the code is still reusable.
- aurosul 7y agoYou mean like standard desktop application we had until the browser took over?
- TomMarius 7y agoThere are significant differences between standard desktop applications, Electron applications, progressive web applications, isomorphic/universal applications and so on. Usually the business case decides. If you want people to make more standard desktop applications, you should figure out a way to make it work for the common Electron app business case. Or stop throwing baseless shit in their general direction just because they've chosen a technology that does not meet your purity requirements. I'm very sure everyone in the community agrees Electron is not ideal.
- The_rationalist 7y agoElectron is the least worst technology we have for building expressive 2D GUIs. Carlo and others are just an incremental improvement. Every other GUI libraries are order of magnitude inferiors except if you just want to look like windows default utilities.
- layoutIfNeeded 7y agoImagine if apps would blend in with the host OS! The horror!
- TomMarius 7y agoSorry but the founder wants his specific UI, I can't do anything about it, my job is to do it.
- TazeTSchnitzel 7y agoWhat's wrong with using a subset of the browser APIs? Or, alternatively, one of the many existing platform APIs?
- the_mitsuhiko 7y agoBrowser APIs are not C ABIs and the platform C ABIs are typically not cross platform and make for a bad target.
- The_rationalist 7y agoBrowser APIs have C++ ABIs that can be generated through webIDL if I recall well.
- gdxhyrd 7y agoPOSIX, SDL and the usual suspects are pretty much cross-platform and run everywhere.
- pjc50 7y agoI'm not sure why you'd choose webassembly over, say, MSIL for this?
- wffurr 7y agoThe goal for WASI is a secure-by-default capabilities model for access to system APIs. It's also an open collaborative cross-vendor specification with at least four different independent implementations. MSIL/CIL is similar in some ways, but it's still largely only supported by Microsoft and doesn't sandbox binaries the same way. It's an inspiration to We assembly, but not a feasible alternative to it. Similar to Google's PNaCl bytecode. Some more detail here: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas... https://hacks.mozilla.org/2019/11/announcing-the-bytecode-alliance/ https://hacks.mozilla.org/2019/11/announcing-the-bytecode-al... "secure-by-default foundations for native development that are portable and scalable."
- mwcampbell 7y agoFor user interaction that works for everyone, i.e. covering internationalization and accessibility, one could do much worse than to just use the existing web platform APIs, DOM and all. Why reinvent all that?