Live data from Hacker News

"Hello World" in Dart, compiled to JavaScript

gist.github.com

71–80 of 162 posts

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

#71
post #49

same 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…

CoffeeScript is meant to be synaptic sugar on top of JS. Dart is a language with different semantics that happens to compile to JS. As such it includes a lot of runtime code. More appropriate examples would be Emscripten, Parenscript, or ClojureScript.

> synaptic sugar

Is this a typo, tongue-in-cheek, or a technical term I don't know? I've only heard of "syntactic sugar" myself.

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

#72
post #65

So the joke is that a prototype of a whole separate language has to include its runtime in its cross-compiled output? Did people... think this wouldn't be the case? Do they think that Javascript is not thousands of lines of C/C++ lurking in your browser? Good joke guys, but I don't think you realize which way the punchline is pointing... It sort of amazes me that people are being so hard on Dart, given that they shou…

"...given that they should be grasping for any chance to leave the warty and dated pile of compromises that is Javascript behind..." I would not characterize the JavaScript community as desperate graspers, but even so, I don't see the virtue in grasping for the chance to replace a dated pile of compromises with a contemporary pile of compromises. All the hate is totally overblown - this project is young and will like…

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 scoff at a well-designed replacement like Dart in its early stages. The only reason it's fashionable to do so is because it's Google. If this was some independent developer everyone would be falling over themselves to dig in.

"Oh, notch of Minecraft fame played a role? Count me in."

The mob mentality of the programming community at-large is worthy of being called despicable if only for creating precisely these sorts of regularly-scheduled circle-jerk bash sessions. The sessions I'm referring to involve "smarter than you" ass hats who walk around dumping on anything that doesn't "feel" right to them. If you want to "feel" good, go elsewhere. This is about moving the web forward.

Dear Internet, kindly get your head out of your ass.

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

#73
post #70
post #64

Earlier quoted context omitted.

Amen. The "me too" culture that's going on w/r/t Dart is really disappointing. Google: "Hey everyone, let's make the browser better by switching to something that smells less like garbage than javascript." Community: "You forgot a semi-colon!" Shameful.

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.

There was an internal memo. They're going to push it. Why do you have to "buck the man" in order to feel like you're in control of your tools? Why does it need to be repeated that everyone has a choice?

If Dart grows and solves some of the junk I have to deal with in the JS ecosystem, I will use it. We'd all be fools not to.

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

#75
post #57
post #50

Earlier quoted context omitted.

I agree CoffeeScript has nicer syntax, but it retains all of Javascript's semantic warts. Whatever quibbles you might have about Dart's syntax (it's young yet!) it's semantics are much nicer than Javascript.

Well, except for the unsound covariant generics, the lack of an arguments object, and the implicit downcasts, and so on...

Hint: Dart is a dynamically typed language. The covariant generics and the implicit downcasts are there on purpose.

The lack of an arguments object is a feature not a bug. A rest argument like in Lisp is much better for optimization. The design isn't done yet given that Dart has optional arguments a rest argument would fit in.

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

#76
post #73
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.

There was an internal memo. They're going to push it. Why do you have to "buck the man" in order to feel like you're in control of your tools? Why does it need to be repeated that everyone has a choice? If Dart grows and solves some of the junk I have to deal with in the JS ecosystem, I will use it. We'd all be fools not to.

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 just because you think they're a 'nice' company you're the fool.

There is a large, public and active effort to solve many of the issues JS has, it's called Harmony. Maybe you should get involved with that instead of jumping on a proprietary bandwagon.

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

#77
post #72
post #65

Earlier quoted context omitted.

"...given that they should be grasping for any chance to leave the warty and dated pile of compromises that is Javascript behind..." I would not characterize the JavaScript community as desperate graspers, but even so, I don't see the virtue in grasping for the chance to replace a dated pile of compromises with a contemporary pile of compromises. All the hate is totally overblown - this project is young and will like…

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…

I'll take the alleged mob mentality over Google elitism any day of the week. Google can try to move the web any direction it feels is appropriate - it's Google's time, it's Google's money - but let's be clear: JavaScript is not as deficient as you might think it is, and the JavaScript community is not dumb to expect more than what Dart has offered so far (in an admittedly short span of time).

"There are just two kinds of languages: the ones everybody complains about and the ones nobody uses."

Probably over-quoted these days, but I think we all know where JavaScript falls.

Post reply on HN