Goodbye, CoffeeScript, we hardly knew you

The scoping issues in CoffeeScript (well-described in Armin Ronacher’s blog post), along with various other oddities and difficulties, have led me to conclude that it is not usable as a general-purpose JavaScript semi-replacement.

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 be

x = 10
do ->
  x := 5

if you wanted to modify x

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.