Note that there are some explanatory texts on larger screens.

plurals
  1. POChoosing a Compile-to-JS language with output size as a priority
    text
    copied!<p>I'm currently working with a large-ish Javascript codebase (currently around 150k minified) which is being included on a bunch of websites. As more features have been added, it's been growing in size, so I'm now investigating ways in which the size can be reduced.</p> <p>One of the options available at the moment is switching from pure JavaScript to a compile-to-JS library. This could potentially help during development, as features such as class based OOP and compile time type checking would save us some work. However, it's important that such a change wouldn't increase the size of the codebase over working purely in JS. None of the languages I've investigated seem particularly concerned with output size. Dart looks like the nicest to work with, but the compiled output is ridiculously large. GWT introduces more problems than it solves, and the output isn't particularly pleasant to work with. I haven't tried Haxe myself, but a colleague has, and he tells me its output is very bloated. CoffeeScript seems the most promising so far, as the output is fairly standard Javascript, but it still produces larger JS files than we're currently writing by hand (although I've only tried porting small fragments of our codebase).</p> <p>Is there a compile-to-JS language that produces terse JavaScript and minifies well (especially with Google Closure), while making the development process easier? Or are we better sticking with hand written JS?</p> <p>If hand written JS is the way to go, are there any tools or techniques that can make a particularly big difference in output size? Google's closure libraries look interesting, as there's a lot of overlap in functionality between them and our our own code, but the benefit would have to be significant, as there's be a lot of work involved in switching to this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload