<div dir="ltr"><div>A1)</div>Google's Dart (<a href="https://www.dartlang.org">https://www.dartlang.org</a>) looks like a very promising replacement for javascript. It can compile to javascript to ensure portability (but chromium runs it natively) but the language itself reminds more of D to a surprising extent. Dart language has features such as:<div>
<br></div><div><br></div><div>static typing (but can also have dynamic typing, akin to std.variant, with better support/syntax than D)<br></div><div>ahead of time compilation</div><div>unicode support</div><div>built in serialization/deserialization via json </div>
<div>annotations<br></div><div>mixins (used to emulate multiple inheritance)</div><div>generics</div><div>vector/AA litterals</div><div>alias (called typedef in dart), is, assert<br></div><div>try/catch/finally<br></div><div>
operator overloading</div><div>properties (same parenthesis-less caller syntax as in D)</div><div>delegates (called closures)<br></div><div>nesting functions, 1st class functions, lambda => syntax</div><div>DDOC (called dartdoc)</div>
<div>D-like syntax and nesting comments,</div><div>introspection (runtime only AFAIK)<br></div><div><br></div><div><div>A2)</div></div><div>Also features that would be nice to have in D or were better designed than in D:</div>
<div><br></div><div>* cascade operations: they perform a series of operations on the members of a single object:</div><div>foo.bar(1)..baz(3)</div><div>equivalent to:</div><div>foo.bar(1)</div><div>foo.baz(3)</div><div><br>
</div><div>* better way to define default constructors:<br></div><div><div>class Point {</div><div>  num x;</div><div>  num y;</div><div>  num z;</div><div>  // Syntactic sugar for setting z and x before the constructor body runs.<br>
</div><div>  Point(this.z, this.x){...}</div><div>}</div></div><div>This is more explicit and flexible than D's way for default struct constructors, which can only allow to set all fields in order, without skipping some, and doesn't allow to do anything else in the ctor.</div>
<div><br></div><div><div>* named constructors</div><div><br></div><div>* distinguish integer divide (~/) vs divide (/), so that 5/2=2, 5~/2=2</div></div><div><br></div><div><div>* shorthand function declaration with => (used not just for lambdas)</div>
<div><br></div></div><div>* for (var x in collection) //better syntax than foreach(var;collection)<br></div><div><br></div><div>* better syntax for optional positional arguments:</div><div>void fun(int x, [int y, int z=3]){...}</div>
<div>Thinking of which, this would actually solve a long standing problem in D, that of specifying optional parameters AFTER a variadic template:</div><div>void fun(T...)(T args, [string file=__FILE__,int line=__LINE__]){...}</div>
<div><br></div><div>* export for libraries</div><div><br></div><div>* async/wait etc</div><div><br></div><div>* great IDE/debugger/package manager/static analyzer</div><div><br></div><div>also the following which I've previously proposed adding to D:</div>
<div><br></div><div>* string interpolation $variableName (or ${expression})</div><div><div>assert('foo. ${s.toUpperCase()} bar' == 'foo. STRING INTERPOLATION bar');</div></div><div><br></div><div><div>* optional named parameters arguments (with simplest possible syntax)</div>
</div><div><div><br></div><div>* import all except specified symbols:</div><div>import 'package:lib2/lib2.dart' hide foo; // Import all names EXCEPT foo.<br></div></div><div><br></div><div><div>A3)</div></div><div>
And then some design decisions which wouldn't work for D: everything is an object, no struct (just class), VM, etc.</div><div><br></div><div>A4) </div><div>there were may previous threads regarding using D on the web via compiling to javascript. In light of this it would seem a lot easier to compile D to dart.</div>
<div><br></div></div>