6 ms·
I am assuming that CoffeeScript should be able to add new syntax where the need arises, as the number of CoffeeScript users is probably still pretty low and abl
by apg 15y ago
I am assuming that CoffeeScript should be able to add new syntax where the need arises, as the number of CoffeeScript users is probably still pretty low and able to adapt to change.
From what I can tell, CoffeeScript - and the Javascript/Node world - would really benefit from something like F#'s workflow/computation-expression syntax, which will take a fairly straight-forward readable statement and behind the scenes de-sugar the hell out of it into a bunch of closures.
http://en.wikibooks.org/wiki/F_Sharp_Programming/Computation_Expressions http://en.wikibooks.org/wiki/F_Sharp_Programming/Computation...
EDIT: search for "De-sugared syntax" on this page for an example.
- jashkenas 15y agoThat's correct -- because we compile to "standard" JavaScript, we're at least somewhat comfortable introducing significant changes (even to the syntax) where desirable. Even if you never get around to updating older pieces of code, all of the compiled JS continues to be fully compatible and interoperable with the newer stuff.
- ufo 15y agoWhere is the love for [Deferreds?](http://www.sitepen.com/blog/2010/05/03/robust-promises-with-dojo-deferred-1-5/ http://www.sitepen.com/blog/2010/05/03/robust-promises-with-...)? Deferreds are * Mostly monadic (creating a deferred is "return", the "then" method is "fmap" and "bind"). * Can be implemented as a library, without a separate compilation step or having to patch the runtime. * Avoids most of the CPS inversion of control madness. You can return and store promises and you can also add callbacks after the fact so code is much more flwxible. (writing sequential async loops is still annoying though)