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

Etienne via Digitalmars-d digitalmars-d at puremagic.com
Thu May 15 13:34:31 PDT 2014


Following my previous post about new opportunities for D with ASM.js, 
I've caught up with a lot of reading about Dart after seeing the 
seriousness of the project and a virtual machine being integrated to 
chrome directly. The benchmarks are already very promising[1]

My position has changed, and I now think D would be in a better position 
if it ran in the Dart VM. In other words, ASM.js has become the Dart 
language - the solution is to introduce a D to Dart compiler[2]. This 
compiler would be written in D with Pegged, the same way I'm writing 
this ASN.1 compiler[3]

This would require the interfaces from the Dart libraries (front-end DOM 
objects) to be built into a D library. Of course, the D=>Dart compiler 
would need to handle druntime and phobos as well for complete 
integration. I don't think this task is half as complicated as it would 
have been to go the D=>LLVM=>ASM.js route.

The best part of it all is this: you can compile the back-end 
(server-side) code to a binary executable using vibe.d and achieve 
immense performance improvements vs what runs in the Dart VM, and send 
the front-end code to Dart. This obviously seems like a durable and 
promising opportunity.

Comments?

[1] https://www.dartlang.org/performance/
[2] https://www.dartlang.org/articles/why-not-bytecode/#compiling-to-source
[3] https://github.com/globecsys/asn1.d


More information about the Digitalmars-d mailing list