| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
April 01, 2009 Will D2 be backwards compatible with D | ||||
|---|---|---|---|---|
| ||||
Basic question: will 2.0 compiler be able to compile D1 code (library changes not withstanding)? If no, is there a summary of the kind of changes that will have to be made? | ||||
April 02, 2009 Re: Will D2 be backwards compatible with D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Merlin Moncure | Merlin Moncure Wrote:
> Basic question: will 2.0 compiler be able to compile D1 code (library changes not withstanding)? If no, is there a summary of the kind of changes that will have to be made?
changes to what?
| |||
April 02, 2009 Re: Will D2 be backwards compatible with D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Kagamin | Kagamin Wrote:
> Merlin Moncure Wrote:
>
> > Basic question: will 2.0 compiler be able to compile D1 code (library changes not withstanding)? If no, is there a summary of the kind of changes that will have to be made?
>
> changes to what?
Changes to your code. If you run D1.0 code through D2.0 compiler, what errors will yet get? (not counting library errors)
| |||
April 02, 2009 Re: Will D2 be backwards compatible with D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Merlin Moncure | 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[].
| |||
April 04, 2009 Re: Will D2 be backwards compatible with D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Trass3r | 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.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply