Live data from Hacker News

Dart is ready for the real world

arstechnica.com

21–30 of 53 posts

Re: Dart is ready for the real world

#21
From the editor-promoted comment:

Why are we bothering with developing new languages when what we should be doing is developing a web standard for a universal bytecode + VM? Hell, use the JVM or the CLR, just as long as it doesn't tie me to a specific language. Dart may be better than JavaScript (I would hope so) but that doesn't mean it's a silver bullet. If we create a standardized bytecode, it doesn't matter what language produced it.

I've been thinking about something like this for a long time. However, the question came up in an interview or presentation with either Brendan Eich or Douglas Crockford (I can't remember exactly where I read this) about why Javascript won out over a VM solution (supposedly this is what the JVM was made for). The most salient argument against a universal VM was that maintaining backwards compatibility between byte-code versions and the competing eco-system of languages would have been a nightmare. Instead the web targeted a single language (and all the trouble that has been along with it). I would rather like to see other languages on the web but I don't think a browser is good place to do it.

Instead what I'd rather see is http://www.cs.cornell.edu/home/ulfar/cuba/paper/ -- work could be done to improve that initial design, but the idea IMO is that the OS already handles processes and allocating memory well and the browser vendors are terrible at this task by comparison.

Either way, Dart is an interesting experiment and I'd give it a shot on some prototyping projects.

Re: Dart is ready for the real world

#22
post #7

Honestly I still don't see the point of Dart. It's made some strange choices (IMHO) like optional typing. The idea that code can be shared between client and server is the panacea touted by GWT, which (IMHO) failed to eventuate (eg some classes weren't "GWT compatible" and this included protocol buffers generated classes). Dart seems like the next throw of the dice. I am not optimistic about its successes. Go on the…

Dart was actually created by the guys who created V8. They gave a great interview about it in episodes 8[1] and 8.1[2] of Javascript Jabber.

1: http://javascriptjabber.com/008-jsj-v8-and-dart-with-lars-ba...

2: http://javascriptjabber.com/008-1-v8-and-v8-and-dart-with-la...

Re: Dart is ready for the real world

#23

Earlier quoted context omitted.

There are middle grounds between unsafe manual memory management and full garbage collection other than atomic reference counting. Region systems (like in Cyclone and Rust), for example.

You can also integrate unsafe manual memory management with a full garbage collector in environments like .NET. Use the GC for 99% of your code, manually malloc/free/pin the other 1%.

One of the more elegant ways of handling this, .net does a great job of integrating with unmanaged (COM, i'm looking at you) resources.

Re: Dart is ready for the real world

#24
The problem with Dart, is right there in its feature sheet - advertised as something good; "compiles to JS". Have you ever worked with GWT? I did so years ago when it was much promising, 5 minute compile time for a small web-app on a core-duo... Whereas with js I could just alt-tab and hit F5. Or in the worst possible scenario I would to grap clear the cache first.

"Compiles to JS" means that testing in any browser other than Chrome is going to be a painful activity compares to simply writing js. If Chrome reaches 70-80% market share or if they manage to pull of something like in-browser Skyrim made with Dart, it might stand a change. Otherwise we 'll be here in 2 - 3 years saying "Remember Dart? Such a sad sad trainwreck...".

Re: Dart is ready for the real world

#25
post #7

Honestly I still don't see the point of Dart. It's made some strange choices (IMHO) like optional typing. The idea that code can be shared between client and server is the panacea touted by GWT, which (IMHO) failed to eventuate (eg some classes weren't "GWT compatible" and this included protocol buffers generated classes). Dart seems like the next throw of the dice. I am not optimistic about its successes. Go on the…

>It's made some strange choices (IMHO) like optional typing.

Yes, this may look a bit weird, but it actually makes perfect sense. Those types are annotations. If you use them at the "API boundaries" (parameters and return values), you already get most of the benefits you may know from Java or C#.

Compare the doc comments you usually have to write with those baked-in type annotations:

    /**
     * Foos the bar.
     * @param {int} x
     * @param {int} y
     * @returns {String}
     */
    function foo (x, y) {
        ...
    }
vs

    /// Foos the bar.
    String foo (int x, int y) {
        ...
    }
Much better, isn't it?

Additionally, adding those type annotations is useful right off the bat. The IDE will make use of them right away.

>Go on the other hand [...]

Well, Go is very different. It has a completely different focus. It's more like Rust, for example.

Re: Dart is ready for the real world

#26
I was at this. I was really looking forward since listening to the Javascript Jabber podcast (http://javascriptjabber.com/008-1-v8-and-v8-and-dart-with-la...) about it.

Less than 1/3 through I decided to started to zone out. I don't understand why you need a VM to compile something into Javascript. Also the optional typed language feature is just odd (okay I can see working in groups and wanting to empirically let other developers what type a variable is), but it's just not something I see myself wanting to learn to do what I already know.

I was also interested in the Angular talk, which was good, but it left me thinking Angular is to CakePHP in the MV* javascript world with all the built-in automagic.

Overall some pretty good talks at this.

Re: Dart is ready for the real world

#27

I was excited about Dart, until I saw how many lines of code the JavaScript output was for one of its simple examples. And then I completely lost interest when I started structuring my code well, and realised that I didn't need it as much as I thought.

The output is more optimized now. However, there is a one-time cost for some of the language features. So, it grows kinda quickly initially. There is some sort of bump, basically.

Thanks to "tree shaking" (=dead code removal), you'll reach the break-even point fairly quickly though. You can use massive libraries, buy only those pieces you actually use get included in the final output.

For example, the last JS app I wrote is about 80kB (minified and compressed). jQuery alone took about 33kB of that. How much of jQuery do I actually use? I'd guess it's less than 20%.

So, even with that initial overhead, a Dart version would be probably a bit smaller.

Re: Dart is ready for the real world

#28
post #3

I'm not convinced. After Google killed numerous projects this year, I'm a little skittish about jumping into Dart. When it has the traction of Go, I'll be more willing.

Second time I've seen this today. An account created minutes after the submission apparently just for the purpose of spreading FUD.

I disagree that it's FUD. Not every concern expressed about a new technology is FUD. And it seems to me that Google's history of canceling projects that get only limited traction does provide a legitimate concern.

Re: Dart is ready for the real world

#29

From what I've seen of both, TypeScript seems like the language that Google should have created in the first place. It has similar goals, but without the "let's create a whole new VM and replace the entire JacaScript runtime in all browsers" ambition (which is ridiculous).

Maybe you would be interested in watching a discussion between the leaders of these two projects. I think Dart shouldn't be dismissed as a "ridiculous" ambition. I would also like to point out that Dart compiles to JavaScript the same way as TypeScript, so your remark regarding replacing the JavaScript runtimes in all browsers is an exaggeration

http://channel9.msdn.com/Shows/Going+Deep/Anders-Hejlsberg-a...

Re: Dart is ready for the real world

#30
post #9

Dart + Native Client Modules almost makes me excited about web programming again. Obviously not for general websites, but for specific applications it would not be unreasonable to require Chrome to be installed as the alternative would be installing a native app anyway.

Not again. We have been through this with ActiveX and it was no fun. Similarly we have been through "works on every OS (if it is Windows)".

Web development today with JS/CoffeeScript + jQuery + Underscore and other libs is not hard. Just accept that different users will use different browsers.

Post reply on HN