Will D2 be backwards compatible with D

Don nospam at nospam.com
Fri Apr 3 22:06:24 PDT 2009


Trass3r wrote:
> Merlin Moncure schrieb:
>> Changes to your code.  If you run D1.0 code through D2.0 compiler, 
>> what errors will yet get? (not counting library errors)
>>
> 
> Most probably you get errors regarding strings, since strings (esp. 
> string literals) are invariant(char)[] in D2 and char[] in D1. Thus you 
> should get errors  when you pass a string literal to a function that 
> wants a char[].

The most significant breaking change is that 'const' has a completely 
different meaning in D2, compared to D1. Porting D1 code to D2 is mostly 
about inserting/removing 'const' -- most commonly in relation to 
strings. Most of D1 is directly compilable in D2.
However, changes to libraries are more significant. Phobos2 is rapidly 
diverging from Phobos1. And Tango2 is non-existent.



More information about the Digitalmars-d mailing list