No header files?

Yigal Chripun yigal100 at gmail.com
Wed Oct 21 15:44:14 PDT 2009


On 22/10/2009 00:14, BCS wrote:
> Hello Yigal,
>
>> On 21/10/2009 23:59, AJ wrote:
>>
>>> Since D has no header files, how does one create "a library" that
>>> another developer can use without exposing the implementation?
>>>
>> D does have header files with the extension .di which can be either
>> auto generated and/or manually edited. IMO this is a design mistake
>> carried over from c/c++.
>>
>
> What would you prefer?
>
> Aside from a better library format you need something to give DMD the
> information. Switching to a better library format has several issues
> including requiring more tools to make them and view them as well as it
> doesn't solve the problem of linking with C libs that don't and never
> will use this new format. Not fatal issues I'll grant, but what we have
> works NOW.
>
>

As you said, what is needed is a better lib format. we already have DDL 
NOW which already has most of what you described above. D can also take 
advantage of the LLVM framework.

why do you need to choose between the two options anyway? dmd can 
support c header files combined with c libs and use a better D lib 
format for D code. Another option would be to have a simple tool to 
convert a bunch of c header files and a C lib to a D lib.

The C/C++ way of headers + lib has problems which D inherited as part of 
the same (broken) design.



More information about the Digitalmars-d mailing list