Moving from 1.0 to D2
schveiguy at yahoo.com
Tue Mar 10 09:59:53 PDT 2009
On Tue, 10 Mar 2009 11:15:36 -0400, Sean Kelly <sean at invisibleduck.org>
> Steven Schveighoffer wrote:
>> On Mon, 09 Mar 2009 17:55:48 -0400, jicman wrote:
>>> How much different is D2 vs. D1?
>> Much. Much much much ;) It's almost another language.
> But most of the differences aren't breaking changes. You'll encounter
> some problems with string literals because of the new const features,
> but much of the rest should "just work."
Couple of breaking changes I've encountered that weren't const related
when porting Tango (so far):
had to change singletons named 'shared'
this in structs is now a reference, not a pointer.
And there are several blocking bugs that are preventing completion of the
port. For instance 1645 and 2442.
>> One thing to keep in mind is, D2 is a quickly moving target. You may
>> need fixes that are released in a version of dmd, but design changes in
>> that version may break your code in other ways. It might be best for
>> professional software products to wait until D2 is released before
>> trying to port.
> I expect the features already in D2 to stay largely as-is, so I wouldn't
> be terribly concerned about targeting D2 from that perspective.
Yes, if you target D2 as is, the resulting release will be close to that.
But if you get to a point where you cannot go any further because of
design deficiencies or bugs, then you have to wait for Walter to fix
those, or design around them. On one hand, you want to do the porting to
help solve the bugs. Phobos is not even close when it comes to stressing
the compiler's features, so building stuff that has different valid design
ideas is critical to make sure D2 is as good as possible. On the other
hand, as a business you want to be able to plan when your projects will be
complete. Bottom line is, yes you can port your code, but only if you are
willing to accept that your code may not work until several versions after
D2 is released :) As a business decision, I think that's a no-brainer to
wait. Other people may look at it differently.
Now, starting a project using D2 may not be a bad idea, because you may be
able to work with the quirks of the language, or design around the
language, but you still run the risk of hitting blocker bugs.
More information about the Digitalmars-d-learn