Is there such a thing?

Taylor Hillegeist via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 26 14:10:15 PST 2015


On Thursday, 26 February 2015 at 21:37:46 UTC, Marc Schütz wrote:
> On Thursday, 26 February 2015 at 19:53:54 UTC, Taylor 
> Hillegeist wrote:
>> So, In languages like .net they have dll's that contain not 
>> only bytecode but also the necessary headers to make them 
>> usable in any .net language. I was curious if this kind of 
>> thing has ever been attempted for static libraries?
>>
>> basically some type of universal header + static library = 
>> Everything Needed to use in project file.
>>
>> of course they would be targeted for a certain platform but 
>> would be really easy to grab/use.
>>
>> And if the header could be agreed upon any compiled language 
>> could use the library which would be a huge benefit.
>>
>> Perhaps i'm incorrect in my assumptions. Let me know what you 
>> think about the idea?
>
> IIRC, Pascal unit files work that way. No interface source file 
> is required to use them.

That Looks pretty close to exactly correct:
http://www.freepascal.org/docs-html/user/userse11.html

It was still two files but it looks like the .ppu was analogous 
to a c header. like the compiler striped out all the necessary 
declarations. Very interesting... But I don't think it makes it 
easier to link to with d. The idea is pretty cool though. I 
wonder if other compilers do the work of creating sources with 
the logic striped out for use as a header only.

One of the listed uses for a unit was if the developer wanted to 
hide his ip but allow others to use the code.

Does D have a way of doing this?


More information about the Digitalmars-d mailing list