Re: Weak callbacks?

2013-11-08 Thread Jason Orendorff
On Thu, Nov 7, 2013 at 6:40 PM, K. Gadd k...@luminance.org wrote: To contrive a scenario that might illustrate where event listeners aren't necessarily enough: Let's say I have an entity system for a game that is modelling thousands of independent entities that interact. In this system, entity

Re: Weak callbacks?

2013-11-08 Thread David Bruant
Le 08/11/2013 17:09, Jason Orendorff a écrit : (As a bonus, the weirdness will happen in one implementation and not another, and you and your users will blame the implementation. So there will be pressure on implementers to reduce the nondeterminism by doing GC more frequently—which trades off

Re: Weak callbacks?

2013-11-08 Thread Mark S. Miller
Please try -- such experiments are interesting. But even if this experiment is successful, I hope and expect that we'll have weakrefs and post-mortem finalization in ES7. They are needed for many other things, such as distributed acyclic garbage collection (as in adapting the CapTP ideas to

Rev21 ES6 Draft now available

2013-11-08 Thread Allen Wirfs-Brock
PDFs and .doc file available at http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#november_8_2013_draft_rev_21 New in this revision: • Updated Module Syntax and static semantics • Scripts no longer may contain import statements • Specified how to

Re: Weak callbacks?

2013-11-08 Thread K. Gadd
More tooling is great for developing new software in ES, but it does nothing to address use cases where existing software and algorithms can't be ported without Weak References. Perhaps enough research will allow us to arrive at some sort of general 'best practice' for replacing the use of weak

Re: Weak callbacks?

2013-11-08 Thread Allen Wirfs-Brock
On Nov 7, 2013, at 3:16 PM, Mark Miller wrote: I agree. This is a good use for weakrefs without the need for finalization. Thanks! On Thu, Nov 7, 2013 at 3:12 PM, K. Gadd k...@luminance.org wrote: The problem is that the cycles remain uncollectable for a very long period of time, even

Specification of use before declaration errors

2013-11-08 Thread Ian Halliday
Hello es-discuss, I'm having difficulty figuring out where the ES6 draft spec specifies that a use before declaration error should be thrown. My last understanding of the temporal dead zone was that ECMAScript would always issue a use before declaration error at runtime, regardless whether it

Re: Specification of use before declaration errors

2013-11-08 Thread Allen Wirfs-Brock
On Nov 8, 2013, at 3:35 PM, Ian Halliday wrote: Hello es-discuss, I’m having difficulty figuring out where the ES6 draft spec specifies that a “use before declaration” error should be thrown. My last understanding of the temporal dead zone was that ECMAScript would always issue a “use

Re: Weak callbacks?

2013-11-08 Thread K. Gadd
The difference is that if the large cycle is only uncollected because the weak references haven't been zapped, in a low memory/out of memory situation, the runtime's collector can go through and zap all weak references. If I write an ES application and do my own cycle collection/weak reference

Re: Weak callbacks?

2013-11-08 Thread David Bruant
Le 08/11/2013 20:35, Mark S. Miller a écrit : Please try -- such experiments are interesting. I am :-) But even if this experiment is successful, I hope and expect that we'll have weakrefs and post-mortem finalization in ES7. They are needed for many other things, such as distributed acyclic

Re: Weak callbacks?

2013-11-08 Thread Mark S. Miller
Hi David, there's a distributed race condition that's fixed by the use of importCount. Fixing it using post-mortem finalization creates a local race condition which is fixed by this test, not if the proxy is *still* alive, but if a new proxy has been installed as its reincarnation. For