DART as a javascript replacement?

Chat about anything not covered in these forums, but keep it civil!

Post » Mon Apr 09, 2012 2:42 pm

http://active.tutsplus.com/articles/explanatory/what-is-dart-and-why-should-you-care/

Found the above post explaining a bit about DART, google's new object-oriented language, engineered to replace javascript.

While the criticisms are valid (that supporting an additional, non-standard, web facing language defined without consensus is bad) and we do have ECMA "Harmony" coming up, I'd like to see some discussion on the theme.

Also not mentioned are the problems the language is meant to solve - for instance, google claims javascript has been doing a lot of things it was never meant to do with HTML5, but what's exactly the problem? I fail to see anything javascript can't do that other languages can (javascript is turing complete), so it's not about features (unless you count the specs and sandboxing, but then every language is going to have to abide).

Would it be faster than javascript? if so, how faster? Is it worth the change?
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Mon Apr 09, 2012 4:08 pm

[QUOTE=Fimbul] Would it be faster than javascript? if so, how faster? Is it worth the change?[/QUOTE]

About the performance, I have no clue, about if it is worth the change, I'd say it depends if you're willing to trade the cross-platform ability of js/HTML5 to a "work only in chrome" environment and if it brings you any benefit.

As far as C2 is concerned, I believe Ashley will stick to JS/HTML5 no matter what until the HTML5 exporter is considered finished.
He has spent already so much time, a switch now to a lesser spread platform would make few sense.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Mon Apr 09, 2012 4:32 pm

Well yes, it makes no sense to change to dart at this point, especially if other browsers decide against it.
Do you think this language has any future? If it remains a "chrome only" thing, it will obviously die a la "activeX" or vbscript.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Mon Apr 09, 2012 6:13 pm

Both Mozilla and Google are working on JS replacements - "Rust" and DART respectively. They would both be a bit faster than JS. However, using either would involve rewriting the entire engine and possibly all third party plugins and behaviours - just for a small performance boost in one browser. So right now, totally not worth it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Mon Apr 09, 2012 10:08 pm

Very comprehensive and well-informed overview here.

From the conclusion:
"If it were still 1995, and if Netscape Inc. had to pick between JavaScript and Dart for its scripting language, Dart would plainly be the better choice. Dart has had 16 years to learn from JavaScript's mistakes; it's no wonder that it avoids most of JavaScript's pitfalls.

"But it's now 2011, and JavaScript is the language that's out there and has the support. Even if the major browser vendors committed to providing native Dart support tomorrow, it's in a sense too late; it will be decades before a browser vendor could even consider dropping JavaScript. The language is very much here to stay."


Scirra's on the right road.Velojet2012-04-09 22:18:02
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Tue Apr 10, 2012 2:27 am

(disclaimer, I work with the Dart team)

Luckily, Dart compiles to modern JavaScript, so it will run across modern browsers. You don't need to wait for other browsers to directly adopt Dart. Heck, it's not even in Chrome yet (although you can get a binary build of Chromium+Dart VM for testing).

As for "what exactly is the problem", it really depends on the scope of the project. For very small apps, JavaScript is doing great. Sure, startup performance can be much better (imagine if you had to parse all the C code just to run your browser every time you started it up!), there's no built in libraries/modules, and there are dark alleys to avoid. But, as has been demonstrated, there's a lot of great apps written with JavaScript on the web.

However, we feel the web needs more complex, more performant apps (eg more apps on the size of Google Docs). With user expectations shifting to apps, we feel the web needs to remain competitive to the demands of modern app developers. We'd like to help keep the web a compelling platform for developers from all platforms, like Android, iOS, and .NET. Those developers have a different set of expectations of their tools, languages, and platform. Dart is a project that aims to be a solid choice for developers building more structured web apps.

There are two core tenets to Dart: must be instantly familiar and must compile to sane modern JavaScript. Those are very interesting and challenging design and engineering constraints, but we know and feel they are critical for the web at large.

As for performance, the team feels they can do better than the current crop of JavaScript engines. They should know, they build V8. :) However, it's early days so it remains to be seen how they'll do.

It's very early for the Dart project, and Scirra is off and running. For now, you're definitely right, keep on the JavaScript train. The Dart team is working hard to build a 1.0 of the platform and SDK, but until then it's a good time to let us know what features you need or want.

Hope that helps,
Seth
B
2
Posts: 2
Reputation: 254

Post » Tue Apr 10, 2012 3:08 am

Are the performance benefits negated by the "compiling to javascript" part?

The greatest problem with ECMA Harmony is one that has plagued (and will continue to plague) the computer world for generations, and that is Backwards Compatibility. I see dart as way to do away with the old.

That said, the greatest challenge would be to ensure it gets picked up fast, and it won't be done through developer adoption, but through cooperation with other vendors, and I don't see mozilla and microsoft rushing to adopt Dart, even if it's blazing fast and has a writeMyProgramForMe() function.

The review linked above does point out some very interesting points, especially about trying to fork the web community being unhealthy, though I agree with google's assessment that javascript has fundamental flaws that are unlikely to ever be fixed (especially if the ECMA team decides to keep backward compatibility, as seems to be the current mindset).

I mean, learning dart now would put one in a VERY advantageous position if it were ever to gain momentum, but if no one but chrome adopts it, it will remain forever a javascript translator, akin to coffeescript, which would just be sad, so I'd appreciate if someone could point me to a discussion on those topics (as I'm sure someone thought about this already).Fimbul2012-04-10 03:11:46
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Tue Apr 10, 2012 9:30 am

[QUOTE=sethladd]Luckily, Dart compiles to modern JavaScript ... As for performance the team feels they can do better than the current crop of JavaScript engines. They should know, they build V8.[/QUOTE]
While not taking away from my gratitude for V8 - great job, guys! - given that Dart compiles to JavaScript, I can't see that Dart would ever have it performance-wise over JS. Wouldn't every improvement in the engine necessarily be shared with JS?
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Tue Apr 10, 2012 4:50 pm

Thanks for the input @sethladd, I forgot Dart compiles to Javascript! However:

[QUOTE=Fimbul] Are the performance benefits negated by the "compiling to javascript" part?[/QUOTE]
This is a very important point actually - suppose we did rewrite our entire engine in Dart *and* figured out how to interop Dart with our Javascript SDK. If that meant lost performance on other browsers and/or significantly increased code size downloads, that's another reason not to adopt it.

I'm all in favour of a replacement language for Javascript, BTW. Dart is a great idea, but the practicality is it's unlikely to be worthwhile for a real engine like ours for the forseeable future.

If it had mature and widespread support on mobile that'd be more significant, since performance is more of a problem on mobile. But still, it's a huge amount of work for a slither of performance improvement, and V8 is definitely fast enough for a lot of what we do.Ashley2012-04-10 16:50:35
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Sun Apr 15, 2012 3:39 am

While Dart may not be fully viable right now i really wish the best for it. I took a look at Rust and it's very interesting too. We really deserve something better than JS. One thing i believe: The monopoly of JS is at an end. Kiyoshi2012-04-15 03:40:11
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Next

Return to Open Topic

Who is online

Users browsing this forum: cmccallum and 4 guests