I really wish we could just self-host the DOM, TBH.
-
-
Replying to @pcwalton
I contemplated this and with the current state of self hosted code in SM it’s not a good idea, according to Till. Also I just want to play with
@asajeffrey’s library.1 reply 0 retweets 2 likes -
Self-hosting has its advantages, in particular optimizers have a really hard time with FFI boundaries. The big problem is security, since it's easy to mess up when both sides of a security boundary are in one language.
1 reply 0 retweets 0 likes -
-
if your privileged code is moved into the sandbox, then "unprivileged code can't escape the sandbox" isn't necessarily that strong of a statement anymore
1 reply 0 retweets 1 like -
What’s the privilege boundary here? Not being facetious. The self-hosted DOM of my dreams would follow the principle “functions that the user can compatibly polyfill in JS are in JS, while others remain in Rust”.
1 reply 0 retweets 0 likes -
Maybe that doesn’t result in very much self-hosting in practice. Dunno.
2 replies 0 retweets 0 likes -
cc
@ManishEarth: Here’s another silly idea: What if you could never store a strong reference from Rust code to a DOM object, ever? All JS object pointers would be forced with lifetimes to be stack-only. Use the reserved slot API and native JS collections for object data.2 replies 0 retweets 2 likes -
Replying to @pcwalton @asajeffrey and
That's an interesting idea. More possible in Servo due to using the GC to manage object lifetimes. How would references from, say, Browsing Context state to the document object work? Would some Rust->JS be required?
1 reply 0 retweets 1 like -
Replying to @kneecaw @asajeffrey and
The browsing context state would presumably be a JS object inaccessible to script.
2 replies 0 retweets 2 likes
Or, well, I guess there has to be some kind of small list of roots, or else there’s nothing keeping the whole heap alive :) You manually attach and detach the roots.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.