Thread overview | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 26, 2015 Is there such a thing? | ||||
---|---|---|---|---|
| ||||
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? |
February 26, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist | 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.
|
February 26, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Schütz | 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? |
February 27, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist Attachments: | On Thu, 26 Feb 2015 22:10:15 +0000, Taylor Hillegeist wrote:
> 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?
you can compile static library and provide autogenerated .di file. compiler will strip out all unnecessary parts from it.
|
February 27, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist | On 2015-02-26 20:53, 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? I think it's better to use a package manager to handle this. It will also automatically download the necessary files. Also it will help (hopefully) you to find the libraries you need. -- /Jacob Carlborg |
February 27, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Friday, 27 February 2015 at 07:26:06 UTC, Jacob Carlborg wrote:
> On 2015-02-26 20:53, 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?
>
> I think it's better to use a package manager to handle this. It will also automatically download the necessary files. Also it will help (hopefully) you to find the libraries you need.
I just think its a shame that all over the place people are compiling code in different programming languages, and although all the .o files are compatible with each other there isn't a standard cross language way of defining a binding. But that would be making people agree on things...
|
February 27, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist | On 2015-02-27 20:49, Taylor Hillegeist wrote: > I just think its a shame that all over the place people are compiling > code in different programming languages, and although all the .o files > are compatible with each other there isn't a standard cross language way > of defining a binding. But that would be making people agree on things... I think that's a completely different topic. -- /Jacob Carlborg |
February 27, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Fri, Feb 27, 2015 at 09:00:56PM +0100, Jacob Carlborg via Digitalmars-d wrote: > On 2015-02-27 20:49, Taylor Hillegeist wrote: > > >I just think its a shame that all over the place people are compiling code in different programming languages, and although all the .o files are compatible with each other there isn't a standard cross language way of defining a binding. But that would be making people agree on things... > > I think that's a completely different topic. [...] http://xkcd.com/927/ :-P T -- It is widely believed that reinventing the wheel is a waste of time; but I disagree: without wheel reinventers, we would be still be stuck with wooden horse-cart wheels. |
February 28, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Friday, 27 February 2015 at 21:15:10 UTC, H. S. Teoh wrote:
> On Fri, Feb 27, 2015 at 09:00:56PM +0100, Jacob Carlborg via Digitalmars-d wrote:
>> On 2015-02-27 20:49, Taylor Hillegeist wrote:
>>
>> >I just think its a shame that all over the place people are compiling
>> >code in different programming languages, and although all the .o
>> >files are compatible with each other there isn't a standard cross
>> >language way of defining a binding. But that would be making people
>> >agree on things...
>>
>> I think that's a completely different topic.
> [...]
>
> http://xkcd.com/927/
>
> :-P
>
>
> T
Yes, But in this case there is like 300 non-competing non-standards.
|
February 28, 2015 Re: Is there such a thing? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist | On Sat, Feb 28, 2015 at 12:35:56AM +0000, Taylor Hillegeist via Digitalmars-d wrote: > On Friday, 27 February 2015 at 21:15:10 UTC, H. S. Teoh wrote: > >On Fri, Feb 27, 2015 at 09:00:56PM +0100, Jacob Carlborg via Digitalmars-d wrote: > >>On 2015-02-27 20:49, Taylor Hillegeist wrote: > >> > >>>I just think its a shame that all over the place people are compiling code in different programming languages, and although all the .o files are compatible with each other there isn't a standard cross language way of defining a binding. But that would be making people agree on things... > >> > >>I think that's a completely different topic. > >[...] > > > > http://xkcd.com/927/ > > > >:-P > > > > > >T > > Yes, But in this case there is like 300 non-competing non-standards. And soon there will be 301 non-competing non-standards. ;-) T -- Question authority. Don't ask why, just do it. |
Copyright © 1999-2021 by the D Language Foundation