Steve Fink wrote:
Yeah, that's some very critical weasel-wording in the strawman. "Let's
add this to the language, but not expose it to things it shouldn't be
exposed to." Huh?

To be fair to the author, Mark Miller, he knows well that this must be specified. It's not, ergo (among other reasons), strawman status.

A privilege model that supports this kind of API is not yet available on the web. The clown-car brigade of bundled permissions for packaged apps on Android is a counterexample. Mark is of the Object Capability school, and has done lots of work on ocap-for-JS (Caja, SES). So the way to read this is: work in progress, made of straw, not ready for prime time.

The reason developers need this is clear, I hope. In any kind of MVC framework without guest/host VM-like supervision and stratification, it's easy for a subject observes object to go wrong if subject holds a strong ref. The object often links back (parentNode) to the global object, which links "down" (document, and onward to some kind of observers list on an element) to the subject.

The subject does not want to extend the lifetime of the object in any event, and does not always need to know exactly when the object becomes garbage. Thus the idea of using event loop turns to schedule notifications.

Ad-hoc protocols in a single-hacker or small-world-hacker-network system can suffice, but for a framework that is "third party" to the developers consuming the framework, no general cycle-breaking protocol, with mandatory dispose() calls, say, suffices. People forget, they leak memory, they don't know how *not to* leak.

None of this is "out of bounds" for JS, any more than for Obj-C or C++ or Java, where weak references are supported.

Yikes, I'm behind on this thread. I hope I didn't duplicate anything too badly. Wanted to put in a word in defense of Mark, and of the reality of the problem faced by framework developers.

/be
_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to