Re: revive let blocks

2015-06-18 Thread Herby Vojčík
Benjamin Gruenbaum wrote: Apart from complicating the engine and the grammar - what advantage does the second version have over the first one? Why do you prefer it to the first one? (Genuinely asking) I'm also not aware of any other languages that provide this (although that's not a huge

Re: revive let blocks

2015-06-18 Thread Kyle Simpson
(function (a, b, c) { }(2)) The main disadvantage of that style over the one I'm advocating for is that it visually separates the variable declaration (`a`) from its value initialization (`2`). If there's 5, 10, or more lines of code in between them, it makes it much harder to figure out

Re: revive let blocks

2015-06-18 Thread Kyle Simpson
Be aware that the way you utilize 'let' will be a breaking change. In ES5 and ES6 In addition to the fact that this feature is long since co-existing in FF and doesn't seem to have broken the web, IIUC, there was already a breaking change in ES6, with `let` and destructuring: ```js let[x] =

Re: revive let blocks

2015-06-18 Thread Herby Vojčík
Benjamin Gruenbaum wrote: From: Kyle Simpson get...@gmail.com mailto:get...@gmail.com To: es-discuss@mozilla.org mailto:es-discuss@mozilla.org es-discuss@mozilla.org mailto:es-discuss@mozilla.org Cc: Date: Thu, 18 Jun 2015 07:34:28 -0500 Subject: Re: revive let blocks (function (a, b, c)

Re: revive let blocks

2015-06-18 Thread Kyle Simpson
Apart from complicating the engine and the grammar I've tried to figure out what complications it introduces. In my imperfect analysis, it hasn't seemed like much. I've written a transpiler tool[1] that finds `let (x..) { .. }` occurrences and changes them to `{ let x.. .. }`. It was pretty

RE: revive let blocks

2015-06-18 Thread Benjamin Gruenbaum
From: Kyle Simpson get...@gmail.com To: es-discuss@mozilla.org es-discuss@mozilla.org Cc: Date: Thu, 18 Jun 2015 07:34:28 -0500 Subject: Re: revive let blocks (function (a, b, c) { }(2)) The main disadvantage of that style over the one I'm advocating for is that it visually separates the

Re: revive let blocks

2015-06-18 Thread Benjamin Gruenbaum
Apart from complicating the engine and the grammar - what advantage does the second version have over the first one? Why do you prefer it to the first one? (Genuinely asking) I'm also not aware of any other languages that provide this (although that's not a huge issue). On Jun 18, 2015, at

RE: revive let blocks

2015-06-18 Thread Gary Guo
Be aware that the way you utilize 'let' will be a breaking change. In ES5 and ES6```let(a=1) {}```is valid and it is a call to let with one argument followed by a block. Your suggestions will turn it into a let-block. In ES6 let is considered as an identifier and the meaning is created by

Re: revive let blocks

2015-06-18 Thread Bucaran
Another way: Instead of using `let` at all, why not creating a function and pass it your `a`, `b` and `c` as arguments. Nowadays I try to program without explicitly declaring any variables, hence my suggestion. ```js (function (a, b, c) { }(2)) ``` If you can post a more concrete

Re: revive let blocks

2015-06-18 Thread Bucaran
I see what you mean. I always try to favor functional-style JavaScript (creating a big expression composed of several functions, both as arguments or declared somewhere, using recursion instead of keeping state, not using control structures, no variables, etc), hence my suggestion.

Re: revive let blocks

2015-06-18 Thread Axel Rauschmayer
On 18 Jun 2015, at 15:59 , Bradley Meck bradley.m...@gmail.com wrote: (a=1)={ console.log(a) }() Is less verbose than an IIFE and keeps `this` the same. Also keeps the initialization and init of the variable in the same place. Neat trick. Caveat – you need parentheses around the

The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Mark S. Miller
On Wed, Jun 17, 2015 at 7:27 PM, Kyle Simpson get...@gmail.com wrote: I'd like to ask if there's anyone on TC39 that would be willing to champion a proposal to add the let-block (let-statement) syntax? I am not. Further, if anyone were, I would work to kill it. Here's why. The Algol,

Re: revive let blocks

2015-06-18 Thread Bradley Meck
(a=1)={ console.log(a) }() Is less verbose than an IIFE and keeps `this` the same. Also keeps the initialization and init of the variable in the same place. On Thu, Jun 18, 2015 at 8:54 AM, Boris Zbarsky bzbar...@mit.edu wrote: On 6/18/15 9:01 AM, Kyle Simpson wrote: In addition to the

Re: revive let blocks

2015-06-18 Thread Boris Zbarsky
On 6/18/15 9:01 AM, Kyle Simpson wrote: In addition to the fact that this feature is long since co-existing in FF and doesn't seem to have broken the web Firefox doesn't ship let support on the web by default yet. For example, this HTML: scriptlet x = 5;/script will result in:

Re: revive let blocks

2015-06-18 Thread Rick Waldron
On Thu, Jun 18, 2015 at 9:54 AM Boris Zbarsky bzbar...@mit.edu wrote: On 6/18/15 9:01 AM, Kyle Simpson wrote: In addition to the fact that this feature is long since co-existing in FF and doesn't seem to have broken the web Firefox doesn't ship let support on the web by default yet. For

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Brendan Eich
Good points, Mark. There are two better ways forward that I see: 1. Separate forms and make them compose well. Instead of let (x=y){z} and the grammatically unsound let (x=y)x*x from ES4, given let in ES6, and do expressions in ES7, declare victory and use `do { let x = y; z }`. 2. Sweet.js

Re: revive let blocks

2015-06-18 Thread Boris Zbarsky
On 6/18/15 11:30 AM, Rick Waldron wrote: Strange, this works in the console, but not in a script https://i.gyazo.com/e55d26495c3fe8b01938fe1b99664682.png Yep, it's entirely possible the console opts in to let. It also exposes some APIs that are not exposed in web pages by default and a few

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Greg McLeod
Very well said Mark! You've basically articulated what I've been thinking for a few years now as someone lurking amongst these lists afraid to speak up. Often times I've seen people's questions or criticisms get shut down with a link to lmgtfy often followed by an emoticon or two, which doesn't

Re: Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Benjamin Gruenbaum
First of all, brilliant post Mark. As a community, we need more of a shared sense of panic about the size that ES6 has already grown to. Ideally, that panic should increase, not decrease, with further growth from here as our size approaches the point of no return. As a community, we do - if you

Re: Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Andrea Giammarchi
I don't think JS needs many more changes as it is today. I mean it does, but mostly on browsers land, not in its core On Thu, Jun 18, 2015 at 7:27 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I like Mark's post too, and if I might ... Features like classes and `let` are very

Re: Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread C. Scott Ananian
It seem semi-obligatory at this point to cite Growing a Language, by Guy Steele. https://www.youtube.com/watch?v=_ahvzDzKdB0 Transcript at http://www.cs.virginia.edu/~evans/cs655/readings/steele.pdf (if you must). I tend to agree with the idea that at this point we need *means to grow syntax*

Re: Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Andrea Giammarchi
I like Mark's post too, and if I might ... Features like classes and `let` are very often criticised and often languages that did not add these features and are considered 'well designed' are given in comparison (Python's lack of block scoping for instance). thing is, ES6 brought in many things

Re: Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Andreas Rossberg
On 18 June 2015 at 19:26, Benjamin Gruenbaum benjami...@gmail.com wrote: This is a mailing list comprised of people who typically have a much better understanding of the language and its corners than most (even professional) developers have (and dare I say, are interested in or care about

Re: revive let blocks

2015-06-18 Thread Rick Waldron
On Thu, Jun 18, 2015 at 12:55 PM Boris Zbarsky bzbar...@mit.edu wrote: On 6/18/15 11:30 AM, Rick Waldron wrote: Strange, this works in the console, but not in a script https://i.gyazo.com/e55d26495c3fe8b01938fe1b99664682.png Yep, it's entirely possible the console opts in to let. It also

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Tim Disney
I suspect that (2) deserves a look in about a year, but welcome thoughts from Tim Disney et al (@natefaubion @jlongster). Yep, that sounds about right. Sweet.js design is all about dealing with use-cases like this; start with a small core and then grow the syntax needed for your domain. If

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Allen Wirfs-Brock
On Jun 18, 2015, at 12:18 PM, Andreas Rossberg wrote: On 18 June 2015 at 19:26, Benjamin Gruenbaum benjami...@gmail.com wrote: This is a mailing list comprised of people who typically have a much better understanding of the language and its corners than most (even professional) developers

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Morningstar, Chip
Preach it, brother! I'd like to jump on the bandwagon of Mark's concern about the death-of-a-thousand-cuts phenomenon. It is far too easy to make a bunch of small additions, each of which is individually worthy and justifiable, that collectively add up to a sum total that is not so worthy or

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread James Long
I've worked with sweet.js a lot, and someone pointed this email out to me. I can't agree more. I love all the ES6 features, and some of ES7, but looking at some of the future ES7 stuff (like decorators, etc) makes me wonder what a finished JavaScript will look like. I'm not bashing on decorators

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-18 Thread Andrea Giammarchi
And I occasionally have to go and look up details. You know nothing Allen Wirfs-Brock (cit) On Thu, Jun 18, 2015 at 8:55 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Jun 18, 2015, at 12:18 PM, Andreas Rossberg wrote: On 18 June 2015 at 19:26, Benjamin Gruenbaum

Re: Named `this` and `this` destructuring

2015-06-18 Thread Jussi Kalliokoski
On Wed, Jun 17, 2015 at 11:38 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Jun 17, 2015, at 10:01 AM, Jussi Kalliokoski wrote: ... More examples of the power of the bind syntax can be found in the links, but the bind syntax combined with my proposal would for example allow this: