Re:Show HN: Decaffeinate converts CoffeeScript projects to m...
by xiaoma on Monday June 19, 2017 @11:07AM
(#14587508)
HoFs are not array comprehensions and array comprehensions aren't supported in ES6.
https://gist.github.com/sleepyfox/1879845
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Re:Show HN: Decaffeinate converts CoffeeScript projects to m...
by masklinn on Monday June 19, 2017 @11:58AM
(#14587908)
> HoFs are not array comprehensions and array comprehensions aren't supported in ES6.
Neither of these is a claim I made so I'm not sure why you feel the need to point these out.
However native HoF obviate much of the need for comprehensions, especially combined with terser "arrow functions". Languages like Smalltalk or Ruby do just fine without comprehensions for instance.
Re:Show HN: Decaffeinate converts CoffeeScript projects to m...
by maxscam on Tuesday June 20, 2017 @12:41AM
(#14592250)
If you quote the fact that coffeescript has significant whitespace, list comprehension and then in response say that javascript has HoF and iteration protocol, it does sound like youre trying to counter the point, so it seems like for someone to bring up the fact that they are not identical is fair game.
Modern JS has standard HoFs (on arrays) and an iteration protocol.
> undeclared vars leaking to global scope
Strict mode (which syntactic ES6 features enable by default e.g. class contents are in strict mode always).
> baroque keywords like "with"
Which can trivially be linted away.
> ES6 did borrow many good features from CS
Not really from CS, rather from similar (much older) sources CS got them from.