Porting D2 code to D1

Jason House jason.james.house at gmail.com
Wed Jul 16 11:01:36 PDT 2008


It may sound backwards, but I think it may be the best way to get things like Tango to move forward to D2.

Tango officially supports D1.  If it were to add D2 support, someone would have to port the D1 code to D2.  Then, with each change, a similar change must occur to the D2 code base.  From a maintenance standpoint, this really shouldn't be acceptable.

Since adding concepts such as const to D1 code in an automated fashion is essentially impossible, it seems the best approach is to convert D2 code into D1 code.  Programatically, it should be pretty easy to remove const-awareness.  That'd allow Tango to convert to D2 once and then (more or less) maintain one code base.

Maybe this would require a few special cases with D1-specific and D2-specific code, but I'd hope that wouldn't be very common.  I guess I have a few questions:

1. Besides const removal, what else must get done to convert D2 code to D1 code?
2. How can D version-specific code be mixed into a single code base?
3. Any thoughts on how to programatically do all the conversions?
4. Would this be enough for D1 library maintainers to move to D2?



More information about the Digitalmars-d mailing list