Re: ECMAScript Object equivalence classes proposal

2011-04-11 Thread Erik Arvidsson
On Fri, Apr 8, 2011 at 13:24, Brendan Eich bren...@mozilla.com wrote: On Apr 8, 2011, at 12:59 PM, David Bruant wrote: I'll agree that as long as it's fast enough for real life uses, the actual big-O or multiplicative constants are of no interest. For instance, the current inheritance has a

Re: ECMAScript Object equivalence classes proposal

2011-04-08 Thread P T Withington
On 2011-04-07, at 13:27, Brendan Eich wrote: On Apr 5, 2011, at 2:19 PM, David Bruant wrote: What I'm worried about is the memory cost of such an implementation. The current [[HasInstance]] implementation has a constant memory cost. Keeping references has a linear memory cost in terms of

Re: ECMAScript Object equivalence classes proposal

2011-04-08 Thread Allen Wirfs-Brock
On Apr 8, 2011, at 11:40 AM, P T Withington wrote: An oldie, but a goodie, perhaps relevant to this discussion: http://www.cs.purdue.edu/homes/jv/pubs/oopsla97.pdf Absolutely! We used this technique quite effectively in Instantiations' Jove whole program optimizer for Java

Re: ECMAScript Object equivalence classes proposal

2011-04-08 Thread David Bruant
Le 07/04/2011 19:27, Brendan Eich a écrit : On Apr 5, 2011, at 2:19 PM, David Bruant wrote: What I'm worried about is the memory cost of such an implementation. The current [[HasInstance]] implementation has a constant memory cost. Keeping references has a linear memory cost in terms of

Re: ECMAScript Object equivalence classes proposal

2011-04-07 Thread Brendan Eich
On Apr 3, 2011, at 11:12 AM, Allen Wirfs-Brock wrote: On Apr 2, 2011, at 5:11 PM, Brendan Eich wrote: Is multiple inheritance a use case that TC39 intends to address in a generic manner? No. Inheritance-based instanceof testing for the purpose of dynamic classification of objects is

Re: ECMAScript Object equivalence classes proposal

2011-04-07 Thread Brendan Eich
On Apr 5, 2011, at 2:19 PM, David Bruant wrote: What I'm worried about is the memory cost of such an implementation. The current [[HasInstance]] implementation has a constant memory cost. Keeping references has a linear memory cost in terms of instance number. My favorite real-world

Re: ECMAScript Object equivalence classes proposal

2011-04-06 Thread Allen Wirfs-Brock
I''ve been a bit pinch for time the last couple days, but here are some preliminary responses to a few points below. On Apr 5, 2011, at 1:38 PM, David Bruant wrote: On Apr 2, 2011, at 5:11 PM, Brendan Eich wrote (except the this is really quoting Allen Wirfs-Brock): Inheritance-based

Re: ECMAScript Object equivalence classes proposal

2011-04-05 Thread David Bruant
On Apr 2, 2011, at 5:11 PM, Brendan Eich wrote: On Apr 2, 2011, at 4:19 PM, David Bruant wrote: I have the feeling that none of these can help out with multiple inheritance. This is the problem I want to address. Why? I mean, given the WebIDL and DOM changes. Is multiple inheritance a

Re: ECMAScript Object equivalence classes proposal

2011-04-05 Thread David Bruant
I largely agree with Allen's point of approaching classification in a dynamically typed language. I'm also a proponent of divorcing object classification entirely from the inheritance hierarchy. In our traits.js library, we decoupled traits from types, leaving the task of classifying

Re: ECMAScript Object equivalence classes proposal

2011-04-05 Thread Kam Kasravi
On Apr 5, 2011, at 1:38 PM, David Bruant david.bru...@labri.fr wrote: On Apr 2, 2011, at 5:11 PM, Brendan Eich wrote: On Apr 2, 2011, at 4:19 PM, David Bruant wrote: I have the feeling that none of these can help out with multiple inheritance. This is the problem I want to address. Why?

Re: ECMAScript Object equivalence classes proposal

2011-04-04 Thread Tom Van Cutsem
I largely agree with Allen's point of approaching classification in a dynamically typed language. I'm also a proponent of divorcing object classification entirely from the inheritance hierarchy. In our traits.js library, we decoupled traits from types, leaving the task of classifying

Re: ECMAScript Object equivalence classes proposal

2011-04-03 Thread David Bruant
Le 03/04/2011 02:11, Brendan Eich a écrit : On Apr 2, 2011, at 4:19 PM, David Bruant wrote: I have the feeling that none of these can help out with multiple inheritance. This is the problem I want to address. Why? I mean, given the WebIDL and DOM changes. Because people want it;

Re: ECMAScript Object equivalence classes proposal

2011-04-03 Thread Brendan Eich
On Apr 3, 2011, at 1:29 AM, David Bruant wrote: Le 03/04/2011 10:12, David Bruant a écrit : Le 03/04/2011 02:11, Brendan Eich a écrit : On Apr 2, 2011, at 4:19 PM, David Bruant wrote: I have the feeling that none of these can help out with multiple inheritance. This is the problem I want

Re: ECMAScript Object equivalence classes proposal

2011-04-03 Thread Allen Wirfs-Brock
On Apr 2, 2011, at 5:11 PM, Brendan Eich wrote: On Apr 2, 2011, at 4:19 PM, David Bruant wrote: I have the feeling that none of these can help out with multiple inheritance. This is the problem I want to address. Why? I mean, given the WebIDL and DOM changes. Is multiple inheritance

ECMAScript Object equivalence classes proposal

2011-04-02 Thread David Bruant
Hi, This proposal is another attempt to address the DOM Element+EventTarget multiple inheritance issue in ECMAScript. The main idea of my proposal is to introduce the concept of object equivalence classes. First off, I'd like to say that I refer to a concept

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread Brendan Eich
On Apr 2, 2011, at 11:44 AM, David Bruant wrote: Hi, This proposal is another attempt to address the DOM Element+EventTarget multiple inheritance issue in ECMAScript. That issue was resolved by putting EventTarget on the inheritance chain. See

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread Brendan Eich
On Apr 2, 2011, at 12:16 PM, Brendan Eich wrote: You must mean only in the cases where typeof a == typeof b, then a == b = a === b, and === is an e.r. But that does not mean == is an e.r. Forgot typeof a == object above, to be precise. For mismatching types, == is not transitive, so not an

[DOMCore] Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread David Bruant
[Adding DOMCore to the discussion] Le 02/04/2011 21:16, Brendan Eich a écrit : On Apr 2, 2011, at 11:44 AM, David Bruant wrote: Hi, This proposal is another attempt to address the DOM Element+EventTarget multiple inheritance issue in ECMAScript. That issue was resolved by putting

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread David Bruant
Le 02/04/2011 21:30, Brendan Eich a écrit : On Apr 2, 2011, at 12:16 PM, Brendan Eich wrote: You must mean only in the cases where typeof a == typeof b, then a == b = a === b, and === is an e.r. But that does not mean == is an e.r. Forgot typeof a == object above, to be precise. Indeed, I

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread Brendan Eich
On Apr 2, 2011, at 1:58 PM, David Bruant wrote: I'm surprised by the idea that == could be defined on a per-value comparison basis on objects (Array as you give it as an example). It doesn't make the relation last throughout the program lifetime (which is what I was trying to do and requires

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread Brendan Eich
On Apr 2, 2011, at 1:58 PM, David Bruant wrote: I'm surprised by the idea that == could be defined on a per-value comparison basis on objects (Array as you give it as an example). It doesn't make the relation last throughout the program lifetime (which is what I was trying to do and requires

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread David Bruant
Le 02/04/2011 23:40, Brendan Eich a écrit : On Apr 2, 2011, at 1:58 PM, David Bruant wrote: I'm surprised by the idea that == could be defined on a per-value comparison basis on objects (Array as you give it as an example). It doesn't make the relation last throughout the program lifetime

Re: ECMAScript Object equivalence classes proposal

2011-04-02 Thread Brendan Eich
On Apr 2, 2011, at 4:19 PM, David Bruant wrote: I have the feeling that none of these can help out with multiple inheritance. This is the problem I want to address. Why? I mean, given the WebIDL and DOM changes. Is multiple inheritance a use case that TC39 intends to address in a generic