Thoughts after trying 5 compile-to-JS languages

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

ES6 + Babel.js

Well, it is JS, the future one.

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!

TypeScript

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.

Haxe

CoffeeScript

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.

LiveScript

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.