livescript is the greatest thing to happen to programming
take it away, website blurb:
LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate.
fuck your boilerplate, it says
What?! I'M crazy? You think I'm the crazy one? I'll show you! You're crazy! All of you!
if (typeof What === 'function') { What()(I['M crazy? You think I'].m(the(crazy(typeof one === 'function' ? one(I['ll show you! You'].re(crazy()(All in you()))) : void 8)))); }
just look at how beautiful and expressive this language is
- You expect me to talk? - Oh no, Mr. Bond, I expect you to DIE!
-You(expect(me(to(typeof talk != 'undefined' && talk !== null)))); -Oh(false, Mr.Bond, I(expect(you(to(DIE())))));
you can even write natural-language sentences just like in english
livescript is ~classy as fuck~ yo
livescript === ~classy(as(bind$(fuck, 'yo'))); function bind$(obj, key, target){ return function(){ return (target || obj)[key].apply(obj, arguments) }; }
there's even a convenient flexible syntax for defining objects and lists
implicit objects are: * great * stupid * fucking incredible
implicit(objects({ are: [great, stupid, fucking(incredible)] }));
make all the lists you want
this list is: * * * * * * * fucking * * * * * * fucking * * * * * fucking * * * * fucking * * * fucking * * fucking * fucking stupid
this(list({ is: [fucking, fucking, fucking, fucking, fucking, fucking, fucking, stupid] }));
even put some numbers in there
some numbers: * 1 (* 1) ** 1 (** 1)
some({ numbers: [ 1, Math.pow((function(it){ return it * 1; }), 1), (function(it){ return Math.pow(it, 1); }) ] });
it even has a rich set of operators
5 * 5 5 * '5' '5' * 5 '5' * '5' 5 / 5 5 / '5' '5' / 5 '5' / '5' 5 - 5 5 - '5' '5' - 5 '5' - '5'
var join$ = [].join, split$ = ''.split, replace$ = ''.replace; 5 * 5; join$.call(5, '5'); '55555'; join$.call('5', '5'); 5 / 5; split$.call(5, '5'); '5' / 5; '5'.split('5'); 5 - 5; replace$.call(5, '5', ''); '5' - 5; '5'.replace('5', '');
what-~even%%&is-this??!??**oh~dear![]send{}help? /please/?? ...please?
var ref$, ref1$, ref2$, ref3$; what - ((~even) % (ref$ = Math.pow(((typeof (ref1$ = arguments.isThis != null) === 'function' ? ref1$() : void 8) != null) != null, typeof (ref1$ = (ref2$ = (ref3$ = bind$(oh, 'dear')()).send || (ref3$.send = [])).help || (ref2$.help = {})) === 'function' ? ref1$(typeof (ref1$ = /please/ != null) === 'function' ? ref1$.apply(null, typeof please != 'undefined' && please !== null) : void 8) : void 8)) + ref$) % ref$; function bind$(obj, key, target){ return function(){ return (target || obj)[key].apply(obj, arguments) }; }
well, that's about all the time we have for this lesson
hope you enjoyed this brief tour of livescript