Live data from Hacker News

"Hello World" in Dart, compiled to JavaScript

gist.github.com

121–130 of 162 posts

Re: "Hello World" in Dart, compiled to JavaScript

#121

Earlier quoted context omitted.

The "other tool" you mention reduces this to 2300 lines, and that's with the "remove unused code" option enabled. Still fails.

Damn... all the hello world programs I've written in dart just feel like such a waste now :[ SOMEBODY PLEASE RECOMMEND A GOOD HELLO WORLD LANGUAGE!!

Already a solved problem thanks to HQ9+: http://www.esolangs.org/wiki/HQ9

Re: "Hello World" in Dart, compiled to JavaScript

#122

This is called "a runtime". A bunch of things that have to be loaded on the target machine for use by a compiled program. Just about every compiler works this way, whether the output is machine code or JavaScript. It is possible to not emit or load the parts of the runtime which will not be used by a given program, but that's difficult and in many cases even impossible. I am not a web programmer, and I don't use JS a…

In general it's true that you can't avoid the runtime, but in this case I think people's expectations are colored by CoffeeScript, which offers (for many) a more productive environment than vanilla JavaScript, with no runtime at all. Since Dart is a CoffeeScript competitor in the "languages that compile to JS" space, this is a legitimate disadvantage. Dart may well have so many advantages over CS that this becomes a non-issue in practice, but we shouldn't pretend this isn't a story at all.

Re: "Hello World" in Dart, compiled to JavaScript

#123
post #76

Earlier quoted context omitted.

Wouldn't happen to be a Flash dev would you? I do not want the core technologies on which the web is built owned or controlled by any one company. No matter how you look at it Dart is not a standard, it's not controlled or directed by any open body and its development is not public. It took a goddamn decade to break Microsoft's endless attempts to own core web technology, if you're happy with another company doing it…

"Dart is not a standard, it's not controlled or directed by any open body" You say that like it is a bad thing. I don't think it is. Standardizing technologies is great once they are mature and are already accepted as the obvious de-facto standard, but trying to push real change through standards bodies results in exactly the sort of morass that JavaScript has been stuck in and which makes Dart a refreshing attempt a…

Mozilla has been implementing new ES Harmony features for a while. Proxies work now. Strict mode works now. Let, const, destructuring assignment, generators, they all work now. V8 hasn't gotten around to implementing a lot of that stuff, but that's its problem.

Re: "Hello World" in Dart, compiled to JavaScript

#124
post #55

Earlier quoted context omitted.

There is a legitimate point here though. If I'm a developer working on a new project, and I'm dissatisfied with JavaScript, I have a couple of options. I could try Dart, which will cost me a significant amount of performance in all browsers that aren't Chrome, or I could go with CoffeeScript, which will have good performance in all browsers (including Chrome, since Chrome will be forced by the other browser manufactu…

Anything happening in a client browser will involve a significant amount of IO - querying / modifying DOM and remote requests. I don't think that choosing Dart over CoffeeScript is going to make much of a difference for most applications. See Objective-J / Cappuccino which chose to eat the very real overhead messaging in order to gain expressiveness. How many JS apps are as responsive / elegant as 280 North Slides?

I'm referring mainly to the page load time increase, which is important, especially on mobile. (Given what I've seen of the generated code, I suspect runtime performance will be affected too, but I haven't tested, so I can't say for sure.) This is why people create microframeworks—the page load time improvement with e.g. zepto over jQuery is not insignificant.

Re: "Hello World" in Dart, compiled to JavaScript

#125
post #70

Earlier quoted context omitted.

Sorry but it's been more like Google: Hey everyone, we have decided the future, here it is, get used to it. Community: Maybe you should get behind Harmony instead of secretly building replacements to the building blocks of the web and issuing them by imperial decree.

This was explicitly announced as "work in progress", "please give us feedback", "this is the first impression" and so forth. If you read the language spec, it has "we don't know how to do this yet" and "we're requesting feedback on this" all over the place. I really fail to see the imperial decree part here. In any case, JavaScript is there, it's supported by Google (and really only has been made viable by the speed…

I think you overestimate the impact of V8 on JavaScript speed improvements. Both Apple and Mozilla were working on JITs well before V8 was announced...

Re: "Hello World" in Dart, compiled to JavaScript

#126
post #72

Earlier quoted context omitted.

Not desperate graspers? Try and count the number of libraries and frameworks that have come out in the last 5 years for JavaScript. Think of how many "to JS" solutions there are. Seriously, google that. Like 20? 25? How much "to C" solutions do you see getting on the front page of Hacker News these days? It's staggering how much 'grasping' has been happening compared to other ecosystems. It's ironic that people would…

Wow. What I'm seeing so far is the people critical being entirely reasonable (if perhaps misinformed), and the people defending Dart being positively hostile about it, calling "circle-jerk" left and right. This post takes the cake in hostility, so far, though. And what's it need defending for? Some people try to discuss the merits and flaws in a reasoned manner. The childish behaviour you speak of is entirely yours.

I'm seeing some pretty spurious arguments. The idea that semicolons would be a point of contention is mind-blowing to me.

Re: "Hello World" in Dart, compiled to JavaScript

#127
post #76

Earlier quoted context omitted.

Wouldn't happen to be a Flash dev would you? I do not want the core technologies on which the web is built owned or controlled by any one company. No matter how you look at it Dart is not a standard, it's not controlled or directed by any open body and its development is not public. It took a goddamn decade to break Microsoft's endless attempts to own core web technology, if you're happy with another company doing it…

"Dart is not a standard, it's not controlled or directed by any open body" You say that like it is a bad thing. I don't think it is. Standardizing technologies is great once they are mature and are already accepted as the obvious de-facto standard, but trying to push real change through standards bodies results in exactly the sort of morass that JavaScript has been stuck in and which makes Dart a refreshing attempt a…

> exactly the sort of morass that JavaScript has been > stuck in

You mean the one where some large corporations are doing what they can to keep it from improving?

Seriously, Google has been sabotaging all sorts of JavaScript improvements by flat-out refusing to implement them.

So in fact the "other players" _are_ directing their effort to something they perceive as better than Dart: Harmony.

As for the rest, what will "win" is not necessarily going to be based on the merits of the technology but on the strength of single-vendor tie-ins, in the usual way....

Re: "Hello World" in Dart, compiled to JavaScript

#128

This is called "a runtime". A bunch of things that have to be loaded on the target machine for use by a compiled program. Just about every compiler works this way, whether the output is machine code or JavaScript. It is possible to not emit or load the parts of the runtime which will not be used by a given program, but that's difficult and in many cases even impossible. I am not a web programmer, and I don't use JS a…

In general it's true that you can't avoid the runtime, but in this case I think people's expectations are colored by CoffeeScript, which offers (for many) a more productive environment than vanilla JavaScript, with no runtime at all. Since Dart is a CoffeeScript competitor in the "languages that compile to JS" space, this is a legitimate disadvantage. Dart may well have so many advantages over CS that this becomes a…

I agree that it's perfectly legitimate to discuss the runtime needed for Dart, and point out that it's a disadvantage that it is needed at all, or to criticize the runtime, or whatever.

What shocks me is that people who are supposed to be techies are pointing their fingers at the runtime and making monkey noises, because they apparently have never seen a language runtime or heard of the concept. Dart did not compile "Hello, world" to 17000 lines of code; most of that code has nothing to do with the specific program. And that's the usual situation for compilers, although some specific compilers can avoid that (e.g. CoffeeScript, which is a close mapping of its target architecture).

Re: "Hello World" in Dart, compiled to JavaScript

#129
This comparison is asinine at best. The runtime is bound to be bigger. And remember DART eventually will have the runtime included in Chrome and hopefully other browsers. The way things are going in the browser world, all people might actually care about is Chrome and if there is a wonderful IDE support which comes with strongly typed languages, there is a real shot at this becoming a standard.

Re: "Hello World" in Dart, compiled to JavaScript

#130

Earlier quoted context omitted.

In general it's true that you can't avoid the runtime, but in this case I think people's expectations are colored by CoffeeScript, which offers (for many) a more productive environment than vanilla JavaScript, with no runtime at all. Since Dart is a CoffeeScript competitor in the "languages that compile to JS" space, this is a legitimate disadvantage. Dart may well have so many advantages over CS that this becomes a…

I agree that it's perfectly legitimate to discuss the runtime needed for Dart, and point out that it's a disadvantage that it is needed at all, or to criticize the runtime, or whatever. What shocks me is that people who are supposed to be techies are pointing their fingers at the runtime and making monkey noises, because they apparently have never seen a language runtime or heard of the concept. Dart did not compile…

The reason we are making monkey noises and pointing fingers is because we expected a better JavaScript, not a Java that compiles to JavaScript. We already have that. It's called GWT and this is just GWT 2.0 with a pretty name.
Post reply on HN