Dub integrated into the compiler?

Tofu Ninja via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 26 20:34:34 PDT 2014


On Monday, 27 October 2014 at 02:58:15 UTC, ketmar via 
Digitalmars-d wrote:
> i think it would be better to develop something like "universal
> interface" for this. so we can configure compiler to exec 
> external
> program which does all the things. this way it wouldn't be tied 
> to dub.

The universal interface to such a things could simply be an exe 
that gets called when an import is not found asking for the path 
of the import. The exe can do all sorts of things(like 
downloading from dub) before it finally returns the path to the 
import.

It would need someway to pass extra information to it though(like 
version specifiers) because I think it wouldn't work if it was 
embedded in the import statement it self(i mean as part of the 
import path which would not match with the actual module name).

> by the way, i believe that something like this can be done with
> external wrapper like rdmd. dubdmd, for example, which analyses 
> imports
> the same way rdmd does and invokes dub for all missing 
> libraries, and
> then invokes dmd with necessary options added.

It probably could, I didn't even think about that. But I think 
you're "universal" interface idea is a bit better and it seems 
like something that could very easily be added to rdmd or dmd 
itself in a jiffy.


More information about the Digitalmars-d mailing list