www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Windows Bindings v1.0

reply Rumbu <rumbu rumbu.ro> writes:
The D Windows SDK projection reached first version. Generated 
bindings were compiled succesfully.

https://github.com/rumbu13/windows-d

Destroy!
Feb 16
next sibling parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 16/02/2021 9:45 PM, Rumbu wrote:
 The D Windows SDK projection reached first version. Generated bindings 
 were compiled succesfully.
 
 https://github.com/rumbu13/windows-d
 
 Destroy!
All of the symbols and modules need to be documented so that the documentation generators will generate documentation for them. By the looks a good percentage of DirectX is in there. Which is wonderful. I checked as it will be important for a project like this, but it doesn't seem like the docs around IUnknown is correct. https://dlang.org/spec/interface.html#com-interfaces It seems the exact location for IUnknown doesn't matter. Great work!
Feb 16
parent reply Rumbu <rumbu rumbu.ro> writes:
On Tuesday, 16 February 2021 at 08:53:06 UTC, rikki cattermole 
wrote:
 All of the symbols and modules need to be documented so that 
 the documentation generators will generate documentation for 
 them.
Sincerely, I doubt that it's a good idea to duplicate gigs of WinAPI documentation which can be found on the official Microsoft sites. Or may be you want to stress test the D compiler when it's generating documentation :) WinAPI docs are available here [1] in md format (1.6Gb, 64280 files, 1347 folders). Someone should build a md scrapper. BTW, none of the core.sys.* packages are documented. [1] https://github.com/MicrosoftDocs/sdk-api
Feb 16
next sibling parent rikki cattermole <rikki cattermole.co.nz> writes:
On 17/02/2021 9:45 AM, Rumbu wrote:
 On Tuesday, 16 February 2021 at 08:53:06 UTC, rikki cattermole wrote:
 All of the symbols and modules need to be documented so that the 
 documentation generators will generate documentation for them.
Sincerely, I doubt that it's a good idea to duplicate gigs of WinAPI documentation which can be found on the official Microsoft sites. Or may be you want to stress test the D compiler when it's generating documentation :)
Its documented (partially). https://github.com/dlang/druntime/blob/master/src/core/sys/windows/aclui.d#L1 Note I am only talking about some ///'s at the end of the line. https://dlang.org/spec/ddoc.html#parsing
Feb 16
prev sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 2/16/21 3:45 PM, Rumbu wrote:
 On Tuesday, 16 February 2021 at 08:53:06 UTC, rikki cattermole wrote:
 All of the symbols and modules need to be documented so that the 
 documentation generators will generate documentation for them.
Sincerely, I doubt that it's a good idea to duplicate gigs of WinAPI documentation which can be found on the official Microsoft sites. Or may be you want to stress test the D compiler when it's generating documentation :)
Note that in-line docs help with more than just putting docs on dlang.org. It helps with IDEs that use the docs to tell you what your function you are typing is doing, and also if you are reading the source code.
 
 WinAPI docs are available here [1] in md format (1.6Gb, 64280 files, 
 1347 folders). Someone should build a md scrapper.
What about just having the short summary, and then links to the MS docs? -Steve
Feb 17
parent reply Rumbu <rumbu rumbu.ro> writes:
On Wednesday, 17 February 2021 at 14:53:11 UTC, Steven 
Schveighoffer wrote:
 On 2/16/21 3:45 PM, Rumbu wrote:
 On Tuesday, 16 February 2021 at 08:53:06 UTC, rikki cattermole 
 wrote:
[...]
Sincerely, I doubt that it's a good idea to duplicate gigs of WinAPI documentation which can be found on the official Microsoft sites. Or may be you want to stress test the D compiler when it's generating documentation :)
Note that in-line docs help with more than just putting docs on dlang.org. It helps with IDEs that use the docs to tell you what your function you are typing is doing, and also if you are reading the source code.
 
 WinAPI docs are available here [1] in md format (1.6Gb, 64280 
 files, 1347 folders). Someone should build a md scrapper.
What about just having the short summary, and then links to the MS docs? -Steve
OK, you convinced me :) Enjoy: https://github.com/rumbu13/windows-d#features
Feb 17
next sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 2/17/21 2:01 PM, Rumbu wrote:

 OK, you convinced me :)
 
 Enjoy: https://github.com/rumbu13/windows-d#features
 
 
Nice! -Steve
Feb 18
prev sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Wednesday, 17 February 2021 at 19:01:31 UTC, Rumbu wrote:
 On Wednesday, 17 February 2021 at 14:53:11 UTC, Steven 
 Schveighoffer wrote:
 On 2/16/21 3:45 PM, Rumbu wrote:
 [...]
Note that in-line docs help with more than just putting docs on dlang.org. It helps with IDEs that use the docs to tell you what your function you are typing is doing, and also if you are reading the source code.
 [...]
What about just having the short summary, and then links to the MS docs? -Steve
OK, you convinced me :) Enjoy: https://github.com/rumbu13/windows-d#features
🎂🎉
Feb 18
prev sibling next sibling parent reply Elronnd <elronnd elronnd.net> writes:
Maybe the wrong place to bring it up, but: any chance this will 
be merged into core.sys.windows?
Feb 16
parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Tuesday, 16 February 2021 at 09:36:12 UTC, Elronnd wrote:
 Maybe the wrong place to bring it up, but: any chance this will 
 be merged into core.sys.windows?
I'm also wondering about this
Feb 16
prev sibling next sibling parent reply Max Haughton <maxhaton gmail.com> writes:
On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote:
 The D Windows SDK projection reached first version. Generated 
 bindings were compiled succesfully.

 https://github.com/rumbu13/windows-d

 Destroy!
Hi, I'll be getting in touch about featuring this on the D blog soon - would you prefer to be contacted anywhere other than your git email?
Feb 16
parent Rumbu <rumbu rumbu.ro> writes:
On Tuesday, 16 February 2021 at 20:49:30 UTC, Max Haughton wrote:
 On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote:
 The D Windows SDK projection reached first version. Generated 
 bindings were compiled succesfully.

 https://github.com/rumbu13/windows-d

 Destroy!
Hi, I'll be getting in touch about featuring this on the D blog soon - would you prefer to be contacted anywhere other than your git email?
It is ok on that e-mail.
Feb 16
prev sibling parent reply tchaloupka <chalucha gmail.com> writes:
On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote:
 The D Windows SDK projection reached first version. Generated 
 bindings were compiled succesfully.

 https://github.com/rumbu13/windows-d

 Destroy!
Thanks for this, looks great. Could the generated code be annotated with nothrow nogc too? Tom
Feb 17
next sibling parent reply Dennis <dkorpel gmail.com> writes:
On Wednesday, 17 February 2021 at 20:53:49 UTC, tchaloupka wrote:
 Thanks for this, looks great.
 Could the generated code be annotated with nothrow  nogc too?
+1 This is actually missing in many core.sys.windows modules.
Feb 17
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 2/17/2021 2:09 PM, Dennis wrote:
 On Wednesday, 17 February 2021 at 20:53:49 UTC, tchaloupka wrote:
 Thanks for this, looks great.
 Could the generated code be annotated with nothrow  nogc too?
+1 This is actually missing in many core.sys.windows modules.
Please file bugzilla issues for them!
Feb 17
parent Dennis <dkorpel gmail.com> writes:
On Thursday, 18 February 2021 at 00:46:26 UTC, Walter Bright 
wrote:
 Please file bugzilla issues for them!
I'm not going to file issues for each individual module, since there are about 100 of them. There already is a general issue about Windows headers: https://issues.dlang.org/show_bug.cgi?id=16267 I actually started working on adding the missing annotations to druntime half a year ago, but abandoned it because it took more time than expected. The tricky part is that modules can contain callback definitions, and adding nogc nothrow to those is a breaking change. This is where Argument dependent attributes (https://github.com/dlang/DIPs/pull/198) could be useful. I might pick it up again, but if these auto-generated bindings can be incorporated into core.sys.windows that wouldn't be necessary anymore.
Feb 18
prev sibling parent Rumbu <rumbu rumbu.ro> writes:
On Wednesday, 17 February 2021 at 20:53:49 UTC, tchaloupka wrote:
 On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote:
 The D Windows SDK projection reached first version. Generated 
 bindings were compiled succesfully.

 https://github.com/rumbu13/windows-d

 Destroy!
Thanks for this, looks great. Could the generated code be annotated with nothrow nogc too? Tom
I don't know what to say about nothrow. There are WinAPI functions generating exceptions. For example the code below trying to allocate size_t.max bytes, even we reserved 10 only: auto h = HeapCreate(4, 10, 10); auto p = HeapAlloc(h, 4, size_t.max); Now, the D runtime catches internally any Windows exception and throws a generic Win32 Error without any other information, and of course, this will qualify HeapAlloc as a nothrow function. In reality, this should not be just an uncatchable Error, but a full Exception object having the associated error code (0xC0000017), the associated default message ("Not Enough Quota") and the value of the offending parameter (0xFFFFFFFF). All this information is available in SEH records but it is ignored by D runtime.
Feb 18