Friday, April 19, 2013

Dart: Static or Dynamic?

Dart Language folks just announced plans to make reflection more statically analyzable. Full-core reflection makes optimization hard. Yes, I believe that.

So, what does it mean to be "dynamic and proud of it"? To "take full advantage of its dynamic typing" means simple static analysis isn't so easy. Are there are specifically indicated advantages to dynamic typing that they actually claim anywhere?

And the current Dart VM doesn't get anywhere near Java for performance, despite claims that type checks don't help. Maybe they just need more time to optimize the VM? And as for producing tight JS, I suspect enforced type checks would avoid the need to whole program analysis.

Is Dart trying to get the worst of both worlds? More difficult optimization? Slower performance? No dynamic tricks? An unenforced static nominal type system with runtime structural typing?

I only casually observe Dart, so maybe I'm missing something, but I'm not sure they know their target.

On the other hand, I had been dismissing Microsoft's TypeScript for a while, but tried it out this past week. No Eclipse love, but TypeScript actually does a good job of providing the JS we already know but with a static analysis system (and no Dart-like fear of that "inference" word) that's adapted to existing JS usage patterns. It's pretty good.