Dart VS Coffeescript

805 views
Skip to first unread message

127

unread,
Oct 18, 2011, 3:53:49 AM10/18/11
to General Dart Discussion
I like Dart very much, but ther's one thing that makes me confused.
Is there any general obvious advantage over Coffeescript? Coffeescript
has «normal» class based OOP and it's compiled JS is much more
readable and clear (+small).

Atro

unread,
Oct 18, 2011, 6:15:11 AM10/18/11
to General Dart Discussion
The ultimate goal of Dart is to run directly on a VM, not compile into
anything.

Also Dart has features that are useful when creating IDE's for it,
also a better language in team environments.

127

unread,
Oct 18, 2011, 10:19:14 AM10/18/11
to General Dart Discussion
I'm just trying to find which way it is better for me as a front-end
Javascript developer )
But I don't get it because every new feature I hear about has an
analogue in Coffeescript.
IDE's dev is a very local usage and a <<better language>> is quiete
fuzzy answer (
By the way, Mozilla and Webkit are going to support Coffeescrpt
natively (it is a VM realization, I guess).

Joao Pedrosa

unread,
Oct 18, 2011, 10:27:40 AM10/18/11
to General Dart Discussion
Hi,
Coffeescript may be good but it's just one more way to program in
"Javascript", although it's translated. The many Javascript libraries
adopt different techniques, which doesn't help with standardizing
their components so they take advantage of one another's efforts. The
characteristics of Javascript of allowing direct execution of code
makes wrapping some of them harder, I guess.

Dart is more of a longer-term kind of project. Depending on the
commitment to it, it could become more popular than any single
Javascript library, including JQuery. Right now, Dart is a little of
Vaporware, but thanks to the early release it is more than just that.
As Dart provides things like Class from the beginning, the libraries
targeting it won't become inconsistent with one another. Dart code
isn't executable all the way which may help with wrapping third party
libraries targeting it.

Or so it goes.

Cheers,
Joao

Bob Nystrom

unread,
Oct 18, 2011, 2:04:59 PM10/18/11
to 127, General Dart Discussion
CoffeeScript and Dart are going in different directions (neither of which is bad, they just suit different uses and users). CoffeeScript starts with JS and says, "Let's see if we can improve the syntax." I, like a lot of people, find CoffeeScript generally more beautiful to read than vanilla JS, but it's underlying semantic model is still 100% JS:

1. Everything is mutable.
2. CoffeeScript does add a declarative form for classes, but that doesn't include fields, and it doesn't ensure that the class isn't later modified.
3. No type annotations.

Simplifying drastically, you can look at Dart as starting with JS and saying "Let's see if we can improve the semantics." So Dart still looks a lot like JS (or a hybrid of JS and Java), but its underlying semantics are quite different:

1. Actual classes, no prototypes. No object literals.
2. Distinction between objects-as-instances-of-types and objects-as-data-structures (maps).
3. Classes have a purely declarative form and cannot be changed after the fact.
4. Optional type system and type annotations.

If you find yourself liking JS but wanting it to be more terse and expressive, CoffeeScript is a good fit for you. If you like JS but want it to be more structured and easier to tool, then Dart is a better fit, I think.

That isn't to say the two are mutually exclusive. Dart's => functions are inspired in part by CoffeeScript, for example.

- bob

kc

unread,
Sep 30, 2012, 5:58:10 AM9/30/12
to mi...@dartlang.org
A native optimized runtime/VM for CoffeeScript would be interesting. CoffeeScript could eventually then grow on its own terms.

Ladislav Thon

unread,
Sep 30, 2012, 6:32:43 AM9/30/12
to mi...@dartlang.org


> A native optimized runtime/VM for CoffeeScript would be interesting. CoffeeScript could eventually then grow on its own terms.

That presumes that CoffeeScript would want to become standalone language. Right now, it makes no sense to build a special VM for CoffeeScript, because you would actually have to build a VM for JavaScript.

LT

Kai Sellgren

unread,
Sep 30, 2012, 8:22:16 AM9/30/12
to mi...@dartlang.org
Is this a serious question?

I can't help feeling that CoffeeScript is a joke. As others have said, Dart also improves the semantics, not just the syntax and Dart is really a bit more of a "platform" than a language. It gives you the VM, the new heroic DOM, the language, the tools (Pub package manager, IDE, ...).

 it's  compiled JS is much more readable and clear

What you want/need is Source Mapping. This is definitely a valid point.

kc

unread,
Sep 30, 2012, 8:22:04 PM9/30/12
to mi...@dartlang.org


On Sunday, September 30, 2012 1:22:16 PM UTC+1, Kai Sellgren wrote:
Is this a serious question?

I can't help feeling that CoffeeScript is a joke.

Revolutions sometimes come from below and have an accidental quality. XMLHttpRequest in IE5 for instance.

Dart - or a replacement for JS - both syntax and runtime semantics - would have been better as part of an open competition/process.
Reply all
Reply to author
Forward
0 new messages