Doubts Regarding the Dart VM in Chrome.

271 views
Skip to first unread message

Si Robertson

unread,
Mar 11, 2015, 7:56:21 PM3/11/15
to mi...@dartlang.org
For a while now I have been confident that the Dart VM would end up being built into Chrome but the following article has put doubt in my mind:


Why would the Chrome/V8 team want or need the Dart VM built into Chrome if V8 is likely to have native support for a typed version of JavaScript. Performance?.. that alone is unlikely to be worth the time and effort that's required to implement and maintain the Dart VM.

Even tho I have a keen interest in Dart and the Dart VM I have to be honest and say I would actually prefer V8 to support a typed version of JavaScript.

Greg Lowe

unread,
Mar 11, 2015, 9:09:15 PM3/11/15
to mi...@dartlang.org
If the V8 team can get this into the ECMAScript spec then this will benefit Dart developers too. It means that dart2js can use these features when compiling for other browsers - having a compile target which is closer to Dart semantics should help performance and code readability of the generated output. Note that Dart developers already get most of the benefits of "strong mode" and Soundscript already - and don't have to wait for a few years for these to make it through the standards process.

Günter Zöchbauer

unread,
Mar 12, 2015, 1:20:56 AM3/12/15
to mi...@dartlang.org

>> Even tho I have a keen interest in Dart and the Dart VM I have to be honest and say I would actually prefer V8 to support a typed version of JavaScript.

Same here. Improving JS as a compilation target offers more possibilities for the future. It's morel likely that other browser vendors follow this path than to add a Dart VM and Dart will profit anyway.
Message has been deleted
Message has been deleted

Benjamin Strauß

unread,
Mar 12, 2015, 7:17:55 AM3/12/15
to mi...@dartlang.org
when oilpan lands in chrome anyone can add their vm to it. i don't know how google is structured, so even if the v8 team could say 'we don't want this crap', i doubt that the 5 years people have worked in this project fulltime will just be thrown out of the window.

Günter Zöchbauer

unread,
Mar 12, 2015, 8:44:06 AM3/12/15
to mi...@dartlang.org
Oilpan isn't only for additional VMs but for additional VMs need Oilpan.
It introduces garbage collection and this solves a lot of code complexities in Chrome. 

Joao Pedrosa

unread,
Mar 12, 2015, 8:58:58 AM3/12/15
to mi...@dartlang.org
Hi,

I tried to follow a little bit of the Oilpan project by reading their discussions over there. In introducing Oilpan they had a couple of concerns like at least maintaining current performance levels and they weren't moving everything to Oilpan yet, some stuff would still be using the old system. As important was that the future of Oilpan wasn't yet completely determined, although they were making good progress on it.

Based on all the projects that have been trying to modernize programming on the browser, the only thing we can be certain of is that there is momentum for change. What people may disagree on is what exact changes will be worthwhile. It may be that Dart just fueled the spirit of change and other people will take the opportunity to advance their own agendas. Which means that since JavaScript is the standard, it will likely be the political savvy choice for bringing about more changes. That's what we can read on the tea leaves so far. :-)

On the client, it could be that people have had to settle on Dart being just an evolution over GWT. And the Dart VM may indeed not show up on Chrome for a while longer. The thing is that with all the changes coming to JavaScript, the people responsible for the standard browser may have got a lot on their plate, so much so that they would not want to have to worry about another, extra, subsystem. Imagine having to duplicate work on Chrome Development Tools so that it supported Dart and so on. People may not want that kind of extra work.

By the way, even projects like SoundScript may take another few years to implement. They are starting the work with strong mode. They are also working on TurboFan as a next-gen VM for JavaScript. And they are still implementing ECMAScript 6. The best part for them doing that kind of work is that they can ship it as soon as they implement some feature.

We should view companies preferring JavaScript to Dart as just their pragmatic approach.

It may be that once Oilpan completely lands, they would use it to better support Dart in the Dartium version of Chrome. That's the only trade-off we can expect at the moment. Some people could then try to create a web view using Dartium and then projects could use that for deployment purposes.

Cheers,
Joao


--
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.

Alex Tatumizer

unread,
Mar 12, 2015, 11:45:44 AM3/12/15
to mi...@dartlang.org
I'm completely puzzled by the idea of compiling  TypeScript to dart. What is this dart code good for? Compiling it back to javascript? Or what?
Joao, you are a man of letter, can read tea leaves, what do they say about it?
I'm utterly confused.

Günter Zöchbauer

unread,
Mar 12, 2015, 12:03:35 PM3/12/15
to mi...@dartlang.org
You can check the result with the Dart analyzer and the linter :D and then compile to JavaScript.
With for example Angular (I know you don't like it ;-) ) you can also use the code in a Dart application, it provides a typed interface and can be used without dart-js-interop and then again build the entire app to JavaScript.

Bob Nystrom

unread,
Mar 12, 2015, 12:30:42 PM3/12/15
to General Dart Discussion

On Thu, Mar 12, 2015 at 8:45 AM, Alex Tatumizer <tatu...@gmail.com> wrote:
I'm completely puzzled by the idea of compiling  TypeScript to dart. What is this dart code good for? Compiling it back to javascript? Or what?

It makes it easier for applications written in Dart to use Angular. You get a more consistent harmonious development experience.

Cheers!

- bob

Alex Tatumizer

unread,
Mar 12, 2015, 12:32:47 PM3/12/15
to mi...@dartlang.org
@Gunter: sorry, I can't accept you interpretation. It defies common sense.
Let's face it guys: we have detective story on our hands. TypeScript compiles to dart for unknown purpose.
Which provides a lot of room for speculation.
My versions:
1. Absurd. (most likely one)
2. There's a secret yet unannounced plan to put dart to some use somewhere, e.g. on android, as a replacement of java maybe. If I was google (I'm not), that's what I would do, immediately making the language very popular (*). But... see version 1.

(*) anecdotal evidence: remember swift? Replacement of Objective C? I was loitering the other day in the mall, waiting for my wife's shopping for stuff, and wandered into book store to have some coffee (in Canada, book stores double as Starbucks coffee shops, which attracts readers). That's not important though, I mention it just for completeness.
The bottom line is: there's a shelf in a store full of programming books. It used to be an entire section of the store, but now downgraded to a shelf. What did I find on this shelf? A lot of javascript, html, css, several java manuals, some odd stuff, and... drumroll, please... 3 (THREE) brand-new books on Swift!


Bob Nystrom

unread,
Mar 12, 2015, 12:37:53 PM3/12/15
to General Dart Discussion

On Thu, Mar 12, 2015 at 9:32 AM, Alex Tatumizer <tatu...@gmail.com> wrote:
Let's face it guys: we have detective story on our hands. TypeScript compiles to dart for unknown purpose.

We have a lot of internal customers write Angular apps in Dart. Their life is better when Angular itself is written in (or transpiled to) Dart. They get better static analysis, avoid JS interop, etc. It's just a much more seamless experience.

The Angular team wants to support a first-class Dart user experience for Angular, but they also want to do the same thing for JS. Writing it in one language—previously AtScript, now TypeScript—and targeting both lets them do that from a single codebase.

- bob

Alex Tatumizer

unread,
Mar 12, 2015, 12:59:27 PM3/12/15
to mi...@dartlang.org
If I'm not mistaken, Angular components are supposed to be written in TypeScript, right? (Otherwise it's not even clear WHAT gets compiled to dart). So harmonious experience includes 5 simple steps:
1) write your Angular code in TypeScript
2) compile it to dart
3) do something with dart code (not clear what exactly)
4) compile to javascript
5) deal with 3 variants of the same code (TypeScript, dart, javascript).


Benjamin Strauß

unread,
Mar 12, 2015, 1:01:07 PM3/12/15
to mi...@dartlang.org
You get angular2.dart from pub just like you get angular1. You write everything in dart. You never see a single line of TypeScript. It's transpiled before it gets published on pub.

Alex Tatumizer

unread,
Mar 12, 2015, 1:08:01 PM3/12/15
to mi...@dartlang.org
"In order to deploy AtScript, it is compiled with the traceur compiler, which converts ES6 into ES5. There is also an option to compile to Dart".
Source: http://www.theregister.co.uk/2014/11/04/improving_javascript_google_throws_atscript_into_the_mix


It's about AtScript, recently abandoned in favor of TypeScript (not to be confused with SoundScript), but still, the question is the same: WHAT gets compiled to dart?


On Thu, Mar 12, 2015 at 1:01 PM, Benjamin Strauß <benm...@gmail.com> wrote:
You get angular2.dart from pub just like you get angular1. You write everything in dart. You never see a single line of TypeScript.

Am Donnerstag, 12. März 2015 17:59:27 UTC+1 schrieb Alex Tatumizer:
If I'm not mistaken, Angular components are supposed to be written in TypeScript, right? (Otherwise it's not even clear WHAT gets compiled to dart). So harmonious experience includes 5 simple steps:
1) write your Angular code in TypeScript
2) compile it to dart
3) do something with dart code (not clear what exactly)
4) compile to javascript
5) deal with 3 variants of the same code (TypeScript, dart, javascript).


Joao Pedrosa

unread,
Mar 12, 2015, 1:08:14 PM3/12/15
to mi...@dartlang.org
Hi Alex,

Well, TypeScript is still evolving to adopt more ECMAScript 6 and perhaps 7 features. Thanks to Angular for getting them moving on their ES6 adoption. :-)

TypeScript is a good idea and that's why it's being used by Adobe, Microsoft, Mozilla, etc. One of their major ideas is to avoid "mistakes" made by other projects. They have made a goal to keep their runtime requirements very low. It impresses on their demos. But it also impresses on the big libraries that people throw at it.

Dart was good to help to drive things like TypeScript, first and foremost. Dart forced Microsoft's hand I guess. But now we have seen Google's own next move with things like StrongMode and hints of SoundScript.

Google's Closure Tools seem to be moving to support TypeScript code directly. They will be able to take their static hints that way.

So yes, the future looks bright in a way.

I recently read a story about how at Google they like to empower the engineers so that they can be surprised by what they can come up with. Depending on how you judge things, surprised they might have gotten: Microsoft now loves JavaScript! :-)

What those engineers put into Dart was a bunch of patterns that they have come up with over the years. Maybe they just missed making type annotations mandatory. Now that they have Dart they may not need so much Java, Python, JavaScript, Node.JS, etc. Dart was never just JavaScript-next. And that may be why TypeScript came about.

Cheers,
Joao

Benjamin Strauß

unread,
Mar 12, 2015, 1:15:02 PM3/12/15
to mi...@dartlang.org
Did i not just answer that question? The whole Angular Framework gets transpiled to dart. Transpiled not compiled. What you get are regular dart classes that you can use.


"This is because the core of the framework is written in AtScript and transpiled to both Dart and various flavors of JS. However, in pub it is all pure Dart and you use it like any other Dart package."

Alex Tatumizer

unread,
Mar 12, 2015, 1:41:51 PM3/12/15
to mi...@dartlang.org
Benjamin: sure, you answered my question, thanks. The problem is that I don't understand your answer. That's not because the answer is bad. There can be other reasons. One of them is the sense of confusion that ensues after juxtaposing different versions of Angular2 affair narrated by different observers. For example:

"Remember how I mentioned that Dart has a different object model for DOM, etc. That's not something that can be handled simply by transpiling code. As a result, the build process for Angular 2.0 is a bit more complicated in reality. When developing Angular, it's necessary to create various facades over APIs that are different between JavaScript and Dart. The compiler then uses the appropriate facade to compile each target language"
Quoted from: http://eisenbergeffect.bluespire.com/all-about-angular-2-0/

Transpiled? Or not transpiled? That's the question. And if transpiled, what exactly transpiled?

Not that these questions are all important (they are not), I was just curious. If it hurt your feelings somehow, I'm terribly sorry.

Cristian Garcia

unread,
Mar 12, 2015, 1:53:08 PM3/12/15
to mi...@dartlang.org
As of the original question: does anybody know what is the status of Dart in Chrome? Personally I'd like to put a "Please use Chrome for a better experience" message since my compiled JS tends to have bugs (mostly due to the angular transformer).

ARISTA DEV
Cristian Garcia Escobar
Cofundador

Teléfono: (57 4) 584 31 79 | Móvil: (57) 314 862 79 78
Medellín - Colombia

--
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.

Justin Fagnani

unread,
Mar 12, 2015, 1:54:04 PM3/12/15
to General Dart Discussion
On Thu, Mar 12, 2015 at 10:41 AM, Alex Tatumizer <tatu...@gmail.com> wrote:
Benjamin: sure, you answered my question, thanks. The problem is that I don't understand your answer. That's not because the answer is bad. There can be other reasons. One of them is the sense of confusion that ensues after juxtaposing different versions of Angular2 affair narrated by different observers. For example:

"Remember how I mentioned that Dart has a different object model for DOM, etc. That's not something that can be handled simply by transpiling code. As a result, the build process for Angular 2.0 is a bit more complicated in reality. When developing Angular, it's necessary to create various facades over APIs that are different between JavaScript and Dart. The compiler then uses the appropriate facade to compile each target language"
Quoted from: http://eisenbergeffect.bluespire.com/all-about-angular-2-0/

Transpiled? Or not transpiled? That's the question. And if transpiled, what exactly transpiled?

AtScript _syntax_ is converted to Dart _syntax_, that's all.

In order to make this work you have to 1) write AtScript in a style that's compatible with Dart semantics. ie, do not use implicit type coercion, treat all objects as sealed, etc. You also have to translate certain APIs. Instead of Array.push(), use List.add(), and so Angular code is written like: ArrayFacade.push(a, x), which is translated to a.push(x) in JS and a.add(x) in Dart.
 

Not that these questions are all important (they are not), I was just curious. If it hurt your feelings somehow, I'm terribly sorry.

--
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.

Benjamin Strauß

unread,
Mar 12, 2015, 1:55:08 PM3/12/15
to mi...@dartlang.org
Am Donnerstag, 12. März 2015 18:41:51 UTC+1 schrieb Alex Tatumizer:
Benjamin: sure, you answered my question, thanks. The problem is that I don't understand your answer. That's not because the answer is bad. There can be other reasons. One of them is the sense of confusion that ensues after juxtaposing different versions of Angular2 affair narrated by different observers. For example:

"Remember how I mentioned that Dart has a different object model for DOM, etc. That's not something that can be handled simply by transpiling code. As a result, the build process for Angular 2.0 is a bit more complicated in reality. When developing Angular, it's necessary to create various facades over APIs that are different between JavaScript and Dart. The compiler then uses the appropriate facade to compile each target language"
Quoted from: http://eisenbergeffect.bluespire.com/all-about-angular-2-0/

What he is talking about is the fact that some core libraries in js and dart are too different to transpile directly. they write versions for them in both languages (see async.dart and async.es6) that have the same interface (the facade), so they can both be called from the compiled version. The dart version calls the dart file and the js version calls the js file.
 
Transpiled? Or not transpiled? That's the question. And if transpiled, what exactly transpiled?

What you as developer get at the end of the transpilation process is a pure angular2.dart library exactly like angular1.dart.

Not that these questions are all important (they are not), I was just curious. If it hurt your feelings somehow, I'm terribly sorry.

It's not your fault. I just get a bit annoyed when i have to repeat myself. :)

Justin Fagnani

unread,
Mar 12, 2015, 1:55:18 PM3/12/15
to General Dart Discussion
On Thu, Mar 12, 2015 at 10:53 AM, Cristian Garcia <cgarc...@gmail.com> wrote:
As of the original question: does anybody know what is the status of Dart in Chrome? Personally I'd like to put a "Please use Chrome for a better experience"

This is exactly what the web community doesn't want to happen.
 
message since my compiled JS tends to have bugs (mostly due to the angular transformer).

Angular should fix their transformers :) Have you filed issues?

Cristian Garcia

unread,
Mar 12, 2015, 2:02:12 PM3/12/15
to mi...@dartlang.org
This is exactly what the web community doesn't want to happen.

Yeah I guess that it be annoying to the web community. I decided to just wait for Angular2, I guess all the effort at the moment is there and since Angular1 is so short lived they are trying to just migrate everything. My current but has to do with not recognizing interfaces fields once compiled to JS. I don't know if this has to do with mirrors or not.

Si Robertson

unread,
Mar 12, 2015, 2:52:48 PM3/12/15
to mi...@dartlang.org
This is exactly what the web community doesn't want to happen.

At this moment in time "use Chrome for a better experience" is a factual statement regardless of the web technology being used, be it JS or CSS etc. The same will also be true when/if the Dart VM is built into Chrome because other web browsers are unlikely to roll with a Dart VM and will therefore be relegated to the JS produced by dart2js.

This is something the developers of web apps and web games are acutely aware of and runtime performance is especially important for decent games, so the browser being used to run them is important for an optimal experience.

However, that is completely different than saying "Chrome is required"... now that would be a bad thing :)

Alex Tatumizer

unread,
Mar 12, 2015, 3:07:29 PM3/12/15
to mi...@dartlang.org
Justin, Benjamin: now I understand what "Facade" means. Thanks.
I have just one more question, hesitating to ask. Don't know even how to put it.
By any chance, doesn't Angular 2 continue with the idea of creating new programming language out of HTML?
I mean, all those ng-repeats and syntax excesses?
I tried to look up some docs, but recent ones mention only programmatic syntax,  I rejoiced seeing that, but afraid this is not the whole truth, and under "Facade" there're "directives" somewhere, no?
(I'm asking because a couple of month ago when I checked it looked even curiouser than its predecessor 1).

Benjamin Strauß

unread,
Mar 12, 2015, 3:40:40 PM3/12/15
to mi...@dartlang.org
The underlying problem is that the dom is used for things it wasn't made for (conditionals, data-binding, etc.). I don't know of any solution that would be more elegant, unless you want to generate your html completely through js/dart without using template files. One could also write a parser that could read in some form of 'extended-html' and generate a virtual dom.

So to answer your question: angular2 will also have ifs/switches/etc.

Alex Tatumizer

unread,
Mar 12, 2015, 3:47:53 PM3/12/15
to mi...@dartlang.org
OMG.
Thanks for the bitter truth though.



Reply all
Reply to author
Forward
0 new messages