Dynamic alter-ego of D.

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Tue Oct 25 03:00:28 PDT 2011


I think adding more dynamic typing to D would be a splendid idea to
further widen the variety of solutions for different problems.
Modular app development is a very good practice and modularity means
dynamicity, which in turn means, that one needs to give up on lots of
sweet stuff like templates, overloading and string mixins.
Variant is the first step towards dynamic alter-ego of D, which is
completely undeveloped currently.
Although my benchmarks show, that variant is quite slow and I'd really
like a version of variant, optimized for ultimate performance.
Also, there are lots of stuff, that i really need at run-time, which i
only have at compile-time:
* Interfaces. dynamic interfaces are very important to highly modular
applications, heavily based on plugins. By dynamic interfaces i mean
the set of attributes and methods of an object, which is only known at
run-time.
* Overloading. A.K.A multimethods. required by dynamic interfaces.
* Dynamic templates. In other words, value-based overloading (since
type is yet another attribute of dynamically typed data).

Dynamic interfaces are also different from static ones because the
interface isn't _implemented_ by a type, it's _matched_ by a type,
which means, that if a type fits into an interface at run-time, i can
safely cast it to that interface type and work with it.

Being able to obtain the dynamic version of a delegate would be great
to pass around generic callbacks.


More information about the Digitalmars-d mailing list