The Delphi programming language allows specifying the DLL name right on the declaration of extern symbols:

function GetVersion: DWORD; stdcall; external 'kernel32.dll';

I would like to suggest adding something similar to D:

extern(Windows, "kernel32.dll") DWORD GetVersion();

Rationale:

This absolves the need for import libraries.

* Import libraries are a major and unnecessary pain in the neck when using DLLs of any kind.

* Import libraries may need conversion from COFF format to OMF format with a tool which is not included with D (coffimplib).

* Import libraries can *sometimes* be created from the DLL using implib, but this does not always work, depending on the calling convention and its mangling.

* Name mangling mismatches are difficult to diagnose.

* Import libraries cannot be used with tools such as "rdmd", except via pragma(lib).

Any thoughts? DIP or not?

Reply via email to