Re: Backwards compatibility and U+2E2F in `Identifier`s

2013-08-23 Thread Brendan Eich
Thanks for filing. I don't recall any reason for this and it seems bad to break compatibility. It may be that Norbert and Allen just missed your post on Monday; cc'ing them. /be Mathias Bynens wrote: On 19 Aug 2013, at 11:25, Mathias Bynensmath...@qiwi.be wrote: After comparing the

Re: Re: Optional named arguments

2013-08-23 Thread Michaël Rouges
Hi all, Thanks for your answers. Domenic Denicola sent me an example by email, but I don't understand it all. I waited for his response, but seemed busy, I turn back to you. The sample :

The generator.next() method

2013-08-23 Thread Michaël Rouges
Hello everyone, I wondered why it would be possible to send only one variable via this method? Knowing that we will have the opportunity to use destructuring assignments, why can't we deal on this problem? Thanks in advance. ___ es-discuss mailing

Re: The generator.next() method

2013-08-23 Thread Forbes Lindesay
It already is dealt with via destructuring assignments: ```js function* gen() { var {x, y, z} = yield [1, 2, 3] return x y || z } var g = gen() var [a, b, c] = g.next().value assert(a === 1) assert(b === 2) assert(c === 3) var res = g.send({x: true, y: false, z: true}).value assert(res ===

Re: The generator.next() method

2013-08-23 Thread André Bargull
`g.next()` returns `{value: [1, 2, 3], done: false}` for me, so .value is needed here. Or do you mean something else? Thanks, André No .value anywhere, though. /be Forbes Lindesay wrote: / It already is dealt with via destructuring assignments: // // ```js // function* gen() { // var

Re: The generator.next() method

2013-08-23 Thread Forbes Lindesay
I just wanted to demonstrate the point, I couldn't remember what the exact API agreed upon for `gen.send` is. On 23 Aug 2013, at 10:07, Andr? Bargull andre.barg...@udo.edumailto:andre.barg...@udo.edu wrote: `g.next()` returns `{value: [1, 2, 3], done: false}` for me, so .value is needed here.

Re: Optional named arguments

2013-08-23 Thread Forbes Lindesay
The `=` operator in the object declaration is defining defaults for the destructuring. If the object being destructured doesn't have that property, the value on the right hand side of the `=` operator is used. The `= {}` provides a default object to de-structure, making the entire argument

RE: The generator.next() method

2013-08-23 Thread Domenic Denicola
I believe .value is indeed correct, although as André alludes to, .send() has been replaced by .next(). [Working example in Traceur][1] (this is fun!) [1]:

new ES6 spec. draft now available

2013-08-23 Thread Allen Wirfs-Brock
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_23_2013_draft Changes include: Added Number.isSafeInteger Added Number.MAX_SAFE_INTEGER Removed: Number.MAX_INTEGER Removed: Number.toInteger Define all parts of a class definition to be strict code ‘length’ property

Optional Strong Typing

2013-08-23 Thread J B
Is there any particular reason my JS doesn't support (optional) AS3 style strong typing? All the typing info would be ignored at run-time, but it would be helpful for compile-time checking, code hinting, and general readability of code. Tools like the closure compiler could even strip out all the

Re: new ES6 spec. draft now available

2013-08-23 Thread Michael Dyck
On 13-08-23 08:51 AM, Allen Wirfs-Brock wrote: http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_23_2013_draft When I view the PDFs in Adobe Reader, most of the body text is rendered in Adobe Sans MM, which is what it substitutes when it can't locate the original

Re: new ES6 spec. draft now available

2013-08-23 Thread Jason Orendorff
On Fri, Aug 23, 2013 at 10:51 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_23_2013_draft The HTML version is now available: https://people.mozilla.com/~jorendorff/es6-draft.html As always, bug reports are greatly

Re: Optional Strong Typing

2013-08-23 Thread Jeremy Martin
I haven't personally used it, but you may find that TypeScript provides what you're looking for: http://www.typescriptlang.org/ On Fri, Aug 23, 2013 at 1:26 PM, J B por...@gmail.com wrote: Is there any particular reason my JS doesn't support (optional) AS3 style strong typing? All the typing

Re: Optional Strong Typing

2013-08-23 Thread J B
I'm aware of TypeScript, as well as all of these: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS But those languages appear to have been created precisely because ECMAScript lacks features like typing. How many of those languages offer strong typing? I count

Re: Optional Strong Typing

2013-08-23 Thread J B
So the defacto response for large scale JS development will always be: Use X? On Fri, Aug 23, 2013 at 12:35 PM, Jeremy Martin jmar...@gmail.com wrote: I haven't personally used it, but you may find that TypeScript provides what you're looking for: http://www.typescriptlang.org/ On Fri, Aug

RE: Optional Strong Typing

2013-08-23 Thread Domenic Denicola
In general ECMAScript lacks lots of features. You may well ask why it doesn't have any other pet feature, and you can often point to compile-to-JS languages that add those. This doesn't imply that the feature should be added to the language. Here, let me try: --- I'm aware of LispyScript, as

Re: Optional Strong Typing

2013-08-23 Thread J B
For one, I wouldn't describe strong typing as a pet feature. Two, no, as far as I know, most of those languages in that list don't offer macros or lots of parentheses; and, if they did, then, yeah, maybe it does say something. On Fri, Aug 23, 2013 at 12:41 PM, Domenic Denicola

Re: Optional Strong Typing

2013-08-23 Thread J B
And just to be clear, I'm not asking for run-time type checking or coercion; I'm simply asking that the interpreter not to thrown an error when it encounters something like this: var foo:String; On Fri, Aug 23, 2013 at 12:45 PM, J B por...@gmail.com wrote: For one, I wouldn't describe strong

Re: Optional Strong Typing

2013-08-23 Thread Jeremy Martin
var foo:String; That's already a compile-time error (as opposed to runtime not sure if that's what you meant by the interpreter throwing an error). On Fri, Aug 23, 2013 at 1:56 PM, J B por...@gmail.com wrote: And just to be clear, I'm not asking for run-time type checking or coercion;

Re: Optional Strong Typing

2013-08-23 Thread J B
Are you referring to browsers like Chrome that compile the JS first? Then, yeah, I mean it shouldn't throw an error at compile time. On Fri, Aug 23, 2013 at 12:59 PM, Jeremy Martin jmar...@gmail.com wrote: var foo:String; That's already a compile-time error (as opposed to runtime not

Re: Optional Strong Typing

2013-08-23 Thread Axel Rauschmayer
Evolving a language standard used as broadly as ECMAScript takes time. You can see TypeScript as exploring future options for ECMAScript. Guards [1] may still be added to ECMAScript, I don’t know what the current TC39 opinion is on them. Lastly, TypeScript tracks JavaScript very closely, I

Re: Optional Strong Typing

2013-08-23 Thread Jeremy Martin
I mean it's a parse error that will throw prior to attempting to execute it. For example, consider: (function() { var foo:String; }) This will throw an error, despite the fact that the function hasn't been invoked. I replied in haste, though... your point is obviously valid for other

Re: Optional Strong Typing

2013-08-23 Thread J B
@Jeremy: I mean the parser will strip all of the typing info out before it's compiled/interpreted. @Axel: Evolving a language standard used as broadly as ECMAScript takes time -- I agree. You can see TypeScript as exploring future options for ECMAScript. -- Wasn't AS3 already doing this? Guards

Re: The generator.next() method

2013-08-23 Thread Brendan Eich
Domenic Denicola wrote: [Working example in Traceur][1] (this is fun!) Yes, +lots for Traceur. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: The generator.next() method

2013-08-23 Thread Brendan Eich
André Bargull wrote: `g.next()` returns `{value: [1, 2, 3], done: false}` for me, so .value is needed here. Or do you mean something else? Sorry (to Forbes), I was thinking of when for-of orchestrates. /be Thanks, André No .value anywhere, though. /be Forbes Lindesay wrote: / It

Re: Optional Strong Typing

2013-08-23 Thread Brendan Eich
Has everyone forgotten ES4? Blasts from the past: https://brendaneich.com/2007/11/my-media-ajax-keynote/ and then https://mail.mozilla.org/pipermail/es-discuss/2008-August/006837.html ES4 failed in part because of AS3 namespaces (from original JS2/ES4 namespaces in 1999, also in JScript.NET

Re: Optional Strong Typing

2013-08-23 Thread Jeremy Martin
I mean the parser will strip all of the typing info out before it's compiled/interpreted. The implication being that implementors start shipping static compilers where this parsing/stripping takes place (i.e., as a precursory step to being interpreted)? but it's been made worse by ECMAScript's

Re: Optional Strong Typing

2013-08-23 Thread J B
Also, unlike other language features, static typing has it's own section in that list; and they're not all in that section: Some of the ones listed below are also statically typed, such as mobl, GWT, JSIL, NS Basic, and Haxe. So, yeah, I don't think it qualifies as a pet feature. None of this

Re: Optional Strong Typing

2013-08-23 Thread J B
@Brendan - The typing wouldn't be used at all during run-time. So, unlike AS3, it wouldn't check if types were valid, and it wouldn't try an kind of implicit coercion. @Jeremy - The implication being that implementors start shipping static compilers where this parsing/stripping takes place (i.e.,

Re: Optional Strong Typing

2013-08-23 Thread Brendan Eich
J B wrote: @Brendan - The typing wouldn't be used at all during run-time. So, unlike AS3, it wouldn't check if types were valid, and it wouldn't try an kind of implicit coercion. Ok, that's not typing (I mean not a type system). Those are warnings, but WarnScript was a bad name - me at

Re: Optional Strong Typing

2013-08-23 Thread J B
@Brendan Those are warnings, but WarnScript was a bad name --you mean the tools (IDEs, closure compiler, etc) throw warnings, but not the Chrome debugger, for instance, right? On Fri, Aug 23, 2013 at 2:37 PM, Brendan Eich bren...@mozilla.com wrote: J B wrote: @Brendan - The typing wouldn't

Re: Optional Strong Typing

2013-08-23 Thread J B
https://brendaneich.com/2007/11/my-media-ajax-keynote/ I liked reading this... https://mail.mozilla.org/pipermail/es-discuss/2008-August/006837.html This is depressing. On Fri, Aug 23, 2013 at 2:50 PM, J B por...@gmail.com wrote: @Brendan Those are warnings, but WarnScript was a bad name

Re: Optional Strong Typing

2013-08-23 Thread Angel Java Lopez
TypeScript are a move from Microsoft to become JavaScript more friendly to VisualStudio developers. And to try typed scenarios. I'm a VisualStudio-developer, and for years, I didn't need typed JavaScript (as I didn't need type Python or Ruby). I feel that is the case with many developers. I

Re: Optional Strong Typing

2013-08-23 Thread Kris Kowal
On Fri, Aug 23, 2013 at 1:20 PM, J B por...@gmail.com wrote: https://mail.mozilla.org/pipermail/es-discuss/2008-August/006837.html This is depressing. J B, You’re entitled to a dissenting opinion. However, this archives one of the best moments for the evolution of the language. It was a

Re: Optional Strong Typing

2013-08-23 Thread J B
That said, note that your sentiment has been graciously heard. What you are asking for is well-represented by rigorous research going into TypeScript, which is very closely aligned with work and proposals that came out of these discussions. I believe it is fair to interpret Brendan’s last

Re: Optional Strong Typing

2013-08-23 Thread Brendan Eich
On Aug 23, 2013, at 1:20 PM, J B por...@gmail.com wrote: On Fri, Aug 23, 2013 at 2:50 PM, J B por...@gmail.com wrote: @Brendan Those are warnings, but WarnScript was a bad name --you mean the tools (IDEs, closure compiler, etc) throw warnings, but not the Chrome debugger, for instance,

Re: Optional Strong Typing

2013-08-23 Thread Brendan Eich
Brendan Eich wrote: The Chrome dev tools (Firefox devtools, etc.) can cope -- but the burning question is: will we have more type confusion bugs or fewer if we standardize warning annotations. /be ___ es-discuss mailing list

Re: The generator.next() method

2013-08-23 Thread Forbes Lindesay
I'd rather be corrected when I'm right than ignored when I'm wrong, and at the moment I'm still pretty new to the specifics of ES6 APIs :) On 23 Aug 2013, at 19:44, Brendan Eich bren...@mozilla.com wrote: André Bargull wrote: `g.next()` returns `{value: [1, 2, 3], done: false}` for me, so