November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
On Saturday, November 24, 2012 20:48:54 Manu wrote:
> I for one have 15+ years of expectation about WINAPI
My condolences. :)
- Jonathan M Davis
|
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 11/24/12, Walter Bright <newshound2@digitalmars.com> wrote: > I'd forget about the unicode macro, and call the A or W versions explicitly. People already use WindowsAPI (http://dsource.org/projects/bindings/wiki/WindowsApi) and Derelict for many projects, and introducing a new API that isn't compatible with this is going to create compatibility issues. Not to mention newbies which will be utterly confused as to what to use now, the new std.c.windows.windows (which will be what, a single module spanning 100000 lines?) or the WindowsAPI bindings. The WinAPI project has been used and maintained for years (compared to the poorly maintainted std.c.windows.windows where people arbitrarily add stuff to it when they feel the need to). Here we have a guy (Gor) who doesn't even know what declspec is, or what a def file is, or what an import libarary is, who thinks he can use regex to create bindings, and who refuses to use STABLE bindings that were maintained for years. And we're going to allow him to create new backward-incompatible bindings that will supposedly work out of the box (they most certainly won't)? I used to be *for* putting WinAPI bindings into druntime/phobos. But seeing how some pull requests take months to be merged, and Walter's ultra stance on not adding any aliases that help with code readability (A vs W functions), and the obsessive requirement for Phobos to be composed out of massive single modules, I'm beginning to think that keeping the API out of Phobos might actually be a good idea. Here's a crazy thought: if WinAPI is needed by Phobos functions why not just distribute WinAPI with the zipped distribution? You could put it in a special subfolder, e.g.: dmd2/src/dmd dmd2/src/druntime dmd2/src/phobos dmd2/src/bindings <-- put it in here And then in sc.ini or dmd.conf add an import to the bindings folder, and distribute a precompiled static library of the bindings alongside phobos.lib. The -version switches might have to be sorted out, but that has to be a simpler problem than rewriting bindings from scratch. |
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
On Saturday, November 24, 2012 23:34:05 Gor Gyolchanyan wrote: > Also, exactly what package should I put them? > I suppose core.sys.windows.* I would expect them to be in core.sys.windows where each module corresponds with a header file in C/C++. > Although the core.sys.windows contains some D-specific modules, which wouldn't be nice to mix with the native modules (and there are tons of those). What's there is incredibly haphazard IMHO. But I'm not sure that it would be all that big a deal to change it, because anyone doing much of anything with the Windows bindings just uses the WinAPI project, because it's worlds better. Most of what's there is either there because it's needed for druntime or Phobos or because some stray developer happened to add it (generally haphazardly as far as organization goes). - Jonathan M Davis |
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
On Saturday, November 24, 2012 22:18:23 Andrej Mitrovic wrote:
> On 11/24/12, Walter Bright <newshound2@digitalmars.com> wrote:
> > I'd forget about the unicode macro, and call the A or W versions explicitly.
>
> People already use WindowsAPI (http://dsource.org/projects/bindings/wiki/WindowsApi) and Derelict for many projects, and introducing a new API that isn't compatible with this is going to create compatibility issues. Not to mention newbies which will be utterly confused as to what to use now, the new std.c.windows.windows (which will be what, a single module spanning 100000 lines?) or the WindowsAPI bindings.
>
> The WinAPI project has been used and maintained for years (compared to the poorly maintainted std.c.windows.windows where people arbitrarily add stuff to it when they feel the need to).
>
> Here we have a guy (Gor) who doesn't even know what declspec is, or what a def file is, or what an import libarary is, who thinks he can use regex to create bindings, and who refuses to use STABLE bindings that were maintained for years. And we're going to allow him to create new backward-incompatible bindings that will supposedly work out of the box (they most certainly won't)?
>
> I used to be *for* putting WinAPI bindings into druntime/phobos. But seeing how some pull requests take months to be merged, and Walter's ultra stance on not adding any aliases that help with code readability (A vs W functions), and the obsessive requirement for Phobos to be composed out of massive single modules, I'm beginning to think that keeping the API out of Phobos might actually be a good idea.
>
> Here's a crazy thought: if WinAPI is needed by Phobos functions why not just distribute WinAPI with the zipped distribution? You could put it in a special subfolder, e.g.:
>
> dmd2/src/dmd
> dmd2/src/druntime
> dmd2/src/phobos
> dmd2/src/bindings <-- put it in here
>
> And then in sc.ini or dmd.conf add an import to the bindings folder, and distribute a precompiled static library of the bindings alongside phobos.lib. The -version switches might have to be sorted out, but that has to be a simpler problem than rewriting bindings from scratch.
And why not just put the WindowsAPI bindings in druntime with the proper organization? What I would expect would be to have a .d or .di file for every Windows header file, and my initiali reaction would be that anything else would be foolish. IIRC, the Windows API bindings project does something similar to that. I believe that that's more or less how the POSIX bindings in druntime are laid out.Certainly, a single file with everything in it like you seem to be afraid of would be absurd.
And remember that druntime and Phobos _need_ to have at least some portion of the bindings to do their job, so having them in another project is counterproductive. And unless the WindowsAPI project doesn't depend on druntime at all (which I find doubtful), you end up with a circular dependency if druntime depends on it, so you'd be forced to duplicate bindings like we're doing now.
- jonathan M Davis
|
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Saturday, 24 November 2012 at 18:49:02 UTC, Manu wrote:
> Hear hear! I agree, it should just be cloned verbatim.
> I for one have 15+ years of expectation about WINAPI, I don't want to look
> in any manual/reference to relearn how to use it again.
This sentiment is overexaggerated and unhelpful. Please provide an example of what sorts of "relearning" you'd have to do.
|
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Attachments:
| How about core.sys.windows.c.* ? The c package will contain the exact files of WinAPI and nothing more, wile everything beyond the c package will be the druntime additions to it? Most code should not be broken, because most of it use Phobos and it will change the std.c.windows.windows accordingly. On Sun, Nov 25, 2012 at 1:24 AM, Jonathan M Davis <jmdavisProg@gmx.com>wrote: > On Saturday, November 24, 2012 23:34:05 Gor Gyolchanyan wrote: > > Also, exactly what package should I put them? > > I suppose core.sys.windows.* > > I would expect them to be in core.sys.windows where each module corresponds with a header file in C/C++. > > > Although the core.sys.windows contains some D-specific modules, which wouldn't be nice to mix with the native modules (and there are tons of those). > > What's there is incredibly haphazard IMHO. But I'm not sure that it would > be > all that big a deal to change it, because anyone doing much of anything > with > the Windows bindings just uses the WinAPI project, because it's worlds > better. > Most of what's there is either there because it's needed for druntime or > Phobos or because some stray developer happened to add it (generally > haphazardly as far as organization goes). > > - Jonathan M Davis > -- Bye, Gor Gyolchanyan. |
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gor Gyolchanyan | On Saturday, 24 November 2012 at 21:54:57 UTC, Gor Gyolchanyan wrote:
> How about core.sys.windows.c.* ?
There is a certain asymmetry in the current state of druntime already: For all the other OSes, core.sys.xyz direclty contains headers for the system libraries, whereas the modules in core.sys.windows actually contain D code.
David
|
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger Attachments:
| I suggest refactoring other core.sys.<system>.* like this. On Sun, Nov 25, 2012 at 2:04 AM, David Nadlinger <see@klickverbot.at> wrote: > On Saturday, 24 November 2012 at 21:54:57 UTC, Gor Gyolchanyan wrote: > >> How about core.sys.windows.c.* ? >> > > There is a certain asymmetry in the current state of druntime already: For all the other OSes, core.sys.xyz direclty contains headers for the system libraries, whereas the modules in core.sys.windows actually contain D code. > > David > -- Bye, Gor Gyolchanyan. |
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Attachments:
| On 24 November 2012 22:30, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> On Saturday, November 24, 2012 20:48:54 Manu wrote:
> > I for one have 15+ years of expectation about WINAPI
>
> My condolences. :)
>
See: I *really* don't want to look in any manual to learn how to use it again... ever! ;)
|
November 24, 2012 Re: WinAPI for druntime and OpenGL for deimos. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gor Gyolchanyan | Gor your doing a great job the sooner WindowsApi merges with druntime the better!
On Saturday, 24 November 2012 at 22:11:04 UTC, Gor Gyolchanyan wrote:
> I suggest refactoring other core.sys.<system>.* like this.
>
>
> On Sun, Nov 25, 2012 at 2:04 AM, David Nadlinger <see@klickverbot.at> wrote:
>
>> On Saturday, 24 November 2012 at 21:54:57 UTC, Gor Gyolchanyan wrote:
>>
>>> How about core.sys.windows.c.* ?
>>>
>>
>> There is a certain asymmetry in the current state of druntime already: For
>> all the other OSes, core.sys.xyz direclty contains headers for the system
>> libraries, whereas the modules in core.sys.windows actually contain D code.
>>
>> David
|
Copyright © 1999-2021 by the D Language Foundation