However! The aforementioned LiveScript (a fork of Coco, itself a fork of CoffeeScript purportedly addresses all of those things and more besides – particularly the scoping issue. From the documentation:
If you are modifying variables in upper scopes at any time, eg.x = 10 do -> x = 5
you must use
:=instead of just
=as that will declare a new (shadowing) variable in LiveScript. Thus, the above code would need to bex = 10 do -> x := 5
if you wanted to modify
It isn’t as widely adopted as CoffeeScript, but lots of things that are good for you aren’t as popular as they should be. (And it’s popular enough to have a vim and a TextMate / Sublime Text bundle, so the important bits are covered.)
We’ll see how it works in the (my) real world.