3 ms·
> The world seems to be intent on writing mountains of code to avoid writing javascript, and usually ending up with a system that compiles to more javascript th
by jschmitz28 13y ago
> The world seems to be intent on writing mountains of code to avoid writing javascript, and usually ending up with a system that compiles to more javascript than if they just wrote javascript.
Does it really matter how much javascript gets created? That statement could be made for any higher level language where X lines of the higher level language compiles into 5X lines of the target language. Maybe you could hand write your program in the target language using only 4X lines, but the point of the higher level language is to make it easier for the programmer to avoid mistakes as well as reduce source code size, not necessarily compiled code size.
- discreteevent 13y agoExcept that when JavaScript is the target code size does matter because it has to come up over the wire no? That's why something like Dart advertises the fact that it does tree shaking. (Elm may aim for the same efficiency who knows?)
- chongli 13y agoYou can do tree shaking in JavaScript with tools like Google Closure Compiler and uglifyjs (a bit more limited). Any language which compiles to JavaScript aught to be able to make use of these tools.