Live data from Hacker News

Dartium: Google’s New Dart Programming Language Comes to Chromium

siliconfilter.com

31–40 of 53 posts

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#32
post #23

Earlier quoted context omitted.

That sounds like a checklist for JavaScript too...

My thoughts exactly. How about: Does it have closures and functions-as-object passing? (amazing feature of js) Does it support prototypal inheritance? (also great) I honestly don't know if Dart does these two, but they're pretty important to me. Does anyone know? Edit: after a little research it looks like the answers are "Yes" and "No". I'd be willing to try it then.

> Does it support prototypal inheritance? (also great)

No. Dart has classical inheritance, which by the large number of classical inheritance libraries for Javascript, is still very popular even when prototypal inheritance is available.

I personally abhor prototypal inheritance. It's aesthetically unappealing, hard to reason about, hard to optimise, and turns what is usually a declarative pattern into an imperative one. When most people are approximating classical inheritance anyway, that's a big sign.

It's sometimes nice that objects can differ structurally from their class, but I've never found it that useful.

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#33
post #30

Earlier quoted context omitted.

My thoughts exactly. How about: Does it have closures and functions-as-object passing? (amazing feature of js) Does it support prototypal inheritance? (also great) I honestly don't know if Dart does these two, but they're pretty important to me. Does anyone know? Edit: after a little research it looks like the answers are "Yes" and "No". I'd be willing to try it then.

Every language under the sun has closures and first class function objects now (Even C if you count llvm-specific extensions, and Java if you count one method interfaces as a suitable workaround until version 8). Also, Javascript's version of prototypal inheritance isn't very good. Name me one thing you can do well with Javascript's inheritance that you can't do well in any other dynamic language with some notion of…

[deleted]

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#34

Earlier quoted context omitted.

While I don't think Dart is the most interesting language I've seen (optional types and mirrors aside), CoffeeScript doesn't try to solve any of the problems that Dart is attempting to address.

Look at the five design goals of Dart: http://www.dartlang.org/docs/technical-overview/index.html#g... Of those five, the only one that CoffeeScript doesn't emphasize is "high performance/fast startup", which basically can't be a goal for a language without its own VM or JIT. It seems to me that focusing on adding this one emphasis to CoffeeScript would make a lot more sense than making yet another not-exactly-Java.

Read closer - those goals are modeled around the 5 perceived problems enumerated below them. Those aren't the kinds of problems that CoffeeScript purports to address at all. CoffeeScript for better or worse is mostly "Just JavaScript"

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#35

Earlier quoted context omitted.

My thoughts exactly. How about: Does it have closures and functions-as-object passing? (amazing feature of js) Does it support prototypal inheritance? (also great) I honestly don't know if Dart does these two, but they're pretty important to me. Does anyone know? Edit: after a little research it looks like the answers are "Yes" and "No". I'd be willing to try it then.

> Does it support prototypal inheritance? (also great) No. Dart has classical inheritance, which by the large number of classical inheritance libraries for Javascript, is still very popular even when prototypal inheritance is available. I personally abhor prototypal inheritance. It's aesthetically unappealing, hard to reason about, hard to optimise, and turns what is usually a declarative pattern into an imperative o…

Ah, you are right, it doesn't support prototypal inheritance.

"When most people are approximating classical inheritance anyway, that's a big sign."

Two things on that:

1. Most people (vast majority) learned OOP in a classical style, so that's what they're going to be comfortable with and will try to implement. It doesn't automatically mean classical style is superior.

2. You may want to check out the Klass library[1]. It provides a "classical interface to prototypal inheritance." So perhaps classical style is easier to use, but prototypal is better to have in the background.

[1]https://github.com/ded/klass

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#36

Earlier quoted context omitted.

> Does it support prototypal inheritance? (also great) No. Dart has classical inheritance, which by the large number of classical inheritance libraries for Javascript, is still very popular even when prototypal inheritance is available. I personally abhor prototypal inheritance. It's aesthetically unappealing, hard to reason about, hard to optimise, and turns what is usually a declarative pattern into an imperative o…

Ah, you are right, it doesn't support prototypal inheritance. "When most people are approximating classical inheritance anyway, that's a big sign." Two things on that: 1. Most people (vast majority) learned OOP in a classical style, so that's what they're going to be comfortable with and will try to implement. It doesn't automatically mean classical style is superior. 2. You may want to check out the Klass library[1]…

Why is it better to have prototypal inheritance? What real problem does it solve?

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#37
post #3

Earlier quoted context omitted.

The primary goal of dart is speed.

If you look at the stated design goals for Dart: http://www.dartlang.org/docs/technical-overview/index.html#g... Performance is a design goal, but it is not given as the primary goal. Of course, a cynical observer might say that the real primary goal of Dart is to give Chrome an artificial performance advantage over competing browsers, since that will be, at the very least, an initial effect if Google succeeds in pro…

Why would it be an "artificial" advantage? Chrome exists because Google wanted to push the web as a platform forward and encourage other browsers to evolve. That's what happened with Javascript and SPDY (_very_ rapidly with SPDY, it seems to me).

If Chrome is faster at running Dart it will only really matter if 1) Dart is also faster than Javascript and 2) Dart is better for building complex web apps. That would validate the "clean break" approach as an alternative to the evolution approach. I don't see what makes that "artificial".

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#38

It's good to see alternative web programming languages! I hope the other browsers will add support for Dart and that other languages will follow.

The WebKit maintainers already refused adding Dart support on grounds of not being a web standard, not wanting to fragment the web any further and not wanting the extra maintenance burden for the changes required to WebKit in order to support multiple scripting languages. Same reasoning goes for Mozilla, especially because they don't see Dart solving any problems that either couldn't be solved in a future version of JavaScript or that warrant the pains of having to maintain two different scripting engines. AFAIK Opera also didn't show any interest in it.

So Google's only hope left is for Chrome to gain monopoly-level market share to simply force the remaining browsers into compliance.

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#39

Earlier quoted context omitted.

Ah, you are right, it doesn't support prototypal inheritance. "When most people are approximating classical inheritance anyway, that's a big sign." Two things on that: 1. Most people (vast majority) learned OOP in a classical style, so that's what they're going to be comfortable with and will try to implement. It doesn't automatically mean classical style is superior. 2. You may want to check out the Klass library[1]…

Why is it better to have prototypal inheritance? What real problem does it solve?

[deleted]

Re: Dartium: Google’s New Dart Programming Language Comes to Chromium

#40
post #39

Earlier quoted context omitted.

Why is it better to have prototypal inheritance? What real problem does it solve?

[deleted]

Sorry, I don't think you understand how OOP works. In classical inheritance, each object only contains its data and a reference to its class. The class owns the methods - they are not copied to every instance. Most uses of prototypal inheritance follow a similar pattern.
Post reply on HN