News for hackers. Stuff that matters.
Re:Doom 3 in WebAssembly by Klathmon on Thursday January 03, 2019 @03:52PM (#18819169)
I absolutely disagree.

The browser is the solution to the presentation/distribution problem. I don't need to worry about installing the game, or worry about what OS I'm on or where it was installed to or anything else.

I go to the URL, and the game downloads if needed, then plays. Updates, local caching and storage, and more is all taken care of. If I want to play with a friend on some multi-player game, I send them the link, and they go to it and start playing themselves.

no "launchers" needed, no app stores which take a cut, no platforms which can decide that the game isn't suitable for their system, no app stores which can decide that the app is too close to something they offer and removing it, no expensive publishing costs, and you have multiple browsers to choose from if you don't like any one in particular.

Re:Doom 3 in WebAssembly by krapp on Thursday January 03, 2019 @04:20PM (#18819390)
> I don't need to worry about installing the game, or worry about what OS I'm on or where it was installed to or anything else.

Most people don't worry about that in any case. If I'm on Windows, I download the Windows version of whatever, and the installer does whatever. In a browser, you're just "installing" software to the cache. It's the same thing in a different wrapper.

>I go to the URL, and the game downloads if needed, then plays. Updates, local caching and storage, and more is all taken care of. If I want to play with a friend on some multi-player game, I send them the link, and they go to it and start playing themselves.

This is a good argument for HTTP as a distribution system, but you don't need a web browser for any of that.

>no "launchers" needed, no app stores which take a cut, no platforms which can decide that the game isn't suitable for their system, no app stores which can decide that the app is too close to something they offer and removing it, no expensive publishing costs, and you have multiple browsers to choose from if you don't like any one in particular.

Except the browser is the "launcher" and the site you download from being an "app store" for all intents and purposes, entirely capable of curating or charging money.

Re:Doom 3 in WebAssembly by Klathmon on Thursday January 03, 2019 @04:40PM (#18819559)
>Most people don't worry about that in any case. If I'm on Windows, I download the Windows version of whatever, and the installer does whatever. In a browser, you're just "installing" software to the cache. It's the same thing in a different wrapper.

I agree, except for the magnitude difference in time required in most cases.

A web-app that takes more than 10 seconds to load is consitered broken to many. A desktop app that can go from "discovery" to "using" in less than a minute is consitered fantastic. Plus then there are update headaches.

I genuinely believe one of the major reasons why the web is taking over is because every other platform makes the process of "installing" code such a difficult slow process.

Not to mention the security issues with giving code access to desktop systems which traditionally are difficult for the average user to secure. And the fact that I don't ever think i've had a piece of installed software ever completely "uninstall" itself correctly. They always leave stuff behind. In a browser, a single "clear browsing data for this domain" gets rid of all of it, entirely.

>This is a good argument for HTTP as a distribution system, but you don't need a web browser for any of that.

But you do. Some platforms (like iOS) don't allow distribution over any methods other than their app store, or a browser. Still more heavily discourage distribution over HTTP (most linux distros). And most users will download the "installer" for a game via a browser in the extreme vast majority of cases, so why not cut out the middleman and just allow the game to be playable in a browser?

There are also other benefits of a web-platform game, like the ability to "deeplink" inside the app. I can not only share a link to the game, but can easily share a link to a specific screen in the game, or can share a link to allow you to connect to my game. And that whole process is crawl-able for search engines, and easy to implement. Sure, it's possible to do with desktop software, but it's much harder in most cases, especially when you throw cross-platform into the mix.

>...the site you download from being an "app store" for all intents and purposes, entirely capable of curating or charging money.

While of course a specific site can act as a gatekeeper, that's not what I was talking about. Time and time again we see stories about how Apple removed some app from the app store, or some company pulls their subscriptions from being allowed to sign-up on iOS devices, or how some game makes their own app-store to get around the limitations on android, or even how most "app stores" don't allow adult content.

That is the kind of stuff that the web-as-a-platform gets you away from. You aren't going to have Google removing your app because it's too adult, or Apple charging you a 30% fee for all subscriptions made on their platform.

I'm all for streamlining this process to allow users like yourself that want a "local install" to get it, but I don't think we should throw the baby out with the bathwater here. Browsers give us a shitload of benefits, and the discovery and "install" process (or the lack of) is second to none. I think we can work with those benefits, and give users and developers the options needed for other formats if they want.

For example, The microsoft store has started allowing PWAs to be listed, browsers could work with the OS and define some APIs that allow you to choose where to "install" a PWA or web game, possibly even allowing you to simply move it or uninstall it after the automatic "install" happens.

We are finally getting away from the days where it would take tens of minutes to download and install software on a computer, where it would require you to give a considerable amount of trust to that software once you run it, and making it really hard to share content within apps with others. I don't see why you would want to go back.

But now that I said all of that, I realized that I don't really know why someone would want to not have it. So I guess my question is why do you want a traditionally "installable" code? Is there something I'm missing here, or some assumption that one of us is making that is getting rolled in with this conversation?

Re:Doom 3 in WebAssembly by krapp on Thursday January 03, 2019 @05:48PM (#18820105)
I believe webassembly offers the opportunity to democratize and decentralize software, but I don't believe that can happen as long as "web applications" remain in the browser, or as long as runtimes are tied to specific languages or platforms (as with java and flash.) I want the line between "native" and "web" to be eliminated as much as possible, so that every application has a URL and can be run from there in a browser and installed natively from it.

>I think we can work with those benefits, and give users and developers the options needed for other formats if they want.

That's literally what I'm advocating. Not getting rid of webassembly applications in the browser, but also having native runtimes that are optimized for running the same webassembly applications.

Every benefit that the browser as application model provides could improve the way native applications work as well - there could literally just be a button or an option in the browser to "install as native" and the Webassembly binary in the browser could just be copied somewhere, maybe with some metadata, and an icon generated for the desktop. Native runtimes could sandbox them just as a browser might, and the uninstallation process need be not much more complex than dumping a cache or deleting a folder.

Re:Doom 3 in WebAssembly by Klathmon on Thursday January 03, 2019 @07:51PM (#18821001)
Ah, so it sounds like we are on the same page, but just call it different things. (what you call a native runtime I call a browser with some UI differences)

Your last paragraph basically describes a browser with a special "install" flow. Mobile Chrome already has a flow like that for PWAs where it will ask you "do you want to add this to the home screen?" and it will add the icon to your app drawer on android just like any other app, allow you to "uninstall" it just like any other app, and when you launch it it launches fullscreen just like any other app.

I'd love to see this expanded to cover desktop as well. And with some additional work (like giving the option to move storage data to different drives or manage apps based on their hostname more easily), it could become a very powerful system.

If you want to learn more, take a look at the google developers page for PWAs. It seems to be what you are looking for in some ways!

https://developers.google.com/web/progressive-web-apps/

Re:Doom 3 in WebAssembly by rafaelvasco on Thursday January 03, 2019 @04:21PM (#18819405)
Couldn't have said it better myself.
Re:Doom 3 in WebAssembly by rafaelvasco on Thursday January 03, 2019 @04:09PM (#18819295)
I disagree. But I understand your view. The thing is I don't want the game running IN the browser. I want it running standalone, but being web enabled and having the facilites it provides.
Re:Doom 3 in WebAssembly by computmaxer on Thursday January 03, 2019 @04:13PM (#18819322)
What? If it isn't in the browser, what's the difference between that and something you download on Steam?
Re:Doom 3 in WebAssembly by rafaelvasco on Thursday January 03, 2019 @04:18PM (#18819373)
For the user almost none. The difference is for the devs. If I want to make a cross platform game now, I have to worry about which Graphics api I will use, OpenGL, Direct3D, Vulkan etc. What sound api I will use. What Display, Input, abstraction I will use. Etc. If I could have a unified api and runtime abstracting all that already for me, making full cross platform games would be easier, assuming I don't want to use Unity. But that is of a much bigger scope that just WebAssembly. We already have that power, but we are chained to the browser. The discussion is to free that runtime from the scope of the browser. Decouple it.

The final dream is having a unified, Desktop, Consoles (Ps4 and Switch) and Browser runtime with a unified API (where sensible). One can dream.

Re:Doom 3 in WebAssembly by openbasic on Thursday January 03, 2019 @05:09PM (#18819826)
One does not simply develop cross-browser. Different browsers have different issues with different graphics cards. As soon as you're not drawing a textured triangle anymore, things get hairy. Same for the audio API. And don't get me started on the sad state of WebRTC and websockets.
Re:Doom 3 in WebAssembly by beetwenty on Thursday January 03, 2019 @06:04PM (#18820236)
Yes, it's just not viable to develop for browsers unless you have the maintenance budget for a moving target. I decided on that after living through the Flash era and trying HTML5 for a little while. The browser is backwards compatible only for certain kinds of applications.
Re:Doom 3 in WebAssembly by rafaelvasco on Thursday January 03, 2019 @06:15PM (#18820319)
Well, yeah. I agree. You escape from several problems in native environments and find another several in the web.
Re:Doom 3 in WebAssembly by openbasic on Friday January 04, 2019 @10:02AM (#18824449)
That's the thing. You don't escape from those problems in native environments. You still have to deal with different GFX drivers doing different crap on different platforms, cards that they that support a GL extension but don't, etc. And that's just OpenGL.

With the browser, you're just adding another abstraction layer that has even more complexity. WebGL is far for a decent spec. And we're talking just graphics, as I mentioned before, audio and networking have tons of unstable and untested code.

Multimedia programming is already hard on native environments. I don't see the web being a friendly environment anytime soon. There's no silver bullet, "code once, run anywhere" for games and multimedia.

Re:Doom 3 in WebAssembly by tyingq on Thursday January 03, 2019 @04:12PM (#18819316)
The WASM folks have plans to deepen the browser ties with direct DOM access, tying threads to webworkers, GC that's tied to the browser js, etc. I can see why you want what you do, but it will get harder over time.
Re:Doom 3 in WebAssembly by neurotrace on Thursday January 03, 2019 @04:54PM (#18819685)
That's not quite true. They intend to create a way of interfacing with ANY GC which would then allow them to make APIs that call in to the DOM. None of this would tie it directly to browsers. The whole intent is to keep it platform-agnostic, last I heard.

> An important constraint is that, while WebAssembly should allow tight integration with the Web, it should not bake in details or Web standards dependencies that prevent execution in a non-Web embedding. This suggests a design (called opaque reference types below) that hides the details of JavaScript and WebIDL behind Web-embedding-specific builtin modules. On the other hand, WebAssembly can define a set of native GC primitives that allowed portable GC code to be written regardless of the host environment.

https://github.com/WebAssembly/proposals/issues/16

Re:Doom 3 in WebAssembly by tyingq on Thursday January 03, 2019 @06:38PM (#18820495)
That's encouraging. As far as I can tell, threading is currently webworker centric.
Re:Doom 3 in WebAssembly by rafaelvasco on Thursday January 03, 2019 @04:19PM (#18819378)
Unfortunate.
Re:Doom 3 in WebAssembly by tracker1 on Thursday January 03, 2019 @05:53PM (#18820152)
The problem, as in this case is assets of > 400mb downloading every time you run the game. It would be better to have a browser extension (at least) to manage "games" or "large applications" ... maybe similar to the Chrome Apps attempt(s). So that you can choose to have it as an application where at least some manifest of assets could be held offline, maybe using webtorrents to share.
Re:Doom 3 in WebAssembly by rictic on Thursday January 03, 2019 @06:15PM (#18820316)
Why would it download the 400mb every time you run the game? There are caching and storage APIs in the browser. It's possible that there are some more controls needed for both the user and the site author over this storage space, but that's definitely not a fundamental impediment.
Re:Doom 3 in WebAssembly by tracker1 on Thursday January 03, 2019 @07:11PM (#18820731)
I'm unsure if browsers will cache 400mb from a single site in a single file. Also, where are you going to cache it... all of said APIs would have to request to expand local storage interface... which may not be bad.
Re:Doom 3 in WebAssembly by Klathmon on Thursday January 03, 2019 @07:53PM (#18821020)
indexedDB can easily store gigabytes of data without issue. I've personally used it to do so before, and it will happily "cache" it for weeks at a time. There are several web apps which work entirely offline and cache all of their data using that API.

devdocs.io is one of them.

Like the parent commenter said, i'd welcome more control over the storage of that data, but it absolutely can and will cache large blobs like that.

Re:Doom 3 in WebAssembly by Gab_CV on Friday January 04, 2019 @08:20AM (#18823759)
Actually, indexedDB is used to cache/store the whole .pk4, but using small chunks of data (50MB or so). This works well in practice.

The best would be that all browsers support the Chrome Filesystem API, but that's not for now

Re:Doom 3 in WebAssembly by Klathmon on Friday January 04, 2019 @08:44AM (#18823950)
Thats cool! Any reason you do it in multiple distinct chunks vs mutating a single chunk?

I'm assuming the time required to store and request a massive blob gets excessive at some point, but were there any other reasons?

Re:Doom 3 in WebAssembly by Gab_CV on Friday January 04, 2019 @03:17PM (#18827255)
It is because IndexedDB maximum row size is not that big, and depends on the browsers
Re:Doom 3 in WebAssembly by Klathmon on Friday January 04, 2019 @03:38PM (#18827390)
Wow I had no idea! I'll have to look into that, thanks!