Either that, or I don't want to surf this internet anymore.
"Hello World" in Dart, compiled to JavaScript
41–50 of 162 posts
Re: "Hello World" in Dart, compiled to JavaScript
#42Earlier quoted context omitted.
This is false. It is like claiming that it "should" really compile to just console.log("Hello,Darter!"); They're functionally equivalent so why not right? Dart was designed for big apps. Google is not aiming at optimizing all the Hello World pages. Every single framework in existence has terrible size characteristics for Hello, World. Loading all of Foundation and UIKit for showing Hello World on the screen in iOS? I…
Well, Dart is designed to replace JavaScript as the client side Web scripting language of choice. Given that goal, they need to do well at small projects as well as large ones.
Re: "Hello World" in Dart, compiled to JavaScript
#43Wow. Reminds me of GWT...
I think GWT is a great piece of tech. To be honest, google has way too much NiH syndrome, even internally...
Re: "Hello World" in Dart, compiled to JavaScript
#44I don't understand why Dart is supposed to be good, someone please explain it to me like I'm an eight-year-old
It's like Go: "It's from google, so awesome by default".
Re: "Hello World" in Dart, compiled to JavaScript
#45Funny. But to be fair, a Hello World in C compiles to a 27k binary. Yeah yeah, optimize this, leave out that and you can get it smaller. Still doesn't change the fact that Hello World is not the target use-case for either C or Dart. Dart is intended for very large applications (compared to JS), so the additional weight for includes isn't that big of a deal. It also doesn't change the fact that Dart sucks. For other r…
Re: "Hello World" in Dart, compiled to JavaScript
#46I 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.
As I understand it, dart isn't trying to be a faster javascript. Its trying to be a better GWT. Many googlers I've spoken to firmly believe that you need a strongly typed, OO language with good tooling to be able to develop any large application. They believe web apps are no exception. Google has worked hard adding types to javascript with the closure compiler. But, there are limits to what you can achieve using java…
It isn't trying to be a javascript, but it's certainly trying to be faster. Performance features prominently in every statement of their design goals. Not only that, but performance in all modern browsers - i.e. including the ones they don't control and won't ship with a Dart VM. I don't see how they can possibly pull that off. Can anybody?
Re: "Hello World" in Dart, compiled to JavaScript
#47Earlier quoted context omitted.
[deleted]
Which is a one time cost - and roughly the same you pay for including any other framework out there.
Re: "Hello World" in Dart, compiled to JavaScript
#48same code in coffeescript (@ preceding testMain makes it a static method and it looks like print in Dart converts to console.log) class HelloCoffeeTest @testMain: -> console.log "Hello, Coffee!" HelloCoffeeTest.testMain() resulting js var HelloCoffeeTest; HelloCoffeeTest = (function() { function HelloCoffeeTest() {} HelloCoffeeTest.testMain = function() { return console.log("Hello, Coffee!"); }; return HelloCoffeeTes…
Does CoffeeScript have all these data structures, http://www.dartlang.org/docs/api/index.html ?
zip = lottery.drawWinner?().address?.zipcode
Hey look, I know they're not really comparable. They're solving different problems, are at different stages in maturity and have a different philosophy on how to do things. I also think that Hello World is probably the worst way to compare any two languages, but it's a fun exercise anyway[0] example code from http://jashkenas.github.com/coffee-script
Re: "Hello World" in Dart, compiled to JavaScript
#49same code in coffeescript (@ preceding testMain makes it a static method and it looks like print in Dart converts to console.log) class HelloCoffeeTest @testMain: -> console.log "Hello, Coffee!" HelloCoffeeTest.testMain() resulting js var HelloCoffeeTest; HelloCoffeeTest = (function() { function HelloCoffeeTest() {} HelloCoffeeTest.testMain = function() { return console.log("Hello, Coffee!"); }; return HelloCoffeeTes…
Re: "Hello World" in Dart, compiled to JavaScript
#50I don't understand why Dart is supposed to be good, someone please explain it to me like I'm an eight-year-old
It's not right now. It's a lousy CoffeeScript. The thing that makes dart good is that it could, some day, have it's own runtime. Also, the language is being designed by the team that did v8. So I'd imagine they plan to build support into chrome at some point.