Re: iteration order for Object

2011-03-11 Thread Bradley Meck
I would just like to give my 2 cents. I would like some sort of iterative ordering, but not on Objects. The reasons have been stated before that iterative ordering is less optimal for performance than random access (or semi-random). However, it has its uses, perhaps it would be more suitable to pu

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/11/2011 3:58 PM, Jeff Walden wrote: On 03/11/2011 02:07 PM, Charles Kendrick wrote: Your perspective is common in a group like this - very spec and standard focused. Isn't it fun to bash those developers? Everyone's doing it.. I hope you realize it's irrelevant though? Insinuating bad f

Re: iteration order for Object

2011-03-11 Thread Jeff Walden
On 03/11/2011 02:07 PM, Charles Kendrick wrote: Your perspective is common in a group like this - very spec and standard focused. Isn't it fun to bash those developers? Everyone's doing it.. I hope you realize it's irrelevant though? Insinuating bad faith ("Isn't it fun" and "Everyone's doing

Re: iteration order for Object

2011-03-11 Thread P T Withington
On 2011-03-11, at 18:40, Charles Kendrick wrote: >> "These developers" didn't take a "calculated risk". They saw it worked >> with the implementations at the time and hoped it would be so in the >> future. > > That is precisely the calculated risk they took. FWIW, OpenLaszlo does not take that r

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/11/2011 3:13 PM, David Bruant wrote: Have you reported an issue to Microsoft Connect (or their bug reporting platform, I do not remember the exact name)? I will report it the second that I can link to, say, an email from Brendan Eich replying to 2 other heavies saying yeah, we're agreed E

Re: iteration order for Object

2011-03-11 Thread David Bruant
Le 11/03/2011 23:07, Charles Kendrick a écrit : > On 3/11/2011 1:33 PM, David Bruant wrote: >> Le 11/03/2011 21:49, Charles Kendrick a écrit : >>> Yes Allen, hence the urgency. If IE9 final ships that way, the "goose >>> is cooked": >> Let's face it right now: IE9 will ship that way. They're on RC

Re: iteration order for Object

2011-03-11 Thread Mike Samuel
2011/3/11 David Bruant : > Le 11/03/2011 21:49, Charles Kendrick a écrit : >> Yes Allen, hence the urgency.  If IE9 final ships that way, the "goose >> is cooked": > Let's face it right now: IE9 will ship that way. They're on RC phase, > it's completely irrealistic to consider they would change obj

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/11/2011 1:33 PM, David Bruant wrote: Le 11/03/2011 21:49, Charles Kendrick a écrit : Yes Allen, hence the urgency. If IE9 final ships that way, the "goose is cooked": Let's face it right now: IE9 will ship that way. They're on RC phase, it's completely irrealistic to consider they would c

Re: iteration order for Object

2011-03-11 Thread David Bruant
Le 11/03/2011 21:49, Charles Kendrick a écrit : > Yes Allen, hence the urgency. If IE9 final ships that way, the "goose > is cooked": Let's face it right now: IE9 will ship that way. They're on RC phase, it's completely irrealistic to consider they would change object implementation. >From the spe

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
Probably the language which most commonly handles JSON is JavaScript itself. So a major chunk of the benefit, possibly even the majority of the benefit, would be immediate: eval(), application config files expressed in JSON, etc. And as you alluded to (also I CAN HAZ CUSTIM CLAZZES?) JSON will

Re: iteration order for Object

2011-03-11 Thread Dean Landolt
On Fri, Mar 11, 2011 at 3:48 PM, Charles Kendrick wrote: > Not so - order-preserving implementations are backwards compatible with > non-order-preserving implementations. Just rev the spec, and like any other > versioned spec, developers can use the new behavior when they know the > application e

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
Yes Allen, hence the urgency. If IE9 final ships that way, the "goose is cooked": 1. we will have a new de facto standard iteration order for Object that does not match any known use case - it is purely an implementation detail leaking through 2. the majority of real-world applications will

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
Not so - order-preserving implementations are backwards compatible with non-order-preserving implementations. Just rev the spec, and like any other versioned spec, developers can use the new behavior when they know the application environment uses only the new version. On 3/11/2011 12:41 PM, D

Re: iteration order for Object

2011-03-11 Thread Dean Landolt
On Fri, Mar 11, 2011 at 3:14 PM, Charles Kendrick wrote: > On 3/10/2011 7:33 PM, Boris Zbarsky wrote: > >> On 3/10/11 9:58 PM, Charles Kendrick wrote: >> >>> 1. tens of thousands of web applications that need to define a sorted >>> map plus perhaps billions of JSON messages per day >>> >>> .. to .

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/10/2011 7:33 PM, Boris Zbarsky wrote: On 3/10/11 9:58 PM, Charles Kendrick wrote: 1. tens of thousands of web applications that need to define a sorted map plus perhaps billions of JSON messages per day .. to .. 2. a handful of crypto / computational use cases used by a tiny minority of s

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
Hi John, you seem to be rephrasing your case without addressing my counterpoints. So again the problem with the analogy to C is that permanently changing the definition of C so that "int" is 16 bits would damage the language, my proposal would not. Further, I have argued in detail that it imp

Re: iteration order for Object

2011-03-11 Thread John Tamplin
On Fri, Mar 11, 2011 at 2:49 PM, Charles Kendrick wrote: > Hello John, I'll assume you meant this as humor since the analogy has such > obvious flaws. > > Having a default strategy on Object of maintaining order obviously does not > preclude other strategies, nor does it damage the JavaScript lang

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
Hello John, I'll assume you meant this as humor since the analogy has such obvious flaws. Having a default strategy on Object of maintaining order obviously does not preclude other strategies, nor does it damage the JavaScript language itself, as locking int to 16 bits would obviously have dam

Re: iteration order for Object

2011-03-11 Thread John Tamplin
On Fri, Mar 11, 2011 at 11:31 AM, Charles Kendrick wrote: > However as far as the default strategy, the highest value thing to do seems > to me to impose the de-facto standard of 15 years - insertion order - which > is a very useful behavior and will avoid thousands of websites having to > compens

Re: iteration order for Object

2011-03-11 Thread Allen Wirfs-Brock
On Mar 10, 2011, at 5:44 PM, Charles Kendrick wrote: > This behavior was perfectly consistent across all browsers until Chrome 6. I > think it's more appropriate to say that Chrome is not interoperable with > thousands of sites than to define interoperable behavior based on a minority > browse

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/11/2011 2:39 AM, David Bruant wrote: Le 11/03/2011 00:48, Charles Kendrick a écrit : == Expressiveness and Performance argument A very common use case where order preservation is desirable is providing the set of options for a drop-down list in JavaScript. ... This is one (very valid, in

Re: iteration order for Object

2011-03-11 Thread David Bruant
Le 11/03/2011 17:13, John Lenz a écrit : > This whole discussion makes reminds me how much JavaScript needs > proper collections. People use "Object" but they don't really want > Object (where prototype properties leak into data, where they String > is the only key type, where the strings "1.0" an

Re: iteration order for Object

2011-03-11 Thread John Lenz
This whole discussion makes reminds me how much JavaScript needs proper collections. People use "Object" but they don't really want Object (where prototype properties leak into data, where they String is the only key type, where the strings "1.0" and "1" can not be represented in the same map, etc

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/11/2011 7:35 AM, Wes Garland wrote: Someone -- Mark Miller? -- suggested an interesting option when this discussion came up last on this list (around Christmas 2010 IIRC). Basically -- enumerate named props in insertion order, and numeric props in numeric. This gets pretty close to what

Re: iteration order for Object

2011-03-11 Thread Charles Kendrick
On 3/11/2011 7:07 AM, Claus Reinke wrote: I believe it is very very important that the ECMAScript standard specify that when a new Object is created, for..in iteration traverses properties in the order they are added, regardless of whether the properties are numeric or not. Some users might p

Re: iteration order for Object

2011-03-11 Thread Wes Garland
On Fri, Mar 11, 2011 at 10:07 AM, Claus Reinke wrote: > I believe it is very very important that the ECMAScript standard specify >> that when a new Object is created, for..in iteration traverses properties in >> the order they are added, regardless of whether the properties are numeric >> or not.

Re: iteration order for Object

2011-03-11 Thread Claus Reinke
I believe it is very very important that the ECMAScript standard specify that when a new Object is created, for..in iteration traverses properties in the order they are added, regardless of whether the properties are numeric or not. Some users might prefer 'in the order of keys'. That is predi

Re: iteration order for Object

2011-03-11 Thread David Bruant
Le 11/03/2011 00:48, Charles Kendrick a écrit : > I believe it is very very important that the ECMAScript standard > specify that when a new Object > is created, for..in iteration traverses properties in the order they > are added, regardless of whether the properties are numeric or not. (...) > ==

Re: iteration order for Object

2011-03-11 Thread Erik Corry
2011/3/11 Charles Kendrick : > All browsers that have ever had non-negligible market share have implemented > order-preserving > Objects - until Chrome 6. Just to be clear: Chrome 5 and before had a for-in ordering that revealed internal optimization strategies. From Chrome 6 and forward the beh