Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by thatthatis on Wednesday November 13, 2013 @02:39PM
(#6727849)
Yeah, I'm aware of this and emscripten. So far, to me, they don't look viable for DOM manipulation.
[ Parent
| on HN ]
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by adambard on Wednesday November 13, 2013 @03:05PM
(#6728069)
Consider coffeescript. It does a good job at removing nuisance quirks from Javascript, and adding some python-esque features (sensible looping constructs, list comprehensions, etc.), while maintaining logical equivalence with the javascript it compiles to. (It also mirrors some of the syntactic features of ruby that make that language so appropriate for producing DSLs, which is a feature or a bug depending on your perspective)
You really can think javascript and write coffeescript.
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by spion on Wednesday November 13, 2013 @08:05PM
(#6729844)
Consider ES6 too. It also does a good job at removing some Javascript quirks and adds sensible looping constructs, list comprehensions, generators and generator comprehensions, proxies, rest/spread arguments (removing the need for the magical `arguments` identifier), classes (just sugar for what we already wire up with prototypical inheritance), modules, fat arrow functions etc.
No help on the DSL front though - still stuck with various kinds of brackets and parens.
On the other hand, it doesn't do the utterly horrible mistake of conflating variable declaration and variable assignment while forbidding shadowing, resulting with surprise bugs and spooky action at a distance.
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by adambard on Wednesday November 13, 2013 @09:24PM
(#6730135)
I like the way ES6 is going, but Coffeescript has the advantage of maintaining compatibility with old (like, old-old) browsers. I hate having to do it, but you can't just ignore them.
Server-side, sure, use the latest build you can get.
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by spion on Thursday November 14, 2013 @03:01AM
(#6731197)
There is traceur (https://github.com/google/traceur-compiler) and it can provide most of the features - except proxies.
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by thatthatis on Wednesday November 13, 2013 @03:15PM
(#6728147)
You make a convincing argument.
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li...
by adambard on Wednesday November 13, 2013 @09:25PM
(#6730139)
Thanks! If you're looking for ways to ease the burden of compiling it yourself, my favorite tools are django-pipeline (for django) and middleman (for static sites). Both of these let you treat coffeescript files as first-class while you develop.