On 24 November 2012 23:18, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com" target="_blank">andrej.mitrovich@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11/24/12, Walter Bright <<a href="mailto:newshound2@digitalmars.com">newshound2@digitalmars.com</a>> wrote:<br>
> I'd forget about the unicode macro, and call the A or W versions<br>
> explicitly.<br>
<br>
</div>People already use WindowsAPI<br>
(<a href="http://dsource.org/projects/bindings/wiki/WindowsApi" target="_blank">http://dsource.org/projects/bindings/wiki/WindowsApi</a>) and Derelict<br>
for many projects, and introducing a new API that isn't compatible<br>
with this is going to create compatibility issues.</blockquote><div><br></div><div>What new API? How is it incompatible?</div><div>There's nothing 'new' about WINAPI.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Not to mention<br>
newbies which will be utterly confused as to what to use now, the new<br>
std.c.windows.windows (which will be what, a single module spanning<br>
100000 lines?) or the WindowsAPI bindings.<br></blockquote><div><br></div><div>windows.h (and friends) is gigantic, nothing D can (or should) do about that...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The WinAPI project has been used and maintained for years (compared to<br>
the poorly maintainted std.c.windows.windows where people arbitrarily<br>
add stuff to it when they feel the need to).<br></blockquote><div><br></div><div>Sure, I'd suggest that one of the mature bindings should be pulled into druntime in place of what's there now, better than new code for sure.</div>
<div>No real point druntime offering an incomplete binding.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here we have a guy (Gor) who doesn't even know what declspec is, or<br>
what a def file is, or what an import libarary is, who thinks he can<br>
use regex to create bindings, and who refuses to use STABLE bindings<br>
that were maintained for years. And we're going to allow him to create<br>
new backward-incompatible bindings that will supposedly work out of<br>
the box (they most certainly won't)?<br></blockquote><div><br></div><div>I don't care who does it or where the code comes from, I was just supporting the notion that druntime's windows bindings are very incomplete, and that alone should be addressed one way or another.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I used to be *for* putting WinAPI bindings into druntime/phobos. But<br>
seeing how some pull requests take months to be merged, and Walter's<br>
ultra stance on not adding any aliases that help with code readability<br>
(A vs W functions), and the obsessive requirement for Phobos to be<br>
composed out of massive single modules, I'm beginning to think that<br>
keeping the API out of Phobos might actually be a good idea.<br></blockquote><div><br></div><div>I'm sure it would be merged. And aren't the windows bindings in druntime?</div><div>WINAPI is decades old, it will never change, it will never need revision after being done properly. I think it's safe to have in the std library (and it's already there, it's just incomplete).</div>
<div><br></div><div>The A/W matter... I really think the version should be respected and the aliases maintained.</div><div>You can't make a change like that after decades because you think you know better... Win32 is effectively a legacy API, and people have decades of experience, and existing code written with it.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here's a crazy thought: if WinAPI is needed by Phobos functions why<br>
not just distribute WinAPI with the zipped distribution? You could put<br>
it in a special subfolder, e.g.:<br>
<br>
dmd2/src/dmd<br>
dmd2/src/druntime<br>
dmd2/src/phobos<br>
dmd2/src/bindings <-- put it in here<br>
<br>
And then in sc.ini or dmd.conf add an import to the bindings folder,<br>
and distribute a precompiled static library of the bindings alongside<br>
phobos.lib. The -version switches might have to be sorted out, but<br>
that has to be a simpler problem than rewriting bindings from scratch.<br>
</blockquote></div><br></div><div class="gmail_extra">They're already in core.sys.windows, that's a perfectly good place for it.</div>