by ehnto · 8y ago · 0 comments
The obvious answer is that it makes applications portable, which is great. The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it. That is something native applications have never done, and not even something like JVM has done even though it addresses portability too.
It is also nice that it is seamless with the browsing experience, but I have to wonder if it hasn't just turned out that the typical browser interface is a better interface for computing than most popular OS have been? As the OS and browsers start to see parity, are there lessons from browsers that we can integrate into the OS?
For one example take WebGL. For decades OpenGL had been a native API prioritizing performance first and security last. It wasn't until browsers decided to expose OpenGL that the necessary work was done to make a graphics API safe for untrusted code. And who did that work? The browsers had to do most of it themselves.
Rob Pike wrote in the year 2000 that systems software research was irrelevant (http://herpolhode.com/rob/utah2000.pdf), and it seems to me that not much has changed since then. How many ideas from the last few decades of operating systems research have actually been put into practice?
The real problem is more fundamental: people want their software to keep working. As Rob Pike put it in the talk linked above, "to be a viable computer system, one must honor a huge list of large, and often changing, standards: TCP/IP, HTTP, HTML, XML, CORBA, Unicode, POSIX, NFS, SMB, MIME, POP, IMAP, X, ... With so much externally imposed structure, there’s little slop left for novelty."
For example, I'm sure some software out there is using the OpenGL API in a fundamentally insecure way. Changing the API to be safe would break this software. And maybe that would be a good tradeoff, if reworking OpenGL were the only thing you needed to do to safely run untrusted code. But almost every part of the system would have to change. You'd be left with a system which breaks or degrades pretty much everything you try to run on it.
I would say that the browser most certainly has the biggest attack surface of any software in regular use. Your average browser is insanely complex. In fact, it is the only piece of software on my computer that scares me.
Multiple JITs, font rendering, parsing, layouts, compression, image handling, sound and of course about a billion edge cases because somewhere along the road we decided that faulty code is OK. Everything with tonnes of state that interact in ways that can't ever be fully tested or verified (because of an almost infinite variety). Let's also not forget that a large part of that is done at the very bleeding edge of CS research. I wouldn't trust anyone to do that in a safe way.
To me, a kernel seems simple in comparison.
The whole native app is "untrusted" at the point of install. Even an app store offers a fairly thin guarantee about what apps are actually doing. It's far easier and less risky to open a web page and start doing something than install a native app.
Sandboxing of native apps are getting easier by the minute , at least for Linux. Flatpack and snappy aren't there yet,though...
The native apps I run on my Linux laptop, for example, I trust quite a bit. There may be a way for someone to sneak in some obfuscated code that does some harm, but I think the risks are much lower than many of the alternatives.
Sure, but in many modern browsers there's also a OS sandbox around it, so there's two layers of protection.
No browser has provided that either. In fact, browsers are by definition a security anti-feature because they are always connected to the network and the customer/user data lives on the network.
Even if they manage to solve the problem of computers getting hacked when visiting websites they are very unlikely to solve the problems of tracking and private data vacuuming.
How do you know? Basically every browser has a RCE vulnerability a month and has for 20 years. From ancient JPEG vulnerabilities to modern video codecs and DOM manipulation vulnerabilities.
[0] https://www.cvedetails.com/vulnerability-list.php?vendor_id=...
There are a gazillion others, but this one is nice and sweet and exposes the whole web app strategy as completely bankrupt from a security perspective.
But paid software in the 90s and 2000s was fine, no network connectivity, didn't even check for updates. Heck, a lot of freeware was fine.
Then the market changed and spyware as a service became very profitable. The genius of this Spyware 2.0 was that it offered some benefits while not abusing the collected data in any obvious ways, like stealing your money. Browsers are helpless against this, in fact they are enabling the whole business model through their support of web apps and increasingly complex APIs.
Just plain pretty TTYs.
The JVM more-or-less managed it. Modern hypervisors do it - you could use something like Qubes and run completely untrusted code in its own isolated VM. It's not that academics weren't working on this stuff, adoption is where it fell down.
And on top of all that, it would still be more memory intensive than an equivalent native win32 application. Developers usually only shipped java-based UIs to Enterprise Software users who had no choice but to use what their bosses told them to use.
Those not designed for security were like that. Those designed for security had few of those problems. They just weren't popular with the big ecosystems and such since the demand side didn't care about security much. Very little security bolted onto something that was opposite at core. Common solutions were memory-safety for apps with validation on API calls, limiting of API's accessible, mandatory access control, and/or VM's isolating whole systems from apps needing protection.
OS's and browsers are not only becoming similar in functionality: they're similar in why people adopted them and why they're insecure.
"Saying browsers are "the largest attack surface" is an indication of ubiquity, not an indictment of the design or implementation of browsers"
It's actually saying both since browsers were mostly not designed for strong security or apply security engineering techniques of the time. That would be POLA, privilege separation, memory-safe languages, high-quality code in any components integrated, and so on. The first I saw attempt it was Chrome's Native Client imitating some benefits of OP Web Browser [that was designed for security] but weakening them for performance. Latter was Chrome's highest priority IIRC. There's Quantum moving memory-safe code into Firefox. However, browsers are mostly insecure architecture and code that just gets patched as problems are found. And they're ubiquitous. Music to malware authors' ears. :)
I'm including examples below of security-focused, browser architectures applying various methods of security at design and/or implementation stage so you have a mental point of comparison to current ones in terms of techniques employed. They were released as prototypes with nobody putting any effort in past that. So, high-assurance sector just isolated regular browsers in protection domains (eg VM's) on separation kernels or using MAC if browsers had to be there. Otherwise, native apps in memory-safe languages with regular old client-server architecture were much easier to make reliable and secure. Especially if using middleware designed to help with that. That's still true.
DarpaBrowser http://www.combex.com/papers/darpa-review/security-review.pd...
OP and OP2 Browsers https://pdfs.semanticscholar.org/832a/911f97b500cd2df4680186...
Microsoft Gazelle https://www.microsoft.com/en-us/research/publication/the-mul...
Illinois Browser Operating System https://www.usenix.org/legacy/event/osdi10/tech/full_papers/...
Quark Browser http://goto.ucsd.edu/quark/
- Sandboxed, web apps can't wander around in your filesystem, and you can even prevent them from knowing anything about you (private mode). That's good for privacy and security.
- You bypass the apple/google store, their paytoll, capricious criteria and how they promote apps
And I think asm apps (not websites) will have a great success when asm has become a full VM not just because of these reasons, but also because it will make it possible to develop cross-platform in a language that isn't javascript. Some people love javascript, I personally hate it. C++ devs will be able to develop in C++, I expect C# and Java dev to be able to write their apps in C# or Java, and I am sure even more languages will join the party. That's a great thing.
I always say that this situation is a bad solution to a bad problem. Had Apple, Microsoft and the FOSS world agreed on some standards, native code could be portable and the norm.
It's interesting to notice these things repeating themselves, I bet at some point maybe the OS and the computer merge more and we will have again more systems like we did when the Internet became to rise.
Disclaimer: I don't have an android phone anymore and I have no idea how available/useful these actually are
Actually, this used to be common, and still is for things like game consoles. You used to stick the floppy disk in, and run the program directly from there. No concept of installing anything. Indeed your computer may not have even had writable storage to "install" anything onto. At worst, if you did have a hard drive, you were free to copy the (single) executable onto your drive so you didn't need to rummage through your stack of floppies to find the program every time you wanted to run it. That was the extent of installing something.
The situation where your program consists of multiple files, each of which had to be copied into some special location on your hard drive by an "installer"--is a relatively new (since the 90s?) concept.
It's actually refreshing nowadays when I stumble upon one of those rare applications where everything comes in a single executable file and it can be run from anywhere. Dying breed.
Native apps struggle with this.
Things that are easy to monetize tend to attract more effort than things that are possibly impossible to monetize, or have very limited monetization options.
I'd be aware of promoting anything that takes control away from the user. The web is fine for sharing knowledge and communication (and pictures of cats) but let's not put everything in it or we'll certainly regret for giving away the power to control our software.
Besides the experience the original GP post was talking about and the message i replied to didn't really leave any room for not making such an assumption since they were all about comparing web apps to native apps: " I have been thinking about why we have ended up here, and why not just native apps."
And finally, i do not see WASM being of giving any more control to the user than existing web tech - after all it relies on the rest of the webpage to work, much like JavaScript (actually, it does require JavaScript to act as a mediator - at least for the time being) and considering how you cannot download Google Docs as a native offline application to use on your desktop, despite being able to save locally the JavaScript it downloads on your browser, i fully expect to be the same situation with WASM too.
2. It's not $750, there are multiple editions available, the more expensive ones include more plugins, instruments, loops, etc.
3. Cloud-based startups are nice until they reach the end of their wonderful journey, sell out and you're out of a tool.
Soundtrap is charging $15 because that's what it's worth. Although if the cloud is mandatory it's worth zero in my opinion.
For example any instrument costs much more than that, and the same time could have gone into developing the software and building the instrument. Or heck, any handbag or fashion item can cost a ton of money, and people are ready to buy them, but when software actually costs something close to real value produced by that software, people get pissed these days.
I blame the iOS/Android markets that have created a biased and untruthful image for the costs of developing software. You can't expect to make a living from developing software that costs 1.99/2.99/9.99 unless you sell a ton of those, and most never do, but this market has effectively changed the mindset for normal consumers to get things either free or for a price of three cups of coffee.
In my opinion its because operating-system design wasn't sexy after browser-companies came and ate the OS-guys lunches with all that big bubble fuss. So the OS guys went all apathetic and forgot that a majority of their OS is a freakin' browser, and .. here we are. Inception.
Its great we can compile C++ to 'native' assemblies now. We've always been able to do this, btw. The only difference is the delivery mechanism ..
Not counting applets and Web Start?
> not even something like JVM has done successfully.
That's an understatement. Anybody trying to write a multiplatform complex desktop application around 2000 would have learnt that it was way much harder that it sounds today. Browsers were in a very reduced group of success cases.
Edit: also dont forget that there was a war about what tools and languages would become dominant. Unlike alternatives, most web tools were free.
Windows 10 is working on adding tab navigation to all windows: https://arstechnica.com/gadgets/2017/11/tabs-come-to-every-w...
Though I wonder why Firefox OS has failed this hard. I never looked more into it, but isn't it a platform centered around having web apps as native apps? I think some day every OS will be similar, so was it ahead of time?
The other key component I think is delivery. You don't ever install anything, it just exists when you ask for it.
That is precisely why I made the jump from Delphi to ASP.NET back in 2003, and now the jump to Angular2+.Relevant XKCD:
"Installing" https://xkcd.com/1367/
That's what Java was supposed to be.
It's probably that simple.
If you have a thing and you need users, are you really going to deliver it as a Qt app? Unless you're bitcoin, it's hard to think of a case. I'd say "or a game," but many are webapps. And at this point some of the hollywood-grade games might figure out a way to be coming to browsers soon. Unreal did it.
Unity already supports the web, but I don't think that'll matter for AAA games. People who buy computers specifically to play them will care about the slight performance hit and not want to keep the games they bought and spend a lot of time with as bookmarks to web pages. Non-performance intensive tools, even large ones, have already moved to the web. This will likely continue because there is not other platform delivering its level of portability and ease of delivery.
It's a bummer because the web just kind of sucks. It was made for documents, damn it. Something like a java browser could've succeeded as jars are already very portable. This could've worked pretty well for small and large tools alike. But since the HTML stack is already widely adopted I guess we'll have to make the pain go away somehow. At least webassembly solves the problem computationally intensive tasks. The UI component is still quite a mess, but that's getting better too. I just find it annoying that they have to call everything Web-(what it traditionally was). It's basically the new reality, being used on non-web platforms as well as on the web.
That is the same hitch the JVM had. For a non-technical user, that extra step feels risky and unintuitive. "Why doesn't it just work?" feels a bit unfair when you know what's going on, but to a normal user I think it's a fair question. We are the professionals after all, why can't we make it "just work"?
"But what if –"
Oh come on, we can figure it out. There must be some way.
Also UDP. Yeah, we have WebRTC, but look up Beej's guide to network programming. That's the threshold of intelligence required. Currently to get WebRTC working with UDP for gamedev purposes, it's just... Not easy. Maybe not even possible. I don't know.
We need UDP and we need an install manager. And a few other things. Start thinking about how to extend the browser so we can deliver world-class experiences to gamers.
You can now build html/js that uses webgl directly: https://docs.unity3d.com/Manual/webgl.html
The plugin has been deprecated for quite a while now. Unity compiles to WebGL/Javascript.
Indeed it is but there seem to be no relevant alternative. The only thing that is better [for apps] is XAML (WPF) but it is Windows-only.
JavaFX also follows the same design ideas.
And there is QML as well.
Maybe this will change in the upcoming years though also, I have a feeling the client/server bridge will be getting closer and closer as we reach more performant ways of loading code from the servers but executing natively on the client/computer/handheld/phone whatever.
Also, WebGL compatibility is still far away from really doing any production apps (I mean, to reach a state where you can guarantee your app to work on at least most computers people have). Many platforms/GPUs/driver combinations just point out blank refuse to work, or the browser has blacklisted problematic combinations, as these can in reality cause crashing of the whole OS and computer, this has happened to me many times while developing WebGL applications.
Some of which don't have any issue running OpenGL ES 3.x games.
Not yet, the though I think this will be true eventually