WinAPI for druntime and OpenGL for deimos.

Manu turkeyman at gmail.com
Sat Nov 24 15:47:18 PST 2012


On 25 November 2012 01:24, Vladimir Panteleev
<vladimir at thecybershadow.net>wrote:

> On Saturday, 24 November 2012 at 23:11:35 UTC, Manu wrote:
>
>> On 24 November 2012 23:36, Vladimir Panteleev
>> <vladimir at thecybershadow.net>**wrote:
>>
>>  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.
>>>
>>>
>> I'm simply stating my sentiment that ANY change to WIN32 is a very very
>> bad idea.
>>
>
> Reasoning in absolutes is not constructive.
>
>
>  It invalidates existing code, and existing learning/reference material.
>>
>
> Please provide a concrete example.


The only 2 significant changes I'm aware of are the HANDLE question, and
the A/W aliases.

A/W aliases for reasons I've states in numerous places elsewhere, and the
HANDLE ones I don't have such a strong opinion on, but it would be a shame
to see errors appearing in code that compiles in C, anyone referencing that
material might wonder what's going on.
Enforcing strict type-safety on handle types is not something WIN32 does,
and therefore not something D should attempt to do either. It's just an
alias for void* in C, and I see no problem with that.

 Not to mention how many programmers don't even know what unicode is (ie,
>> the A/W alias argument).
>>
>
> I don't understand how this is relevant to this discussion.


Well it's one of the changes in the existing implementation which I totally
disagree with, for the reasons stated.

 'Relearning' in this instance might refer to learning/remembering what
>> changes have been made.
>>
>
> Part of the goal is to minimize required changes in correct code. Even in
> those cases (assuming they will even exist), the compiler will produce a
> helpful error message (e.g expected type void*, got HGLOBAL). The code can
> be easily fixed in a backwards-compatible way by adding a cast.
>

WIN32 has a heap of these HSOMETHING types, and they're all implicitly
convertible to HANDLE and should remain that way. Many functions receive
HANDLE's which it expects may be of any type. The Wait* suite of functions
for instance wait on basically anything.

I'd be interested to hear arguments why you think any changes of any sort
should be made to a well established API that's decades old?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121125/53228082/attachment.html>


More information about the Digitalmars-d mailing list