Windows API and druntime/Phobos

Marco Leise Marco.Leise at gmx.de
Thu Jan 26 13:31:55 PST 2012


Am 26.01.2012, 18:47 Uhr, schrieb Jacob Carlborg <doob at me.com>:

> On 2012-01-26 15:46, Manu wrote:
>> On 26 January 2012 16:45, Manu <turkeyman at gmail.com
>> <mailto:turkeyman at gmail.com>> wrote:
>>
>>     On 26 January 2012 16:33, Marco Leise <Marco.Leise at gmx.de
>>     <mailto:Marco.Leise at gmx.de>> wrote:
>>
>>         Am 26.01.2012, 05:08 Uhr, schrieb Brad Roberts
>>         <braddr at puremagic.com <mailto:braddr at puremagic.com>>:
>>
>>             On 1/24/2012 8:48 PM, Jonathan M Davis wrote:
>>
>>                 The level of support for the Windows API in druntime and
>>                 Phobos is pretty low.
>>                 As I understand it, Windows users are pretty much forced
>>                 to use
>>                 http://www.dsource.org/__projects/bindings/browser/__trunk/win32
>>                 <http://www.dsource.org/projects/bindings/browser/trunk/win32>
>>                 if they need
>>                 comprehensive Win32 API bindings. druntime seems to be
>>                 trying to define all of
>>                 the OS-specific stuff like that, but on top of it
>>                 missing much of it, in the
>>                 case of the Win32 API, that's a _lot_ of functions, and
>>                 I don't know if we
>>                 want to put that much in druntime. So, the question is,
>>                 how do we want to
>>                 support the Win32 API in druntime and Phobos?
>>
>>                 Do we want to put all of the Win32 API bindings in
>>                 druntime? If not, then do
>>                 we want to put them in Phobos? Or do we just want to
>>                 send Windows developers
>>                 to a 3rd party library like the Win32 bindings project
>>                 on dsource? Given that
>>                 they're OS bindings, I would _think_ that we'd want them
>>                 in druntime, but I
>>                 don't know.
>>
>>                 Regardless, this is one of those issues which frequently
>>                 plagues D Windows
>>                 developers, and we really should at least get a plan
>>                 together as to how we
>>                 want to handle it.
>>
>>                 - Jonathan M Davis
>>
>>
>>                 P.S. A related pull request:
>>                 https://github.com/D-__Programming-
>>                 <https://github.com/D-Programming->
>>                 Language/druntime/pull/139
>>
>>
>>             We've got the posix api set in the runtime, not just the
>>             subset that the runtime or phobos needs.  IMHO, windows  
>> should
>>             follow that pattern.  It might be large from a number of
>>             lines of declarations standpoint, but who cares.
>>
>>
>>         I tend to agree.
>>
>>
>>     I wouldn't object to having guaranteed access to winapi in
>>     druntime... but it is pretty big. In the interest of following the
>>     pattern with posix, it makes sense to me.
>>     But I'm also not allergic to it being a completely separate library,
>>     as long as it's distributed with the windows toolchain. I probably
>>     wouldn't want to see it in std, that makes no sense to me. druntime
>>     makes some sense (since parts of druntime depend on windows calls)
>>     if people think that's where it should be.
>>
>>     What is the reasoning for putting the posix api in druntime? That
>>     seems like a weird choice to me... it's nothing to do with druntime,
>>     except for a couple of dependencies perhaps.
>>
>>
>> Also, WinRT is upon us... I intend to start writing WinRT programs asap.
>> Ahould that go in druntime too? Are we opening a floodgate?
>
> BTW, we don't have any OS specific bindings for OSes that also have  
> Posix bindings. I thinking mostly on Mac OS X, don't know if the other  
> OSes have anything useful.

That's because you can get away with only using Posix on Mac OS X. If the  
situation was like on Windows, druntime would have to bind to the Mac OS X  
API as well. So I don't think this is a good counter argument. My thoughts  
are just: 2 places for the same thing are bad, druntime already depends on  
it => put it there.


More information about the Digitalmars-d mailing list