Maybe that doesn’t result in very much self-hosting in practice. Dunno.
-
-
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 -
How do you create new objects? Create a rooting context first? (This is what josephine does, innit?)
1 reply 0 retweets 0 likes -
Yeah, there would be some sort of context object bound to a lifetime that you could make objects with. That would also be the lifetime for roots. No need for DOMRefCell. No need for cursor objects. No need for Traceable. No need for custom collections: just use regular JS Arrays
1 reply 0 retweets 0 likes -
Replying to @pcwalton @ManishEarth and
This is how Objective-C works, as a point of comparison. They solve the problem of regular C code not knowing anything about automatic reference counting by just banning all Obj-C objects from C containers. You can only use NSArray, etc.
2 replies 0 retweets 3 likes -
We have a bunch of cases where there's a complex type stored inside a DOM object. Especially enums.
1 reply 0 retweets 0 likes -
It’s still possible to have complex objects stored inside DOM objects, with the “Rust object wrapper” I’m proposing. Just not complex objects that themselves hold onto DOM objects. Those would have to be replaced with alternatives.
1 reply 0 retweets 1 like -
Yeah, the latter is what I'm talking about
1 reply 0 retweets 1 like -
Replying to @ManishEarth @pcwalton and
When I say complex I mean a mix of rust and js stuff.
2 replies 0 retweets 0 likes -
Replying to @ManishEarth @pcwalton and
These are still rare enough that we may be able to hack it. But we do have things like Vec<(u64, Function)>
1 reply 0 retweets 0 likes
Those could be replaced with Array<TaggedFunction> where TaggedFunction is a JS object that contains a Function and a u64.
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.