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

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Thu May 15 23:14:27 PDT 2014


On Thursday, 15 May 2014 at 22:16:06 UTC, Etienne wrote:
> On 2014-05-15 6:04 PM, "Ola Fosheim Grøstad"
>> 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?
>
> Templates are compile-time, a D compiler always takes care of 
> all its compile-time duties =)
>
>> Dart2js produce large files, acceptable performance, but big.
>
> That's a temporary issue, I'm looking at years from now when/if 
> Dart is more mature and implemented in more browsers as an 
> alternative to javascript
>
> Also, I talked about caching in the VM
>
> http://1.bp.blogspot.com/-W1p7BELpIDE/UH42kXZeFsI/AAAAAAAANLA/kZGulTfNjQg/s1600/Screen+Shot+2012-10-16+at+9.39.29+PM.png
>
>
>> 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.
>
> There's a lot of advantages to a source-code VM vs a bytecode 
> VM.
>
> Javascript is compiled into a source-code VM, sure it'll never 
> exceed the power of a byte-code VM because without more type 
> information the optimization opportunities are limited
>

Only if you are speaking about V8, as the other VMs (Nashorn, 
Webkit, Gecko) do use bytecodes, multiple levels actually.

--
Paulo


More information about the Digitalmars-d mailing list