On 24 November 2012 23:18, Andrej Mitrovic <andrej.mitrovich@gmail.com> 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.

What new API? How is it incompatible?
There's nothing 'new' about WINAPI.

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.

windows.h (and friends) is gigantic, nothing D can (or should) do about that...

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).

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.
No real point druntime offering an incomplete binding.

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 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.

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.

I'm sure it would be merged. And aren't the windows bindings in druntime?
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).

The A/W matter... I really think the version should be respected and the aliases maintained.
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.

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.

They're already in core.sys.windows, that's a perfectly good place for it.