On Thursday, 11 October 2012 at 07:10:57 UTC, Jacob Carlborg wrote:
On 2012-10-11 04:54, Jesse Phillips wrote:
I think it would be much better to work with packages and not individual libraries. You would just tell the build tool, compiler or whatever to use package "foo". Then the package manager figures out what libraries and dependencies it needs to link to and also the path to the import files.

Why can't I just tell the compile that I need library "foo," and the package manager can handle finding the package which provides that library?

Packages depend on other packages, code depends on other code. I don't think it makes sense for code to depend on a package. Granted, packages could provide code that is depended on...

On the note about flags... Most of them are external to the code, you could say they are the options of the package. However, for libraries, we have a separate program which can operate without the source code, thus the historical reason code dependencies are not stated in the code. Why should we have 'import?' Can't we just tell the compiler the files it will need for its symbols separately, I don't know... maybe we could add a flag to specify them so it would feel strange to have them in the source code too. (Sorry couldn't pass it up)

As for the version number, you are right, I should know. But much of the code I write/use doesn't make release. This is where a handy and easy to use package manager comes in. Releases become simpler, there can be verified and tested versions of the depended libraries. But even with a tested version, that doesn't mean it will fail with older or newer versions of the package.

Linux creates symbolic links to its shared libraries to provide an unversioned link. And while all the packages know which version that is, third part applications do not. Yes, this arbitrary guessing game has its problems, but so does the strict version requirements. I've had to create symbolic links to a newer library to pretend I had an older version (as digging up such a version becomes hard when the package manager becomes worthless).

Anyway, I look forward to a good packaging system for D. But stating the dependency in that doing the depending does make sense. However I've realized that the dependency on a library only makes sense for header files, and header files only make sense when interfacing with C. Dependency on D code and libraries all come stated from the 'import' statement.

Reply via email to