Hacker News new | ask | show | jobs
by afsina 5235 days ago
I for one welcome Dartium. I need to learn the language and JS compilation was an unnecessary barrier. I care less about people's whining.

A language that does not suck? Check. Is it multi platform? Check. Can it work in other browsers if necessary? Check. Is it open source? check. Can it run in server? Check. Is it fast? Check.

2 comments

You could take one of dozens of language and mark "check" for each of those points. (And the first one is questionable anyway, there are better languages). So why Dart rather than some other language? What's it's real selling points?

Perhaps the strongest thing going for Dart is that there's a big company with resources behind it. Unfortunately, this is also the worst thing about it. Google's lack of effort to involve other browser vendors and the community at large in it's development is ultimately the reason why not many are interested, aside from whether or not the language is any good.

Involving the community during the design stage just bogs the whole thing down with discussions like "semi colons or not?"

languages need to be created as a dictatorship and then ultimately open sourced, imo

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.

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

Why is it better to have prototypal inheritance? What real problem does it solve?
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 objects having property dictionaries (Perl, Python, Ruby, Lua, etc.).

No. To me JS fails on these:

A language that does not suck?

Can it run in server?

Is it fast?