Re: Need a champion? StringView strawman

2014-01-11 Thread Anne van Kesteren
On Fri, Jan 10, 2014 at 7:00 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: [...] it might be reasonable to have a solution that isn't tied to a specific environment. Agreed. I have argued the same for URL parsing http://url.spec.whatwg.org/ at some point. As for the API in the Encoding

Re: Need a champion? StringView strawman

2014-01-11 Thread Anne van Kesteren
On Fri, Jan 10, 2014 at 9:40 PM, Boris Zbarsky bzbar...@mit.edu wrote: OK, so specify ISO-8859-1, if that's what you're really doing. Note that iso-8859-1 maps to windows-1252. There is an open bug on exposing a label to the API that has the real iso-8859-1 behavior:

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
I think it would really help the design of ECMAScript going forward if we had a definitive and complete explanation of what enumerability is now and what it should be in the future. I’m trying to make sense of it and to explain it to others and continue to fail. I can't provide a

Re: Need a champion? StringView strawman

2014-01-11 Thread Brendan Eich
I think based on bugs and bz's advice the Dwayne has been misled by bad old pre-WebIDL API in Gecko -- there's no reason to do any string-viewing here. Certainly not punning bytes as points in a character set encoding. /be Anne van Kesteren mailto:ann...@annevk.nl January 11, 2014 8:27 AM

Re: Enumerability

2014-01-11 Thread Brendan Eich
Axel Rauschmayer wrote: Nice example. Data versus meta-data, in line with the `length` of an array being non-enumerable. Yes, and that's the primordial reason for enumerability. But it still seems that class declaration users might want methods on the prototype to be non-enumerable. Sauce

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
### I’m looking for a simple explanation of what enumerability will be, going forward. If there isn’t one then I’d argue that no new feature should be influenced by it. That was one of the argument made in favor of concise methods defaulting as not enumerable: enumerable really only

Re: Enumerability

2014-01-11 Thread Brendan Eich
Axel Rauschmayer wrote: I know this runs counter the conventional wisdom for specs, but I find design rationales incredibly important for making sense of what’s going on: The answers and discussions on this mailing list were essential in helping me understand the language. +1. /be

Re: Enumerability

2014-01-11 Thread Andrea Giammarchi
I would like to see some Rick or David example about the expected to be enumerable. If that's about knowing if a class is native or not, looping with a for/in its prototype or any instance does not seem to mean anything reliable since even native methods can be redefined and made enumerable. If

Re: Need a champion? StringView strawman

2014-01-11 Thread Allen Wirfs-Brock
On Jan 11, 2014, at 6:13 AM, Anne van Kesteren wrote: On Fri, Jan 10, 2014 at 7:00 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: [...] it might be reasonable to have a solution that isn't tied to a specific environment. Agreed. I have argued the same for URL parsing

Re: Enumerability

2014-01-11 Thread Allen Wirfs-Brock
On Jan 11, 2014, at 9:01 AM, Axel Rauschmayer wrote: ### I’m looking for a simple explanation of what enumerability will be, going forward. If there isn’t one then I’d argue that no new feature should be influenced by it. That was one of the argument made in favor of concise methods

Re: Need a champion? StringView strawman

2014-01-11 Thread Anne van Kesteren
On Sat, Jan 11, 2014 at 5:27 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: There are a couple places where a string such as EncodingError is thrown. We'd never do that and would use either TypeError or RangeError. If you follow the link for throw, you'll find it's a DOMException. The

Re: Enumerability

2014-01-11 Thread Allen Wirfs-Brock
On Jan 11, 2014, at 9:24 AM, Andrea Giammarchi wrote: I would like to see some Rick or David example about the expected to be enumerable. If that's about knowing if a class is native or not, looping with a for/in its prototype or any instance does not seem to mean anything reliable since

Re: Enumerability

2014-01-11 Thread Axel Rauschmayer
Good point. That “meaning for new features” should probably be clearly stated and dictate how `Object.assign()` behaves. I know this runs counter the conventional wisdom for specs, but I find design rationales incredibly important for making sense of what’s going on: The answers and

Re: Enumerability

2014-01-11 Thread David Bruant
Le 11/01/2014 18:03, Brendan Eich a écrit : Axel Rauschmayer wrote: I know this runs counter the conventional wisdom for specs, but I find design rationales incredibly important for making sense of what’s going on: The answers and discussions on this mailing list were essential in helping me

Re: Need a champion? StringView strawman

2014-01-11 Thread Allen Wirfs-Brock
Another nit: the definition of ASCII whitespace is different from the definition of whitespace used by String.prototype.trim [1]. That means that an implementation of this spec. that was implemented using JS couldn't use S.p.trim to process labels as described in the spec. [1]:

Re: Enumerability

2014-01-11 Thread Andrea Giammarchi
Thanks Allen, makes sense ... but still no example where enumerability of properties and method defined in a class prototype is useful for ... something I cannot imagine right now. Anything? I understand for-of replaces ... etc etc ... for-of is not easy to polyfill though while class sugar is

Re: Need a champion? StringView strawman

2014-01-11 Thread Brendan Eich
Allen Wirfs-Brock wrote: Another nit: the definition of ASCII whitespace is different from the definition of whitespace used by String.prototype.trim [1]. That means that an implementation of this spec. that was implemented using JS couldn't use S.p.trim to process labels as described in the

Re: Need a champion? StringView strawman

2014-01-11 Thread Anne van Kesteren
On Sat, Jan 11, 2014 at 5:57 PM, Brendan Eich bren...@mozilla.com wrote: Allen Wirfs-Brock wrote: Another nit: the definition of ASCII whitespace is different from the definition of whitespace used by String.prototype.trim [1]. That means that an implementation of this spec. that was

Re: Need a champion? StringView strawman

2014-01-11 Thread Allen Wirfs-Brock
On Jan 11, 2014, at 10:07 AM, Anne van Kesteren wrote: On Sat, Jan 11, 2014 at 5:57 PM, Brendan Eich bren...@mozilla.com wrote: Allen Wirfs-Brock wrote: Another nit: the definition of ASCII whitespace is different from the definition of whitespace used by String.prototype.trim [1]. That

Re: Enumerability

2014-01-11 Thread Allen Wirfs-Brock
On Jan 11, 2014, at 9:57 AM, Andrea Giammarchi wrote: Thanks Allen, makes sense ... but still no example where enumerability of properties and method defined in a class prototype is useful for ... something I cannot imagine right now. Anything? Examples that were mentioned in the

Re: Need a champion? StringView strawman

2014-01-11 Thread Anne van Kesteren
On Sat, Jan 11, 2014 at 6:37 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: I'm only talking about this specification and what it takes to decouple it from web platform dependencies. In this case, ASCII whitespace seems to only be used in processing the label parameter passed to the

Clarifications on the iterator protocol

2014-01-11 Thread David Bruant
Hi, I'm starting a documentation on the iterator protocol and wanted to ask a few things just to be 100% sure, because some things may leave room to ambiguities. ## Just for confirmation First, on the relevant TC39 meeting notes [1]. It is suggested that Without Brendan, a champion of

Re: Need a champion? StringView strawman

2014-01-11 Thread Allen Wirfs-Brock
On Jan 11, 2014, at 10:52 AM, Anne van Kesteren wrote: On Sat, Jan 11, 2014 at 6:37 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: I'm only talking about this specification and what it takes to decouple it from web platform dependencies. In this case, ASCII whitespace seems to only

Re: Enumerability

2014-01-11 Thread Andrea Giammarchi
I would leave Object.keys out of the problem since inherited properties would be ignored regardless not being own It seems to me that reasons are ... that Object.mixin, which was not only checking enumerable properties but all own, would have solved the extend example with the prototype but

Value objects: roll your own?

2014-01-11 Thread Axel Rauschmayer
http://www.slideshare.net/BrendanEich/value-objects One thing is not entirely clear from the slides: Will developers be able to define their own value object types? Without that feature I don’t see how overloading operators would be very interesting. Thanks! Axel -- Dr. Axel Rauschmayer

Re: Enumerability

2014-01-11 Thread Brendan Eich
Axel Rauschmayer wrote: I’m sorry for being difficult, but IMO this is an important point: The current cowpath is for-in style, right? That is, inherited and own non-enumerable properties. We’ll deviate from that anyway. Independently of what enumerability means, I can only think of cases

Re: Enumerability

2014-01-11 Thread Brendan Eich
Brendan Eich wrote: I can only think of cases (including Claude Pache’s pro-enumerability example) where I would want to copy *all* own properties. Why do you want an array's .length to be copied? Or in Claude's example, why should a non-enumerable _parent be copied? Claude's words about

Re: Code compilation alternative to Function()

2014-01-11 Thread Sean Silva
On Sat, Jan 11, 2014 at 7:34 PM, fixplzsecr...@gmail.com wrote: I want to propose an idea and get feedback on viability of this or some related addition to the language. ES should have a way to build functions at runtime - like the approach of building a string of code and using

Re: Code compilation alternative to Function()

2014-01-11 Thread Brendan Eich
fixplzsecr...@gmail.com wrote: Asm.js programs are larger than equivalent native executables Not on the (gzipped) wire: http://mozakai.blogspot.com/2011/11/code-size-when-compiling-to-javascript.html (Emscripten has improved since then, IINM.) In memory, the issue isn't executable vs. JS