"Hello World" in Dart, compiled to JavaScript
gist.github.com
"Hello World" in Dart, compiled to JavaScript
1–10 of 162 posts
Re: "Hello World" in Dart, compiled to JavaScript
#2Re: "Hello World" in Dart, compiled to JavaScript
#3Re: "Hello World" in Dart, compiled to JavaScript
#4Re: "Hello World" in Dart, compiled to JavaScript
#5So, something that lets people who don't understand JavaScript "compile" some other language into JavaScript, is horribly inefficient. Wow, what a surprise.
Re: "Hello World" in Dart, compiled to JavaScript
#6I wonder if the only speed benefits that the Dart VM gives would be able to be beaten out by a smart compiler. I know this is early for the cross-compilation code (it doesn't trim out anything it doesn't need here), but I hope this isn't what is ultimately used in that comparison.
Re: "Hello World" in Dart, compiled to JavaScript
#7Re: "Hello World" in Dart, compiled to JavaScript
#8Right now, it's probably designed to be run through something like Closure Compiler, which removes dead code and minimizes the output.
Re: "Hello World" in Dart, compiled to JavaScript
#9There's this interesting tool called Google Closure Compiler. It does dead code elimination. https://gist.github.com/1277285
Notice that this source is now 2000 lines of pretty printed JS. Given that anything interesting these days uses jQuery or Underscore.js clientside, and similar things serverside, this amount of JS for even Hello World is standard fare.
EDIT: To be clear, I don't really give two hoots about Dart ... yet. I use ClojureScript and since ClojureScript ships with a similarly rich API / data structure set, Google Closure Compiler is essential to keeping code size down.
Re: "Hello World" in Dart, compiled to JavaScript
#10I'll repeat what I said in the GitHub thread: There's this interesting tool called Google Closure Compiler. It does dead code elimination. https://gist.github.com/1277285 Notice that this source is now 2000 lines of pretty printed JS. Given that anything interesting these days uses jQuery or Underscore.js clientside, and similar things serverside, this amount of JS for even Hello World is standard fare. EDIT: To be c…