Results 1 to 6 of 6

Thread: About C, Dll/so, headers and life

  1. #1

    About C, Dll/so, headers and life

    Quote Originally Posted by marcov
    (wx.net is a C level wrapper dll around the C++ wxWindows, meant for easier importing in .NET, but that goes for FPC too. wx.net itself is not .NET)
    This made me think about a thing..

    All libraries and dll that are written with whatever language need headers to be used in other languages.. actually, they need headers also for the language they are written (so for example you have sdl.h, gtk.h etc, etc).
    This lead to a great amount of work to be done for every language that uses the library. They often have a big number of API and types (thousands) so that translating a header is usually very hard.
    I was thinking: is all this work really necessary? Couldn't it be done automatically?
    The answare is that it could all be avoided, imho.
    For example, the dll/so could include procedures, parameters and data types.. They could be designed in a language independent way (for example giving basic information about it: "signed 8 bit, unsigned 32 bit, float IEEE 32 bit, etc", this could include also records (let's avoid classes..). For procedure , the specification could indicate calling convention and parameter passing mode).
    In this way, each language could have set of translation rules from which to derive automatically language-dependet types and calls. At this point one could autogenerate header files (or also avoid using them at all).
    The specification could be included in the DLL or shipped with a companion file.

    The implementation of this system would not be hard since the compiler of the dll/so already have all the information it need.. it should only write them down.

    Obviously all this apply only where languages have compatible features, that is practically all except classes.

    I hope i was clear :mrgreen:
    What do you think about this ? Is it a flow of non-sense ?

    I'll sleep over it
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  2. #2

    About C, Dll/so, headers and life

    Are you talking about IDL?

    PS. The .NET is solution here - then programmiong in .NET languages you don't need headers at all!
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    About C, Dll/so, headers and life

    Quote Originally Posted by Clootie
    Are you talking about IDL?
    Well possibly something like that. I don't know that very well.
    But can that be used in the way i said ?

    PS. The .NET is solution here - then programmiong in .NET languages you don't need headers at all!
    I hate .NET.
    I could shot myself instead of programming in .NET
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  4. #4

    About C, Dll/so, headers and life

    Quote Originally Posted by {MSX}
    Quote Originally Posted by Clootie
    Are you talking about IDL?
    Well possibly something like that. I don't know that very well.
    But can that be used in the way i said ?
    IDL is a standart to expose headers. IIRC CORBA using it as a standart. Delphi, C++ have IDL import, generating proprietary language headers from IDL file.

    Quote Originally Posted by {MSX}
    PS. The .NET is solution here - then programmiong in .NET languages you don't need headers at all!
    I hate .NET.
    I could shot myself instead of programming in .NET
    Well then in Windows world you will not have a future after about 5 years
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    About C, Dll/so, headers and life

    Quote Originally Posted by Clootie
    IDL is a standart to expose headers. IIRC CORBA using it as a standart. Delphi, C++ have IDL import, generating proprietary language headers from IDL file.
    So why aren't we using this to produce headers ?

    Quote Originally Posted by {MSX}
    I hate .NET.
    I could shot myself instead of programming in .NET
    Well then in Windows world you will not have a future after about 5 years
    Eheh i don't have a future in windows right now Already using it 99% of the time (except at work.. )
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  6. #6

    About C, Dll/so, headers and life

    Quote Originally Posted by {MSX}
    Quote Originally Posted by Clootie
    IDL is a standart to expose headers. IIRC CORBA using it as a standart. Delphi, C++ have IDL import, generating proprietary language headers from IDL file.
    So why aren't we using this to produce headers ?
    Because C++ developers don't care?
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •