DIP11: Automatic downloading of libraries
Graham Fawcett
fawcett at uwindsor.ca
Tue Jun 14 09:52:30 PDT 2011
On Tue, 14 Jun 2011 11:35:44 -0500, Andrei Alexandrescu wrote:
> 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.)
You could get pretty far with an external tool, as long as the pragmas
were explicit in the source, and not generated by mixins at compile time.
That's the point at which compiler support becomes more than nice-to-have.
Graham
More information about the Digitalmars-d
mailing list