Dart vs Platforms and No no for Dart in Chrome

487 views
Skip to first unread message

Rat Jo

unread,
May 12, 2014, 10:36:02 PM5/12/14
to mi...@dartlang.org
Hi there,

Since I started to use Dart, I considered Dart as being the equivalent to C++ and the generated Js code, the assembler code. Dart for me is there to hide the complexity of javascript and take care of all difference between platform.

I don't think that Dart should be integrated in Chrome. Dartium is fine for debugging, but when it come to deploy code, I think a single js file is better as it work on all platform (firefox, ie, safari, ...).

I would like Dart to allow me to target browsers and version of browser. So if I use a new feature that is only implemented one browser or one version of a browser, the compiler will tell me about it and give me an error.

With the support for IE9 being dropped soon for Dart, I have the feeling that this vision doesn't align with what we are heading too. I think that there is a huge potential in supporting a maximum number of browser and let the user choose which one he target.

If we want more speed, we should consider compiling the Dart code into PNacl instead of implementing the dart vm into Chrome. There is a lot of talk out threre about implement Dart in Chrome and there is probably also a timeline. Many people also want it, but M$ tried it with .net and the failed at it, Flash also is tried but it's now dying. Dart should not try to do the same.

What you think?

Jo

Cogman

unread,
May 12, 2014, 11:09:46 PM5/12/14
to mi...@dartlang.org

There is no reason not to integrate dart with chrome. So long as dart2js exists and works what harm can come from having a VM in the browser?

Dart is different from flash, it was made to generate JS.

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Rat Jo

unread,
May 13, 2014, 2:39:33 AM5/13/14
to mi...@dartlang.org
The reason I see to not integrate dart into chrome is that it will make chrome bigger, slower and at the same time, less secure. And there isn't much point of doing it because you make everything more complex. Also, Dart haven't been ported to other platform such as Android and iOS. So instead of trying to integrate it into stable chrome, making it a better compiler is I think a better idea.

My vision of the future of chrome is that they will drop support of javascript eventually and replace it with a javascript plugin made in PNaCl, so that you have Chrome -> PNaCl -> Javascript. Javascript will turn into a plugin instead of default language. So compiling Dart to PNaCl will be a neat thing and a step in the future and will eliminate all efficient code generated by going back and forth between javascript.

Rico Wind

unread,
May 13, 2014, 2:55:18 AM5/13/14
to General Dart Discussion
On Tue, May 13, 2014 at 8:39 AM, Rat Jo <jora...@gmail.com> wrote:
The reason I see to not integrate dart into chrome is that it will make chrome bigger, slower and at the same time, less secure. And there isn't much point of doing it because you make everything more complex. Also, Dart haven't been ported to other platform such as Android and iOS.
That is not really true, dart compiles and runs on android both as a standalone vm and as a android version of Dartium.

Cheers,
Rico

Rat Jo

unread,
May 13, 2014, 3:05:11 AM5/13/14
to mi...@dartlang.org
Thanks Ricco, i do know that it's possibly on the android platform, but i'm not sure how much stable it is and there is no download for it. You have to build it yourself.

Also, this is not really the question, the question is if we should expect dart language to be integrated into the stable channel of chrome.

Joao Pedrosa

unread,
May 13, 2014, 8:17:57 AM5/13/14
to mi...@dartlang.org
Hi,

The Dart VM being integrated in the browser is important. It's hard to do it, though. Performance is a reason to do it, since Dart compiled to JavaScript is not just optimized for performance, since there are other concerns like code bloat and so on. The Dart VM would also make understanding the underlying code more possible. We can't always treat it like a blackbox as we may with the dart2js output.

While Dart is cool, I feel it still puts too much of a burden on creativity. I miss being able to go beyond the basics in creating new stuff. Sort of like users try to do using Mirrors in Dart, trying to beat the platform. Also the editor can at times be slow. It can be annoying. By having a VM integrated into the browser, users would find ways around those kinds of issues.

Even the edit, save, reload cycle can be slow when using the editor. I can understand that some users would be more excited waiting for Go to compile their programs in 1 second than waiting who knows how long for things to get sorted in the iterations of Dart development.

Without integrating the VM into the browser, Dart would likely stagnate. If it became integrated, there would be more reasons to continue to improve it in sometimes unforeseeable ways.

Also by making Dart more mainstream, it would ensure that Dart became more stable and then supporting the same old browsers would be more within reason.

Ultimately though it would mean happier end-users. Since they would use snappier programs.

Cheers,
Joao


On Tue, May 13, 2014 at 4:05 AM, Rat Jo <jora...@gmail.com> wrote:
Thanks Ricco, i do know that it's possibly on the android platform, but i'm not sure how much stable it is and there is no download for it. You have to build it yourself.

Also, this is not really the question, the question is if we should expect dart language to be integrated into the stable channel of chrome.

Cogman

unread,
May 13, 2014, 9:44:23 AM5/13/14
to mi...@dartlang.org
On Tue, May 13, 2014 at 12:39 AM, Rat Jo <jora...@gmail.com> wrote:
The reason I see to not integrate dart into chrome is that it will make chrome bigger,

Not much really.  Thankfully this is also an isolated module of chrome.
 
slower

Not at all.  For now at least, the dart code would never be executed.  Even if it starts to become popular, having two languages supported in the script tag are hardly going to make any difference in execution speed.  The code for running them is literally going to be "Is this javascript? Is this dart? move forward"  Probably less than 100 clock cycles of work.  To argue this will make things slower is to argue that all the new html5 features will make chrome slower.  They have not.
 
and at the same time, less secure.

This is a potential issue.  Adding a new language does increase the size of the attack vector.  However, that being said, dart is a pretty secure language all around.  It was done well.  In some ways it is more secure than javascript (no evil eval).  It is a risk, but I don't see it being a huge one, not like running java or flash applets.  Dart in the browser is a sandboxed language (which means it doesn't provide the user with access to OS resources).
 
And there isn't much point of doing it because you make everything more complex.

You make very little complex.  Dart lives in its own sphere outside of the rest of chrome (just like javascript).  The place where dart may make things complex is dealing with the dom, however, even that has its own problems (hence project oilpan was born).  For the most part, the added complexity is self contained.
 
Also, Dart haven't been ported to other platform such as Android and iOS.

Why does this matter at all when talking about integrating dart into chrome? (though as mentioned, it has been ported to ARM which is what most Android and iOS devices run on).
 
So instead of trying to integrate it into stable chrome, making it a better compiler is I think a better idea.

My vision of the future of chrome is that they will drop support of javascript eventually and replace it with a javascript plugin made in PNaCl, so that you have Chrome -> PNaCl -> Javascript. Javascript will turn into a plugin instead of default language. So compiling Dart to PNaCl will be a neat thing and a step in the future and will eliminate all efficient code generated by going back and forth between javascript. 

PNaCl won't work because dart is still interpreted.  To get it running there you would essentially have to shove out all of the GC and runtime everytime you download a dart app.  It is the same reason why dart can't target asm.js right now. 

Filipe Morgado

unread,
May 13, 2014, 9:49:33 AM5/13/14
to mi...@dartlang.org
Lots of assumptions, IMO.

On Tuesday, 13 May 2014 07:39:33 UTC+1, Rat Jo wrote:
The reason I see to not integrate dart into chrome is that it will make chrome bigger, slower and at the same time, less secure.

I would say that about HTML/CSS which keeps growing to please lots of entities, evolving to an "App" standard while supporting the outdated "Page" concept.

An app that uses both JS and Dart will probably be bigger/slower. But an app that uses only Dart should be significantly lighter/faster than with JS.

On Tuesday, 13 May 2014 07:39:33 UTC+1, Rat Jo wrote:
Dart haven't been ported to other platform such as Android and iOS. So instead of trying to integrate it into stable chrome, making it a better compiler is I think a better idea.

Android support is under active development (ARM 32 and 64 bits). I agree that iOS is a problem (and will probably always be) but dart2js (along with Cordova/PhoneGap/etc) comes to the rescue.

A dart2native compiler would indeed be awesome but the compiler would have to actually use type annotations. I'm afraid that would cause Web/Native language fragmentation. 
 
On Tuesday, 13 May 2014 07:39:33 UTC+1, Rat Jo wrote:
My vision of the future of chrome is that they will drop support of javascript eventually and replace it with a javascript plugin made in PNaCl, so that you have Chrome -> PNaCl -> Javascript.

I don't think this will ever happen. V8 (Google's JS engine) is very optimized and it would suffer a runtime cost if ported to PNaCL.


When you'll write an android game in Dart, you'll be happy to be able to display 3x more polygons than with the JS equivalent.
(Not to mention server-side Dart)

Matthew Butler

unread,
May 13, 2014, 12:43:47 PM5/13/14
to mi...@dartlang.org
While I have a lot I could say to this, the basics of it have already been touched on by others so I'll touch on a couple of things that haven't yet been mentioned.


On Monday, May 12, 2014 11:36:02 PM UTC-3, Rat Jo wrote:
Hi there,

Since I started to use Dart, I considered Dart as being the equivalent to C++ and the generated Js code, the assembler code. Dart for me is there to hide the complexity of javascript and take care of all difference between platform.

I don't think that Dart should be integrated in Chrome. Dartium is fine for debugging, but when it come to deploy code, I think a single js file is better as it work on all platform (firefox, ie, safari, ...).

You can already do this. Dart will continue to generate JS files long after the VM lands in Chrome. If you don't want Chrome users to get the boost by having what is already there, then just deploy your .js files as you do now.  

I would like Dart to allow me to target browsers and version of browser. So if I use a new feature that is only implemented one browser or one version of a browser, the compiler will tell me about it and give me an error.

To me, this contradicts what you had stated above. You want errors if you target unsupported features, yet you want Dart to hide the complexity and take care of all the differences between platforms. That said, for me the Enterprise was controlled by MS for too long, which is why we still have many enterprises who shy away from the most up-to-date versions of browsers. In particular you'll see Enterprises still support IE6 and 7 because they want their ActiveX which their applications had been built on. So to maintain their applications they risk security, performance and stability of the entire platform. This is very concerning for me. Additionally, adding the extra complexity required for targeting older versions (particularly of IE which often did not implement the standards quite as described and supported their own unique quirks modes) adds significant strain to the Dart team to keep pushing the platform while continuing to be hampered by breakages they create in a product which should be updated in the first place. This results in slowing down updates for all areas of the Dart platform. It also increases bloat in the generated sources and adds maintenance headaches for developers to keep the multiple targets going.

With the support for IE9 being dropped soon for Dart, I have the feeling that this vision doesn't align with what we are heading too. I think that there is a huge potential in supporting a maximum number of browser and let the user choose which one he target.

Personally, the only thing I'd really like to see is something in the browser package (dart.js file) which detects older versions of IE and which allows me as a developer to add a custom behavior for unsupported versions of IE. Be it just displaying a message or redirecting to a lesser page or whatever it may be. 

If we want more speed, we should consider compiling the Dart code into PNacl instead of implementing the dart vm into Chrome. There is a lot of talk out threre about implement Dart in Chrome and there is probably also a timeline. Many people also want it, but M$ tried it with .net and the failed at it, Flash also is tried but it's now dying. Dart should not try to do the same.

As I mention above, Dart will continue to compile to efficient JS long after the VM lands in chrome and well into the foreseeable future.  However the Dart VM landing in chrome is going to bring one other huge advantage to speed that can't be achieved with JS alone (or even PNacl). Snapshotting your app will allow for a 10x faster start up of your app when used in the Dart VM. So not only are you getting the performance increases as seen on this page: https://www.dartlang.org/performance/ but you'll also get a 10 times faster start up to even get to the point of the faster execution.

MS Tried with .net (and in particular VB script). Using COM objects. However it was not a free and open implementation. It did not go through a Standards body like Dart currently is (ECMA in particular same as JS). I won't touch on the Flash/Flex issue myself as I'm honestly not that familiar with it. However I will mention that Adobe has seen Dart (And in particular the StageXL library http://www.stagexl.org/) as a migration point away from Flash and even included it in the Flash Pro CC (http://news.dartlang.org/2013/05/adobes-flash-pro-cc-exports-to-dart-and.html).

What you think?

Jo

Matt 
Reply all
Reply to author
Forward
0 new messages