After 6 months of work, LiveScript 1.0.0 has been released!
LiveScript is a language which compiles to JavaScript. It is a fork of Coco which is in turn derived from CoffeeScript. Like those two it has a relatively straightforward mapping to JavaScript. LiveScript is Coco but much more compatible with CoffeeScript, more functional, and more feature rich. LiveScript aims for increased expressiveness and code beauty.
While adding features to assist in functional style programming, LiveScript also deeply supports imperative and object oriented programming, and has an optional class system with inheritance, calls to super, and more.
For more information, check out the LiveScript site.
The 1.0.0 release means that LiveScript is ready for primetime! It means stability and large advance notice of any backward incompatible changes.
Many people are already using LiveScript! Here is a partial list of some I've found:
Have a project written in LiveScript? Add it to the wiki page.
1.0.0 brings many changes - the following is a sample of them, for the full list check out the changelog.
Cascade - beautiful chaining:
a = [2 7 1 8] ..push 3 ..shift! ..sort! a #=> [1,3,7,8] document.querySelector \h1 ..style ..color = \red ..fontSize = \large ..innerHTML = 'LIVESCRIPT!'
var x$, a, y$; x$ = a = [2, 7, 1, 8]; x$.push(3); x$.shift(); x$.sort(); a; x$ = document.querySelector('h1'); y$ = x$.style; y$.color = 'red'; y$.fontSize = 'large'; x$.innerHTML = 'LIVESCRIPT!';
You can now set defaults for destructured parameters, functioning like Python's keyword arguments.
setCords = ({x = 1, y = 3} = {}) -> "#x,#y" setCords y: 2, x: 3 #=> '3,2' setCords x: 2 #=> '2,3' setCords y: 7 #=> '1,7' setCords! #=> '1,3'
var setCords; setCords = function(arg$){ var ref$, ref1$, x, y; ref$ = arg$ != null ? arg$ : {}, x = (ref1$ = ref$.x) != null ? ref1$ : 1, y = (ref1$ = ref$.y) != null ? ref1$ : 3; return x + "," + y; }; setCords({ y: 2, x: 3 }); setCords({ x: 2 }); setCords({ y: 7 }); setCords();
where
is like let
, but defined after the body. It also is slightly different in that it allows for nested variable declarations.
result = x + y where x = 4, y = x + 1 #=> 9
var result; result = (function(x, y){ x = 4; y = x + 1; return x + y; }.call(this, void 8, void 8));
For more see the changelog.
LiveScript would not have been possible without many of your contributions and support. Thank you!
Many people have started using LiveScript in their projects - you can check out a partial list of projects written in LiveScript, and projects which support LiveScript.
Have any ideas or suggestions? You can create a ticket on GitHub or ask general questions at the LiveScript Google Group.
And finally, for more information, check out the LiveScript site.
For more on LiveScript and prelude.ls, follow @gkzahariev.
comments powered by Disqus