February 28, 2015
On Friday, 27 February 2015 at 19:49:37 UTC, 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...

C is pretty much a standard for cross-language ABI
February 28, 2015
On Friday, 27 February 2015 at 19:49:37 UTC, Taylor Hillegeist wrote:
> 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...

On Windows that standard it is called COM for OO languages, stdcall/pascal for procedural ones and BCL for those targeting .NET.

--
Paulo
February 28, 2015
On Saturday, 28 February 2015 at 17:24:57 UTC, Paulo Pinto wrote:
> On Friday, 27 February 2015 at 19:49:37 UTC, Taylor Hillegeist wrote:
>> 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...
>
> On Windows that standard it is called COM for OO languages, stdcall/pascal for procedural ones and BCL for those targeting .NET.
>
> --
> Paulo

Sorry, should have written CLS (Common Language Specification) for those targeting .NET.
March 01, 2015
On 2015-02-28 18:06, Dicebot wrote:

> C is pretty much a standard for cross-language ABI

You still need a way to define the bindings.

-- 
/Jacob Carlborg
March 03, 2015
On Saturday, 28 February 2015 at 17:06:58 UTC, Dicebot wrote:
> On Friday, 27 February 2015 at 19:49:37 UTC, 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...
>
> C is pretty much a standard for cross-language ABI

Object files have no language-level compatibility, only linker-level compatibility. You can get function arguments wrong, and linker won't tell you.
March 03, 2015
On Tuesday, 3 March 2015 at 10:37:49 UTC, Kagamin wrote:
> On Saturday, 28 February 2015 at 17:06:58 UTC, Dicebot wrote:
>> On Friday, 27 February 2015 at 19:49:37 UTC, 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...
>>
>> C is pretty much a standard for cross-language ABI
>
> Object files have no language-level compatibility, only linker-level compatibility. You can get function arguments wrong, and linker won't tell you.

So, I don't thing C is very easy to pull data from, In fact i would guess the only way this would work is if the compiler produced standard data format like JSON or XML or YAML if you like that kind of thing. And then transformed it to native code.

<CStyleFunction="Foo">
  <ReturnType>
    <sint32>
  </ReturnType>
  <Parameter>
    <Float64="MyFloat">
  </Parameter>
</CStyleFunction>

I think YAML would look nicer... I also know that some languages have certain capabilities. And this is a lot more complex of problem. But I hear about people making automatic binding generators and all sorts of 1 off tools, I just don't understand why there doesn't seem to be common standard solution.
March 04, 2015
On Tuesday, 3 March 2015 at 17:17:18 UTC, Taylor Hillegeist wrote:
> <CStyleFunction="Foo">
>   <ReturnType>
>     <sint32>
>   </ReturnType>
>   <Parameter>
>     <Float64="MyFloat">
>   </Parameter>
> </CStyleFunction>

That's WSDL. It works fine for simple data types. The problem is what to do with complex data types.
1 2
Next ›   Last »