From frog to dart2js

8 views
Skip to first unread message

Dominic Hamon

unread,
May 25, 2012, 4:34:17 PM5/25/12
to dartbox2...@googlegroups.com
As of now, dartbox2d's generated javascript is created using dart2js rather than frog, as per the announcement here.

This change uncovered a couple of issues that were latent due to the previous compiler not implementing the same rules as the VM in some cases. These issues are now fixed.

However, the Javascript version has seen a significant performance regression with this change, and a bug has been logged against Dart here. You can star it if you want to follow along. This regression shouldn't affect users of the Dart version unless you end up compiling to Javascript before deployment.

Thanks

- dominic

Rupert Key

unread,
May 26, 2012, 6:14:39 AM5/26/12
to dartbox2...@googlegroups.com
Hi, Dominic
LOL, think we did the same work at the same time :-D (though your switching to requestAnimationFrame() is better :-) )

Do you also need to update Bench2d.dart to account for requestAnimationFrame() no longer taking the Canvas argument?

i.e. (albeit done without switching from webkitRequestAnimationFrame()):
http://code.google.com/r/rupertkey-dartbox2d-20120524/source/diff?spec=svn62e842bd830aa2fd7de29731cc62948b904e92b3&r=62e842bd830aa2fd7de29731cc62948b904e92b3&format=side&path=/demos/Bench2d.dart 

HTH, Rupert.

Dominic Hamon

unread,
May 29, 2012, 12:10:57 PM5/29/12
to dartbox2...@googlegroups.com
Ah yes, I missed Bench2d somehow.

I would like the compiler to complain about unknown methods called on objects, but I suppose that is the problem with compiling to Javascript and its infinite flexibility.

Please feel free to submit a patch for that.

- dominic

Dominic Hamon

unread,
May 31, 2012, 2:32:02 PM5/31/12
to Dartbox2d discuss
Bench2d is now updated.

On May 29, 9:10 am, Dominic Hamon <domin...@google.com> wrote:
> Ah yes, I missed Bench2d somehow.
>
> I would like the compiler to complain about unknown methods called on
> objects, but I suppose that is the problem with compiling to Javascript and
> its infinite flexibility.
>
> Please feel free to submit a patch for that.
>
> - dominic
>
>
>
>
>
>
>
> On Sat, May 26, 2012 at 3:14 AM, Rupert Key <rupert....@gmail.com> wrote:
> > Hi, Dominic
> > LOL, think we did the same work at the same time :-D (though your
> > switching to requestAnimationFrame() is better :-) )
>
> > Do you also need to update Bench2d.dart to account for
> > requestAnimationFrame() no longer taking the Canvas argument?
>
> > i.e. (albeit done without switching from webkitRequestAnimationFrame()):
>
> >http://code.google.com/r/rupertkey-dartbox2d-20120524/source/diff?spe...
>
> > HTH, Rupert.
>
> > On Friday, May 25, 2012 9:34:17 PM UTC+1, Dominic Hamon wrote:
>
> >> As of now, dartbox2d's generated javascript is created using dart2js
> >> rather than frog, as per the announcement here<http://news.dartlang.org/2012/05/dart2js-now-default-compiler-in-dart...>
> >> .
>
> >> This change uncovered a couple of issues that were latent due to the
> >> previous compiler not implementing the same rules as the VM in some cases.
> >> These issues are now fixed.
>
> >> However, the Javascript version has seen a significant performance
> >> regression with this change, and a bug has been logged against Dart here<http://dartbug.com/3250>.
Reply all
Reply to author
Forward
0 new messages