DIP11: Automatic downloading of libraries

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jun 14 09:35:44 PDT 2011


On 6/14/11 11:32 AM, Graham Fawcett wrote:
> On Tue, 14 Jun 2011 15:59:15 +0000, Adam D. Ruppe wrote:
>
>>> One other interesting aspect is that the string literal can be
>>> CTFE-constructed,
>>
>> Oh, or it could be in version {} blocks. I like that.
>>
>> I think we should actually whip up a working model. It needn't be a
>> compiler feature at this point - we can use pragma(msg, "BUILD: " ~
>> param) for now and have a helper program scan dmd's output.
>
> +1, sounds fun. :)
>
> Rather than pragma(msg), you could also use pragma(liburl), and run dmd
> with "-ignore -v". You can parse the pragma from there. (I think you'd
> need to write `pragma(liburl, "name-in-quotes", "url-in-quotes")`, a
> slight diversion from Andrei's syntax, but otherwise it would work.)
>
> Graham

I just realized that one advantage of the download being integrated in 
the compiler is that the compiler is the sole tool with full knowledge 
and control of what modules are imported. A tool could repeatedly run 
the compiler with -v and see what modules it couldn't load, to then 
download them. (Also, of course, a tool could rely on extralinguistic 
library management control that has its own advantages and disadvantages 
as we discussed.)

Andrei


More information about the Digitalmars-d mailing list