JavaScript is a mess. And using a compile-to-JS langauge is an interesting approch to fix it. Recently I had a simple JavaScript homework, and that was a great chance to try few compile-to-JS langauges. The homework was too simple that I wasn’t able to try out all features of the languages, but it was already fun enough.
Source code here: https://github.com/b123400/csci4140-youtube-remote
Well, it is JS, the future one.
=>
and let
make things cleaner. I find myself don’t need a new this
for functions except for class methods, and with the help of class
syntax, the whole document is now free of function
!Generally a better version of JS, not ground breaking. Looking forward to what can kind of good use can the community comes up with iterator and generator. Flow control should be more interesting when ES6 is popular!
A very safe approch to improve JS, especially for people who want to make their code safer but don’t know where to start with. It takes longer time to code in TypeScript, but it’s worth. You can check Facebook’s Flow for typing JS as well.
for of
and for in
)CoffeeScript was a great tool when I first touched it, it makes coding very fast, because you can write common patterns with very few characters. For example a?.b?.c?()
instead of checking null for every layer, auto return and non-scoped function =>
are cool as well. However, I find it not very future-prove, for example generator tooks 2 years to integrate, and we are dragged behind because of IE8 compatibility. They decided they are not going to add new things until all browsers support it, and that can be a trouble if you want to use new functions. If you let me choose today, I will start any all projects with ES6 over CoffeeScript.
I like this language the most among the five
CoffeeScript’s friend, very much alike
Haskell inspired prelude-ls, I like it
It makes functional programming in JS happier (Piping|>
)
Back arrow <-
fits the callback-based design of Node.js very well.
They are open to add new things into the langauge (Generator, lots of new operator like >>>
and >>>>
, build in functions like import
)
Put pattern into language (e.g. currying, dash-var-name compiles to camelCase)
Platform awared design (require!
and export
keywords for Node.js)
Does have quirks, so be careful
a[1 to 1] = []; // a[1] = [];
a[x to x] = []; // a.splice(x,1);
Generated JS is more difficult to read than CoffeeScript
LiveScript is a very cute tool to try out for some pet projects, but if you are really serious about your project in the future, ES6 / TypeScript is the choice.