Porting WIne to D

Ben Klein shacklein at gmail.com
Wed Jun 23 20:14:40 CDT 2010


Please bottom-post on wine-devel.

On 24 June 2010 09:26, Christopher Selph <cds.wine at gmail.com> wrote:
> I agreee  that just converting syntax would not be enough, but it would make
> OO design in D alot easier and faster. It an idea currently, I was just
> looking for some input.

Given that there is (by definition) no genuine OO stuff in Wine at the
moment, porting Wine (successfully) to an OO language is a task equal
to, if not greater than, reimplementing the current state of the
codebase from scratch.

On 24 June 2010 04:48, Stephen Eilert <spedrosa at gmail.com> wrote:
> On Wed, Jun 23, 2010 at 3:06 PM, Christopher Selph <cds.wine at gmail.com> wrote:
>> Well, being a garbage collected language, it would help with the memory
>> leaks in Wine. Being OOP it could extend the design of the code to make it
>> cleaner and reusable.
>
> The assertions above are opinions, not facts. Also, it requires a full rewrite.
>
> Wine Initial release(per Wikipedia):    4 July 1993

^^ Very important point.

I'm pretty sure that garbage collection on its own does not solve
memory leaks. Java is notorious for memory issues; if there's a leak
in the engine then no amount of fixking in your code will reduce the
memory footprint. Furthermore, if the leak is created by some
reference still being valid in the first place (i.e., not being
cleaned up by the code, which no doubt is the current case), then any
benefits of automated GC would be minimal at best.

Things that cause memory leaks are bad practice, and for a project as
large as Wine, I'm not sure relying on a language feature to clean up
the loose ends is the best idea.

Also, what benefit could an OO language bring to implementing
win32/win64? Are the Microsoft APIs actually suited to
object-orientied implementation?

> On Wed, Jun 23, 2010 at 4:17 PM, Gert van den Berg <wine-devel at mohag.net>
> wrote:
>>
>> On Wed, Jun 23, 2010 at 22:58, Christopher Selph <cds.wine at gmail.com>
>> wrote:
>> >>Porting a codebase the size
>> >>
>> >> >of Wine will probably take years...
>> >>
>> >> Actually I'm working on a program to convert C code to D code. You can
>> >> find/replace most instances of code, like unsigned int (C) with uint
>> >> (D).
>> >> The import/include files might take some work though.
>>
>> Just converting the syntax won't help much. It might compile, but it
>> lacks the design changes (such as proper OO) needed to properly
>> exploit a new language. You end up with code with the same problems as
>> the original, but in a language that the programmers are unfamiliar
>> with... (For C++, duplication of functionality in the STL is an
>> example of what often happens if you directly port C code)
>>
>> Wine (like the Linux kernel) might be a good codebase to test your
>> application on (for your own testing), since it is quite a large,
>> complicated codebase... The chances of having it accepted into Wine is
>> probably quite small... (My guess would be that your chances of being
>> struck by lightning while winning the lottery are about equal...)
>>
>> http://www.winehq.org/site/docs/winedev-guide/style-notes might give
>> you an idea of some of the things relatively simple patches struggle
>> with to get included...
>>
>> Gert
>
>
>
>
>



More information about the wine-devel mailing list