View previous topic :: View next topic |
Author |
Message |
l8night
Joined: 03 May 2004 Posts: 32 Location: UK
|
Posted: Tue May 04, 2004 2:27 pm Post subject: Welcome |
|
|
Hi, this is an attempt to gather together all the ppl who are porting Win32 header files to D into one place.
currently I've ported about 10? of the files (the most useful 10?)
the intention is get more ported, and get those that have been tested.
I've tried (as much as possible) to keep the file names the same.
so come along and port a file or two
if you get any clashes with phobos, plz version it out with
Code: | version(STANDALONE){
... the clashing items
} |
this way the lib can be used without phobos for those who write their own rtl's or want minimum sized apps. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Tue May 04, 2004 4:48 pm Post subject: Re: Welcome |
|
|
l8night,
First, I need to ask if you're familiar with Y. Tomino's efforts. I don't know what percentage he's ported but I think it's more than 10? and it's a highly automated process. His process ignores Phobos, but the result seems pretty solid to me. The source doesn't look at quite as clean as your project, but it compiles fine.
Also, I don't have anything against versioning out parts that are in Phobos (better strategy than commenting as I used to do - oops). I did want to mention that Walter seems to silently add arbitrary (from my perspective) parts of the headers to std.c.windows.windows. After each new version of DMD, I hold my breath when I go to compile my projects. Bit-rot can happen quickly. I get tired of getting stung. That's why I'm partial to Phobos independent projects such as Y. Tomino's. But since your suggestion should cover both camps, it's probably the best way to go.
By the way, I've spent some time removing Phobos-dependence from your embedded browser example. I got it to depend on Y. Tomino's headers instead. It took a while, but it eventually worked. I got the DirectX example to compile, but it gave me a runtime error. I'm sure I botched something up.
I'm glad to see you're still interested in D. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Wed May 05, 2004 8:44 am Post subject: alias vs. typedef |
|
|
l8night, what do you think about the alias vs. typedef issue?
From the old D newsgroup: Scott Egan wrote: | I noticed that in std.c.windows.windows the types are all defined as aliases. Would it be better from a type safety and potential overloading point-of-view to use typedefs? | I'd like to use alias across the board (I call it "the most practical approach"). I think we have more important concerns than correcting ambiguous legacy designs. I know others disagree with me, but I was wondering what your thoughts were on the topic. (For what it's worth, Walter agrees with me.) |
|
Back to top |
|
|
l8night
Joined: 03 May 2004 Posts: 32 Location: UK
|
Posted: Wed May 05, 2004 10:25 am Post subject: |
|
|
I intended to contact Y.Tomino once the files where under source control, to start getting his bits integrated into mine.
I have to admit that I have not looked at what he is doing (bad me!), but I will take more notice sooner, 'cos if he's got an automated system working (I did start one last year but found I needed a better parser than my simple regexps) then I'm sure collectivly we can get a lot more done, even if it means manually adjusting the files afterwards to get them "phobos safe".
one thing I don't want to start is some kind of flame war, but ... Walters attitude does seem a little odd, I ported the win32 header maybe 2 years ago now (its definitly over one year ago) and at the time I wanted to start a d.win32 newsgroup and get together all the ppl who where porting headers and writing GUI libs into one group (maybe write a few different wrapper libs) but to no avail. and Walter just kept adding random bits to phobos rather than taking the work that had already been done. (grizzle over)
on the subject of alias -v- typedef, I too have used alias, for most things
of a pointer nature (function pointer included) alias is the only sencible option, just try using some code with Code: | typedef int delegate (MyObj, int) MyCallBack; |
however ... the HANDLE/HGDIOBJ/HWND issue is a little more complex, I did consider using typedefs for some and alias for others i.e
Code: | typedef void* HANDLE;
typedef HANDLE HGDIOBJ;
alias HGDIOBJ HFONT;
// etc
|
at first this seems sencible and typesafe, and for the most part it works, but I do not believe that it truly gives anything. That said I'm open to ppl showing me that typedefs are better, but as with phobos interoperation I believe the default should be alias only, and iff enough ppl want a typesafe version then
Code: | version(STANDALONE_TYPESAFE) {
... typedef's ...
} else {
... alias's ...
} |
should be used so as not to interfere with those of us happy with alias's
(obviously the typesafe version has to also be standalone)
I'm going to start a poll on this very topic.
the prepared for upload into source control version can be found at
http://www.geocities.com/one_mad_alien/dcode/
if ppl want to start 'playing' now. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Wed May 05, 2004 11:51 am Post subject: Priorities |
|
|
l8night wrote: | Walters attitude does seem a little odd, I ported the win32 header maybe 2 years ago now (its definitly over one year ago) and at the time I wanted to start a d.win32 newsgroup and get together all the ppl who where porting headers and writing GUI libs into one group (maybe write a few different wrapper libs) but to no avail. and Walter just kept adding random bits to phobos rather than taking the work that had already been done. (grizzle over) | I'm somewhat annoyed by this stuff, too. I think it's a matter of his priorities. I think language design and compiler implementation have been tied for priority 1. Everything else is non-essential to him. Even maintaining documentation and Phobos aren't high priorities. But I think a complete port of Win32 headers is essential for GUI development in D.
And yes, Walter's still adding random bits to the Win32 header in Phobos that only serve the purpose of frustrating existing efforts by those of use that care about using GUI in Windows. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Wed May 05, 2004 5:58 pm Post subject: |
|
|
By the way, test.001.src.zip seems to be missing from this page. |
|
Back to top |
|
|
l8night
Joined: 03 May 2004 Posts: 32 Location: UK
|
Posted: Fri May 07, 2004 6:31 am Post subject: |
|
|
fixed, forgot to prefix file/ on the link. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|