D to ASM.js vs D to Dart (VM)

via Digitalmars-d digitalmars-d at puremagic.com
Thu May 15 15:04:26 PDT 2014


On Thursday, 15 May 2014 at 21:33:24 UTC, Etienne wrote:
> There's really no issue with big files, because dart minify, 
> tree shaking and the general VM caching opportunities & further 
> optimizations can take care of it.

It can do some tree shaking if you turn off metainfo. But D 
templates is bound to lead to bloat. Dart is a dynamic language 
and does not benefit much from templates. The power of Dart is in 
closures, but are you sure that D closures are compatible?

>> 1b. Compiling from D to Dart to JS will lead to insanely big 
>> files.
>
> This compiler would be a bet that the VM can offer more and 
> better optimizations. Tree shaking and minification can provide 
> good advantages and refactoring opportunities for the time 
> being, it's nothing we've never seen with the current JS 
> libraries.

Dart2js produce large files, acceptable performance, but big.

> The idea so far has been that the Dart VM will run on source 
> code rather than bytecode like PNaCl, and it will be faster for 
> it.

Never. PNaCl will stay faster, it is IR based and multi threaded. 
Dart is a dynamic language designed to be JS compatible. The 
advantage with dart source distribution is in download size and 
future proof compatibility, not speed.



More information about the Digitalmars-d mailing list