Linked by Thom Holwerda on Mon 10th Oct 2011 20:14 UTC, submitted by twitterfire
General Development "Google has released an early version of Dart, a new programming language designed to take some of the pain out of developing applications for the Web. But while it's an evolutionary improvement on JavaScript, Dart faces a hard uphill battle for acceptance."
Thread beginning with comment 492446
To read all comments associated with this story, please click here.
js
by vivainio on Mon 10th Oct 2011 20:57 UTC
vivainio
Member since:
2008-12-26

Main problem with Dart is that it's not an evolutionary improvement on Javascript, it's an all new Virtual Machine.

So, none of your old js code will run with your new Dart code.

IMO, how google should have implemented this would have been to add optional type tracking in their v8 js engine optimization paths, and provide a thin frontend that turns dart language to javascript + extras.

This way, you could intermingle Dart and JS code freely.

I am a bit underwhelmed about Dart because google took this route. We already have CoffeeScript that is a great language that directly maps to JS code (but eliminates "function" keyword, has list comprehensions from python, has classes, etc.). CoffeeScript works seamlessly with JS code - can run it, can get run by it.

Reply Score: 6

RE: js
by burnttoys on Mon 10th Oct 2011 21:34 in reply to "js"
burnttoys Member since:
2008-12-20

Hmmm... I do think it's a bit of a weird sell - that is to pitch this as a JS replacement but as an application language it's not too bad (I'll admit I haven't _really_ dug into it).

Standard sort of class/interface stuff going on. Generics look usable but, like Java, have nothing like the expressive, computational qualities of C++ templates.

Given the more rigorous type engine I'd expect faster code execution than JS too - probably less type/method searching going on.

However, 10 out of 10 for "isolates". They seem to have a solid memory and process model but have made the message sends "invisible" - that is a method invocation becomes a message send. The doc I read didn't go into a huge amount of detail on the actual implementation (are objects copied as they go across the process boundary or have they implemented a binder/ref count system with (maybe) CoW)? Simply hiding the implementation this way is good enough.

As an application programming language I wonder if it was a better use in Android? It can't be _too_ hard to port Java code to Dart once the libraries are put together and lets Google stick 2 fingers up to the over inflated ego of Mr Ellison.

Maybe getting it into browsers (even if only Chrome) is a good way of getting an implementation into developers hands.

Reply Parent Score: 2

RE: js
by kloty on Mon 10th Oct 2011 21:52 in reply to "js"
kloty Member since:
2005-07-07

If I understand correctly it is possible to translate Dart into Javascript. Please look at Point 3. in this file https://code.google.com/p/dart/source/browse/branches/bleeding_edge/...

Reply Parent Score: 1

RE[2]: js
by fromz on Mon 10th Oct 2011 22:48 in reply to "RE: js"
fromz Member since:
2011-10-10

Yeah I saw that too -- doubt it can use existing javascript libraries though - which is neither here nor there, I suppose. If the project were to succeed, in time we would see dart libraries created to fill the void. In that case, we could write in dart and convert to javascript for browsers which don't support dart natively.

Reply Parent Score: 1

RE[2]: js
by vivainio on Tue 11th Oct 2011 18:45 in reply to "RE: js"
vivainio Member since:
2008-12-26

If I understand correctly it is possible to translate Dart into Javascript. Please look at Point 3. in this file https://code.google.com/p/dart/source/browse/branches/bleeding_edge/...


Check out what Dart "Hello World" looks like when compiled to Javascript:

https://gist.github.com/1277224

No kidding.

CoffeeSctipt, OTOH, maps to JS quite directly.

Reply Parent Score: 2

RE: js
by Clinton on Mon 10th Oct 2011 22:45 in reply to "js"
Clinton Member since:
2005-07-05

Main problem with Dart is that it's not an evolutionary improvement on Javascript, it's an all new Virtual Machine.

So, none of your old js code will run with your new Dart code.


I think that is exactly why Dart, or any other full replacement for Javascript, is so tempting.

Javascript sucks a lot more than it should, which is why people are always trying to make it easier with things like jQuery and CoffeeScript. I think there is a great amount of merit to completely ditching the old and bringing in something new.

Reply Parent Score: 6

RE[2]: js
by vivainio on Tue 11th Oct 2011 03:55 in reply to "RE: js"
vivainio Member since:
2008-12-26



Javascript sucks a lot more than it should, which is why people are always trying to make it easier with things like jQuery and CoffeeScript. I think there is a great amount of merit to completely ditching the old and bringing in something new.


The fact that CoffeeScript is ok means you don't need to ditch js to get tolerable language.

Just add optional type definitions to underlying js engine, and you can use a better language like CoffeeScript and have the code run fast, while retaining compatibility.

Reply Parent Score: 4

RE: js
by _xmv on Tue 11th Oct 2011 13:25 in reply to "js"
_xmv Member since:
2008-12-09

"not created here" syndrome i guess

Reply Parent Score: 2

RE: js
by renox on Wed 12th Oct 2011 12:05 in reply to "js"
renox Member since:
2005-07-06

We already have CoffeeScript that is a great language

Depends on the viewpoint, some don't like CoffeeScript because it doesn't have a 'let' or a 'var' for local scope and I guess that it has JavaScript view that "all number are floats" on this point I prefer Dart's big ints.

Reply Parent Score: 2

RE[2]: js
by vivainio on Wed 12th Oct 2011 12:45 in reply to "RE: js"
vivainio Member since:
2008-12-26


Depends on the viewpoint, some don't like CoffeeScript because it doesn't have a 'let' or a 'var' for local scope and I guess that it has JavaScript view that "all number are floats" on this point I prefer Dart's big ints.


Python and Ruby do just fine without let or var for local scope.

As for numeric model, CoffeeScript has no choice. It uses what Javascript provides, that's why it can be translated so directly to JS. It's a small price to pay for not needing a whole new Google specific VM.

Reply Parent Score: 2

RE: js
by Panajev on Fri 14th Oct 2011 14:23 in reply to "js"
Panajev Member since:
2008-01-09

JavaScript is the assembly language of the web. Dart is one of the many projects trying to build the C language of the web.

Edited 2011-10-14 14:24 UTC

Reply Parent Score: 2