Live data from Hacker News

"Hello World" in Dart, compiled to JavaScript

gist.github.com

111–120 of 162 posts

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

#111
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…

"well-designed" is actually the point of contention, is it not? You're blithely asserting facts not in evidence.

Smart, experienced people "taking a dump" on things that "don't feel right" to them are in fact valuable and worth paying attention to (even if you ultimately ignore them).

There are many, many cases of teams of brilliant people producing deeply flawed stuff that turns out to be useless. Apple's ATG produced many useless products on top of Lisp back in the day (SK8, Dylan,...). Dylan in particular was "well-designed" for certain values of "well-designed" that turned out to be insufficient — time will tell, but don't assume talent + money -> useful.

Google right now "feels" a lot like Apple ca. 1993.

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

#112
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.

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 improvements triggered by V8's development), it's not like anyone is taking anything away.

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

#113
post #97

Oooooooo. So it's Javascript except with a highly constraining layer of blub on top of it. I'll go back to learning coffeescript then...

I'd say the gist demonstrates that it's not Javascript. What you see is the entire runtime, compiled to naive js. If anything, Coffeescript is "just" js with syntactic sugar. Not that there is anything wrong with that.

that's a really interesting comment. where exactly is the line drawn between "just syntactic sugar" and "a different language"?

Here we have two ways of expressing code, coffeescript and dart. Both are syntactically quite different from js, both offer features not found in js, both encourage you to write code differently to how you would in js and both compile to plain js.

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

#114
post #50

Earlier quoted context omitted.

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.

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.

I agree CoffeeScript has nicer syntax, but it retains all of Javascript's semantic warts

that comes across as both patronising and ignorant (although it could be me who's the latter). any examples of "all Javascript's semantic warts" coffeescript retains?

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

#115
Google Dart was designed to build large scale web applications, yet all their demos and example code only includes small applications. That still require quite a lot of code to build.

I don't see any profit of building a application in dart, if you have to create more code your self than you would with a regular HTML5 based application.

As this "Hello World" demo shows, the only thing It's good at is creating bloat and this will probably stay this way until native parsers are implemented.

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

#116

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…

[deleted]

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

#118
post #25

As me1000 (Randy Luecke) says Dart is not meant for hello world. If you run this through closure-compiler it's reduced to 2000 lines which is nothing next to Underscore, jQuery, Dojo, etc. We all know the benefits of offloading code to a well known and well tested library or framework, especially if you're writing an app that is thousands of lines anyway. How is this contentious at the end of 2011 unless you're just…

> If you run this through closure-compiler it's reduced to 2000 lines > which is nothing next to Underscore, jQuery, Dojo, etc. jQuery is 9000 lines, uncompressed with all the comments. I call that about the same order of magnitude as the things you mention, hardly "next to nothing". Additionally, just about every line in jQuery is actually useful for something, even the optimized code seems to mostly consist of a wh…

  > "There is more to software development than performance." 
On the other hand, development is all about performance.

It's just a matter of what we mean by "performance". Time to run? Time to develop? Adoption rate? Income generated? Fame?

Software is always about doing something better. The controversy comes when we try to evaluate "better."

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

#119
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 and don't plan to use Dart, but I am flabbergasted that a bunch of techies are going wild and posting facepalm pictures over a perfectly normal technical situation. Maybe Google will pare down the runtime in the future, maybe they will figure out a way to exclude parts of it which are not needed, but right now they are just making the default technical choice that just about all compilers make. This is a non-story. Compile "Hello world" into an executable, and see how many kilobytes it takes on most architectures, despite the object file being a few bytes. Geez.

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

#120
post #81

Earlier quoted context omitted.

I'm sorry, but 2,300 lines of code is in no way acceptable as a "dead code"-eliminated Hello World program. Not by a longshot.

$ cat hello.c int main() { printf("Hello, world!\n"); } $ gcc hello.c $ ls -l a.out -rwxr-xr-x 1 brian staff 8.5K Oct 11 02:23 a.out* And that's compiled code! And it also links to libc! But then again, any JS program requires tons of compiled C/C++ code to run.

That's dynamically loaded, try it with the runtime

    $ gcc hello.c
    $ ls -l a.out
    -rwxr-xr-x 1 maht maht 4511 Oct 11 16:38 a.out
    $ gcc --static hello.c
    $ ls -l a.out
    -rwxr-xr-x 1 maht maht 574106 Oct 11 16:38 a.out
Post reply on HN