News for hackers. Stuff that matters.
Re:Dart 1.0 Is Out by andyl on Thursday November 14, 2013 @12:35PM (#6733738)
Just waiting for "Works best on Chrome"

Silverlight and ActiveX have already shown the usefulness of proprietary enhancements.

No thanks.

Re:Dart 1.0 Is Out by chrismsnz on Thursday November 14, 2013 @05:23PM (#6736112)
What exactly is proprietary about it?

Browser vendors are free to integrate the VM into their products, and if they don't want to there is dart2js which is acceptable.

This isn't even close to the situation presented by Silverlight, ActiveX and I feel like you're being duplicitous by comparing them.

Re:Dart 1.0 Is Out by pcwalton on Thursday November 14, 2013 @05:36PM (#6736190)
> Browser vendors are free to integrate the VM into their products, and if they don't want to there is dart2js which is acceptable.

That's a tremendous amount of effort and it is likely to reduce the performance of JavaScript. Cross-language GC, in particular, is really hard. See Filip Pizlo's message to webkit-dev on this subject (citing two recent papers), which is part of the reason that Dart support was shot down when Google proposed adding it to WebKit: https://lists.webkit.org/pipermail/webkit-dev/2011-December/...

Re:Dart 1.0 Is Out by skybrian on Thursday November 14, 2013 @06:02PM (#6736364)
As of today, dart2js is the only way to deploy Dart to users' browsers, Chrome included. It already performs well enough for most apps.

The Dart VM is nice but its primary purpose right now is running the Dart compiler and in Dartium which is only used by developers. (You can use it for other things but the ecosystem isn't there yet.)

Re:Dart 1.0 Is Out by chrismsnz on Thursday November 14, 2013 @06:03PM (#6736369)
Right, I can understand that. It's a lot of effort to put in up-front just to support Google's pet project of the day.

This is a really good reason why dart2js exists and why so much effort has been expended in making it good.

However, I think that if Dart proves to be a compelling platform for developers I don't think it's out of the question for browser vendors to put some serious thought into integrating the Dart VM natively alongside JS.

After all, Google is going to be doing exactly that with Chrome/Chromium...

Re:Dart 1.0 Is Out by epsylon on Friday November 15, 2013 @08:22AM (#6739228)
> Browser vendors are free to integrate the VM into their products

No they aren't. Integrating a Google-controlled VM into any software project (for example, Firefox) isn't trivial (you need lots of resources for it) nor is desirable (the technology is driven and controlled by Google).

Re:Dart 1.0 Is Out by sigzero on Friday November 15, 2013 @04:45PM (#6742356)
You points don't speak to the statement. Browser vendors are FREE to integrate it. Whether they will because of the technical costs is a totally separate statement and quandary.
Re:Dart 1.0 Is Out by limsup on Thursday November 14, 2013 @12:43PM (#6733816)
It compiles to JavaScript. The VM and dart2js are MIT licensed. It's not the same situation.
Re:Dart 1.0 Is Out by spankalee on Thursday November 14, 2013 @12:59PM (#6733991)
And Dart is not a plugin, it gives you the whole DOM (though a _much_ improved API), unlike Silverlight, ActiveX, Flash, Java or any other plugin.
Re:Dart 1.0 Is Out by threeseed on Thursday November 14, 2013 @04:43PM (#6735835)
And who is responsible for keeping the DartVM/Dart2JS behaviour in sync ?

Google being the ONLY committers don't exactly have a motivation to.

Re:Dart 1.0 Is Out by skybrian on Thursday November 14, 2013 @06:13PM (#6736432)
Google web developers who want to deploy their apps need to use dart2js. Google web developers need to make sure their apps work in all modern browsers. If the Dart team wants to promote adoption even within Google (and they do) they need to support all modern browsers.

Dartium and dart2js already aren't quite in sync; numeric types work differently for example. But they're close enough that for most apps, you can develop in Dartium and deploy on dart2js and the language differences don't really bother you. The language differences between Dart-in-JavaScript and Dart-in-Dartium are a lot less than the differences between browsers that web developers deal with all the time.

Re:Dart 1.0 Is Out by dragonwriter on Thursday November 14, 2013 @05:10PM (#6736032)
Dart2JS will be the key thing that drives Dart adoption.

So, yeah, Google has a motivation to keep it up to date.

Re:Dart 1.0 Is Out by gress on Thursday November 14, 2013 @05:21PM (#6736100)
Only until there is enough adoption for them to stop caring.
Re:Dart 1.0 Is Out by dragonwriter on Thursday November 14, 2013 @07:10PM (#6736765)
If there's enough adoption, then I'd expect other browser developers either to build their own Dart runtimes, or -- since its free -- use or fork Google's.

And, then, sure, Dart2JS stops being important to Google because its unimportant to how Dart code performs on the web. But its unimportant to Google because its unimportant to anyone, since it won't matter to users, either.

Re:Dart 1.0 Is Out by lttlrck on Thursday November 14, 2013 @07:07PM (#6736738)
If there is that much adoption then the onus will be on Mozilla, Apple and Microsoft etc to step up and accept the will of web developers. Edit: and push for standardization.
Re:Dart 1.0 Is Out by andyl on Thursday November 14, 2013 @09:27PM (#6737310)
Then get left in the dust as Chrome takes advantage of undocumented features.

We've seen that game before, played by microsoft.

Other browser vendors know this: Dart is never gonna fly outside of Google's walled garden.

Re:Dart 1.0 Is Out by gress on Thursday November 14, 2013 @10:19PM (#6737482)
It may not have to if Google can get (or has already) enough Chrome penetration.
Re:Dart 1.0 Is Out by rdtsc on Thursday November 14, 2013 @01:16PM (#6734164)
> Just waiting for "Works best on Chrome"

Can't wait. I am already using Chrome, if it works best I'll like it even more.

> Silverlight and ActiveX have already shown the usefulness of proprietary enhancements.

So how do I compile Silverlight to .js again?

> No thanks.

Yes please!

Re:Dart 1.0 Is Out by dgregd on Thursday November 14, 2013 @01:18PM (#6734186)
JavaScript was also build as proprietary enhancement :)
Re:Dart 1.0 Is Out by pjspycha on Thursday November 14, 2013 @08:16PM (#6737081)
People don't really remember what the Web looked like back in Netscape Navigator days. Back then IE replicated some quirks from Netscape so websites would look similar.
Re:Dart 1.0 Is Out by oblio on Friday November 15, 2013 @07:12AM (#6738986)
But does anyone want to return to those days?
Re:Dart 1.0 Is Out by snird on Thursday November 14, 2013 @12:40PM (#6733784)
Dart is as open as possible. this is nothing like silverlight or activex.
Re:Dart 1.0 Is Out by 10098 on Thursday November 14, 2013 @01:19PM (#6734200)
Dart != ActiveX

Oh, and by the way, ActiveX would be awesome if it didn't have all the security flaws and was more portable. Too bad it didn't work.

Re:Dart 1.0 Is Out by melling on Thursday November 14, 2013 @01:20PM (#6734205)
Well, Dart will eventually work best on Chrome because of the Dart VM. There's nothing stopping Mozilla from adding the VM to Firefox, of course. Getting an additional 2x-4x performance boost would be great.
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @04:02PM (#6735542)
There are at least two problems with adding the Dart VM:

1. Standards. The Dart VM is not part of any web standard, nor part of a spec that has interest from multiple vendors, so it should not be shipped in a standards-compliant browser. This is a matter of principle that most browsers agree on these days, see for example Google's Blink guidelines: http://www.chromium.org/blink#new-features

2. Effort. Adding a new VM into a browser is a huge amount of effort. The VM can't just be added even if it is open source (which it is) - it's very hard to integrate such a thing properly into a browser, technically speaking. Also aside from technical effort, there is also effort to start a new standards process for a new language.

Re:Dart 1.0 Is Out by rdtsc on Thursday November 14, 2013 @07:25PM (#6736852)
> 1. Standards. The Dart VM is not part of any web standard

I can see how many would see that as tail wagging the dog. But I see your point. And I agree it should be part of a standard. However I would imagine (and correct me if I am wrong) it is a lot easier to approve and go through the standard approval if there is already an implementation out there to look at. Standardizing on a hypothetical future feature via a large committee, doesn't work too well.

> 2. Effort.

Here, again, this is not a hypothetical, we haven't proven if it is possible we are just dreaming about adding a VM. Dartium works today. Presumably other would have a bit less work to do but it depends on how DOM interaction differs between them.

EDIT: 2nd part initially completely didn't make sense

Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @07:36PM (#6736917)
> However I would imagine (and correct me if I am wrong) it is a lot easier to approve and go through the standard approval if there is already an implementation out there to look at.

I think you are correct. But that implementation does not need to be shipping on by default in a major browser like Chrome.

If Google would promote Dart mainly through dart2js, but not ship the Dart VM in Chrome, then I have no problem with that, and even the opposite - that would be quite cool, new languages are always nice to have. Then, if Dart catches on with developers in the industry, I think it would be very appropriate to discuss standardizing it. The momentum among developers, plus an existing VM that runs it even better, could be a compelling combination, and browser vendors could discuss that in a fair and open way.

But to ship the VM in Chrome far before any of that is a violation of the basic principles of the standards process. It sends the message that Google intends to use Chrome's huge and growing market share to force the market to do what it wants, instead of following the standards process. Perhaps that is not what Google intends, but that is how it can appear.

For that reason, I think that shipping the VM in Chrome is counterproductive if Google wants to standardize it, since it antagonizes all the rest of the industry.

> But it is also not vaporware.

Sorry if I wasn't clear, I never said anything to the contrary? Not sure what you are responding to here - the quote you refer to is about "Effort", where I talked about the effort for other browser vendors to adopt the Dart VM, not for Google. Clearly Google has a working VM today.

Re:Dart 1.0 Is Out by rdtsc on Thursday November 14, 2013 @07:56PM (#6737015)
> But it is also not vaporware. Sorry if I wasn't clear,

Sorry for the confusion, I read that somehow as effect on Google's part to integrate the browser in Chrome in order to have an example of it running to speed up the approval process. I see how it was a total brain fart on my part. Disregard that one. I updated it with actually what I think I was saying.

Re:Dart 1.0 Is Out by georgemcbay on Thursday November 14, 2013 @07:11PM (#6736769)
"The Dart VM is not part of any web standard, nor part of a spec that has interest from multiple vendors"

Which is... exactly the same situation JavaScript was in when Netscape introduced it.

Re:Dart 1.0 Is Out by cwp on Thursday November 14, 2013 @08:05PM (#6737045)
Which is exactly the same situation that Javascript is in now. The Javascript VM in Firefox has features that are not part of any web standard, nor part of a spec that has interest from multiple vendors.
Re:Dart 1.0 Is Out by ahoge on Thursday November 14, 2013 @08:30PM (#6737124)
Yea, Firefox 2.0+ is shipped with support for generators/iterators, array comprehension, let, and destructuring assignment:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...

Firefox 3.0+ added support for expression closures and generator expressions:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...

Firefox 22+ supports fat arrow functions. Just open the console and try it yourself:

  >>> let z = x => x * x;
  undefined
  >>> z(5);
  25
  >>> let y = (a, b) => a * b;
  undefined
  >>> y(2, 3)
  6
None of these features are standardized yet.
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @08:48PM (#6737185)
There is a spec and discussion in the standards bodies for all of those AFAIK. For example for let,

http://wiki.ecmascript.org/doku.php?id=harmony:let

Arrow functions are being standardized as well,

http://wiki.ecmascript.org/doku.php?id=harmony:arrow_functio...

and for generators, the standards discussion led to a change in the spec, with the new version replacing the old implementation in SpiderMonkey (v8 recently implemented the new one as well).

In general see

http://kangax.github.io/es5-compat-table/es6/

where it lists compatibility for various new JS features. As it says there, let is supported not just in Firefox but also IE11 and Chrome 30.

It is true that Firefox shipped some of these several years back. I am not sure of the best way to find out exactly what the standards-track status was at those times.

But in general: Talking about the far past is counterproductive. We can probably find stuff that wasn't done properly by any browser if we look back far enough. But in recent years, there is growing consensus on the importance of not shipping non-standard things. That is the important thing I think.

Re:Dart 1.0 Is Out by rdtsc on Friday November 15, 2013 @12:33AM (#6737920)
Unfortunately, though, this kind of goes against your argument which I understand to be "how dare Google release something that is not standards based". I agree principle with that, _but_ in this case a few posts did show example of technologies that all browser vendors introduces that were outside the spec.

> But in recent years, there is growing consensus on the importance of not shipping non-standard things.

Others might read that as no new and meaningful technologies will be seen implemented in the browsers soon. I can't think of too many thing designed and build by an intercompany commetee.

Re:Dart 1.0 Is Out by azakai on Friday November 15, 2013 @02:20AM (#6738169)
I don't follow, why does it go against that line of argument? If someone else did something bad in the past, it doesn't excuse doing something bad in the present.

(And as mentioned above, I'm not sure about those examples - while it's very possible some were released before being standardized, I didn't see a link showing that, and they are all being standardized now. Need more info.)

Fair point about the limits of things designed by committees. But it isn't always true, just mostly true ;) For example, WebGL was designed through a standards process, and it is great.

Re:Dart 1.0 Is Out by ahoge on Friday November 15, 2013 @07:09AM (#6738977)
> If someone else did something bad in the past [...]

Earlier you mentioned "far past", but this stuff is fairly recent:

Firefox 2 - October 24, 2006

Firefox 3 - June 17, 2008

Firefox 22 - June 25, 2013

> while it's very possible some were released before being standardized

Nothing of this is in ES5.1.

> they are all being standardized now

Yes, just like Dart.

> For example, WebGL was designed through a standards process, and it is great.

No, that's not how it happened. [1]

Experiment by Mozilla - 2006

Implementations by Mozilla and Opera - 2007

WebGL Working Group - 2009

1.0 spec - 2011

And all of this is based on Canvas which is something Apple made up.

Anyhow, you seem to think that this kind of thing is a problem. It's not. This is how the web works. This is how progress is made.

[1] http://en.wikipedia.org/wiki/WebGL#History

Re:Dart 1.0 Is Out by azakai on Friday November 15, 2013 @11:26AM (#6740253)
I consider 2008 to be far past :)

Regarding Firefox 22, that is recent, but I don't see a link showing it shipped something nonstandard and that was not being standardized? In fact I showed a link for the standardization process for arrows? Revision history for that page seems to show that it predates Firefox 22.

> Nothing of this is in ES5.1.

They are in ES6, which is being standardized, has interest from multiple vendors, is heavily discussed by multiple vendors, and has implementations by multiple vendors.

I never said everyone should wait until a standard is 100% final. Just like the Blink principles say, it can be perfectly valid to ship something that is being standardized, so long as there is interest from multiple vendors and work on standardization.

The risk is of one vendor shipping something entirely unilaterally, with no respect for any standards process. That's not what happened with arrows.

> > they are all being standardized now

> Yes, just like Dart.

AFAIK no other vendor has expressed any interest in Dart. The opposite in fact, Apple opposed including bindings to WebKit that would allow additional languages to JS. Please correct me if I am wrong?

> Anyhow, you seem to think that this kind of thing is a problem. It's not. This is how the web works. This is how progress is made.

I disagree. Why then do you think Google wrote the Blink principles about avoiding shipping something before it is standardized or has multiple vendor interest? Why did Google stop shipping vendor-specific WebGL extensions? In both cases Google is showing what most vendors consider proper behavior today, and I think Google is doing the right thing. Do you think Google is wrong in both cases?

Re:Dart 1.0 Is Out by trycatch on Thursday November 14, 2013 @11:50PM (#6737799)
And Firefox actively _removes_ these features. For example, sharp variables were removed in Firefox 12, E4X was removed in Firefox 20.
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @08:26PM (#6737109)
What specifically do you refer to?
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @07:28PM (#6736879)
That's correct, but see my response at https://news.ycombinator.com/item?id=6736764 - that was 18 years ago, the industry has changed a lot since then.
Re:Dart 1.0 Is Out by mhd on Thursday November 14, 2013 @05:19PM (#6736087)
As an alternative, just working on/sponsoring/begging for an asm.js target might be enough to equalize performance.
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @05:53PM (#6736307)
Not sure asm.js would make sense for something like Dart, since it is mainly intended for things like C and C++ (Dart is a dynamic language, and needs different forms of optimization).

However, I think it would be fun to explore that direction! I'd be happy to collaborate with Dart VM people on that.

Re:Dart 1.0 Is Out by mistercow on Thursday November 14, 2013 @06:39PM (#6736577)
I think we can be fairly sure that targeting asm.js would degrade performance for a language like Dart.
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @07:01PM (#6736710)
I suspect you might be right, but I am far from certain - can you elaborate?

My concerns are about things like PICs, but code generation is possible, so replacing functions to change PICs is one way to implement them. This is, I think, how the Graal project does JavaScript and Ruby, and they get very good performance.

Re:Dart 1.0 Is Out by lttlrck on Thursday November 14, 2013 @07:04PM (#6736726)
It was the same story with javascript.
Re:Dart 1.0 Is Out by azakai on Thursday November 14, 2013 @07:10PM (#6736764)
That's a fair point in that yes, JavaScript was nonstandard when it was first included in a web browser.

But it is an incorrect point in that the field has changed a lot, for the better - most or all browser vendors want to play nicely these days. Even Microsoft is supporting the standards process and implementing WebGL, for example. The principles guiding browser vendors are more like these which Google wrote for Blink:

http://www.chromium.org/blink#new-features

> In practice, we strive to ensure that the features we ship by default have open standards.

That was not the case 18 years ago, but thankfully it is today. 18 years ago it might have been common practice to just ship a new VM in a browser, but to do so today with no regards for the standards process would be unexpected and improper.

Re:Dart 1.0 Is Out by gkhnarik on Thursday November 14, 2013 @12:44PM (#6733828)
The code will be compiled to JS, I don't think it is gonna make difference which browser you use.