DIP11: Automatic downloading of libraries

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jun 14 07:47:32 PDT 2011


On 6/14/11 9:09 AM, Vladimir Panteleev wrote:
> On Tue, 14 Jun 2011 16:53:16 +0300, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> http://www.wikiservice.at/d/wiki.cgi?LanguageDevel/DIPs/DIP11
>
> Why this is a bad idea:
> 1) It hard-codes URLs in source code. Projects often move to other
> code-hosting services. PHP, Python, Perl, not sure about Ruby all have a
> central website which stores package metadata.

The way I see it, transitivity should take care of this. Consider:

// File http://dsource.org/libs/mysql.d
pragma(liburl, mysql, "http://some.site.org/d/mysql.d")
import mysql;

// User file
pragma(liburl, dsource, "http://dsource.org/libs/");
import dsource.mysql;

With transitivity you can arrange central repos via an additional level 
of indirection.

> 2) It requires that the raw source code be available via HTTP. Not all
> code hosting services allow this. GitHub will redirect all HTTP requests
> to HTTPS.

URL includes https and ftp.

> 3) It only solves the problem for D modules, but not any other possible
> dependencies.

Correct. So we should extend this towards handling other scenarios too.

> I understand that this is a very urgent problem, but my opinion is that
> this half-arsed solution will only delay implementing and cause
> migration problems to a real solution, which should be able to handle
> svn/hg/git checkout, proper packages with custom build scripts,
> versioning, miscellaneous dependencies, publishing, etc.

Finding weakness in a proposal is easy. The more difficult thing to do 
is to find ways to improve it or propose alternatives.


Andrei


More information about the Digitalmars-d mailing list