I recall one of the spec authors saying in an HN thread that a GC would be added eventually, back in the infancy of WA. I'm not sure if that's still on the cards or if there have been any updates on the subject.
I recall one of the spec authors saying in an HN thread that a GC would be added eventually, back in the infancy of WA. I'm not sure if that's still on the cards or if there have been any updates on the subject.
DOM access will be possible through the interface-types extension [0], but no host supports it yet AFAIK. Also still a very tricky problem.
LLVM has an interface for GCs such that the host language can provide LLVM with information about what kind of code to generate at the boundary between the application and the GC, but that’s just shim code; not a full GC implementation, and even then I’m not sure of any languages that make use of it.
Even still, it’s cool to see the WASM folks trying to tackle these big tricky problems!
It's enticing to imagine being able to open a wasm file and seeing an application on the page. Kinda like how you can just open an image or a video in the browser, without rendering it via an html document.
A lot of the web today (web applications in particular) are therefore hacks of HTML. I know that the standard has responded to these uses by incorporating more application-level features, but IMO this has become burdensome and bloated.
There are lots of issues coming from the fact that we're attempting to write application-level code on top of a platform that has historically been designed for documents.
You could argue for an alternative to html/DOM - some kind of rendering format that is meant specifically for full-featured applications.
I don't think the downplay of HTML/CSS (referring to it as hacks) is valid just because 30 years ago it was about document delivery. You have to start somewhere. It took a while and it made some people fed up with it, I've seen that. I still have some PTSD from hacking IE6, those were the real hacky days. Nowadays most stuff just works.
What we have as a spec is the lowest common denominator that passed the test of tons of communities and companies, and from this perspective it's incredibly successful.
HTML's pretty bad at the use case it's been smushed into, and hacking a semi-reasonable GUI toolkit on top of it in Javascript is bound, no matter how good the effort, to be slower and less pleasant than something designed from the beginning to be used for heavily interactive application GUIs.
The two big risks I see are: 1) the tinkerer-friendliness of the Web is, very likely, going to take a big step backwards as WASM use spreads, and 2) there's a chance we'll end up with 100 different WASM GUI toolkits and they'll be super-trendy and all the job ads will demand familiarity with at least one of them, but not a single goddamn one of them will handle accessibility and various edge cases half as well as plain HTML or actual native development does (to be fair, Javascript that writes around limitations in HTML by re-implementing parts of it often has the same problem)
Well, there are three ways to do that. You can use a 2D canvas, you can use a WebGL canvas, or you can use a bitmap canvas. This is roughly equivalent to what you get when you’re programming a desktop application anyway. This is a cornucopia of alternatives here! I’m having a hard time understanding what is missing.
These “use the DOM” in the same sense that desktop applications use the window manager. You’re just drawing into an element in some compositing system. This is fine, there’s no real benefit to bypassing the DOM—like window managers, you can bypass the compositor when possible and go through the compositor when unavoidable. This is transparent to the application programmer.
> You can take a Canvas element and draw anything you like on it
Don't you need to first go through the DOM to get the canvas element?
Of course, why not just use a small HTML+JS shim for your WASM?
> 3. Design to execute within and integrate well with the existing Web platform:
> * execute in the same semantic universe as JavaScript
> * access browser functionality through the same Web APIs that are accessible to JavaScript
Lawyering aside, I would say that this is pretty much the same thing as "enabling the development in web apps in other languages".
Using the existing HTML + JS avoids creating as much future legacy cruft.
I don't think changing this is even desirable. It's much easier and cleaner to standardize a stdlib of accessors.
This wasn't the intention when the script tag was introduced. It's interesting that the web standardized on one programming language.
In hindsight I feel like this isn't surprising. How many platforms (that aren't themselves operating systems) support scripting in more than one language? Vim/Neovim is the only one I can think of off the top of my head.
But, of course, other browsers didn't have that. And even at the time when some websites really only cared about IE, they couldn't assume that people had any third-party runtimes installed - so you very occasionally saw VBScript, but pretty never anything else.
But now, it's pretty much just JS.
AFAIK, the reason the DOM and JS GC are very coupled is because there can be loops between the DOM and JavaScript: the DOM can hold JavaScript resources, which themselves can hold DOM resources. As long as these loops are avoided (by not allowing the DOM to hold resources within the WASM heap), this is not an issue.