www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [RFC] Runtime, interfaces and implementations.

I have mentioned this on IRC quite few times in the past years, 
as well here on the newsgroups...

I really think the D runtime should have a std.api package 
containing what I call "module interfaces" (something similar to 
how Modula-3 treats interfaces and modules), and all existing std 
modules would "implement" these interfaces.

As pointed out in one of the threads where we touched this topic, 
we already have this in gc.gcinterface and gc.impl.manual.gc !

https://github.com/dlang/druntime/blob/master/src/gc/gcinterface.d
https://github.com/dlang/druntime/blob/master/src/gc/impl/manual/gc.d

I would even go to the next level, and extend the D language to 
support this via something like:

module mylib.foo extends api.bar;

where api.bar is somewhere in ../api/bar.di file that starts with:

module interface api.bar;

Naturally, there is tight relation with "module interface" and 
the .di extension...
Oct 26 2016