[dmd-beta] dmd 1.074 and 2.059 beta 5

David Nadlinger code at klickverbot.at
Tue Apr 10 18:12:33 PDT 2012


Yeah, I agree that whatever forward reference model we'll end up with 
down the road, the conditional thing I was doing in Thrift will probably 
be illegal there. Fortunately, that one's easy to remove – it was just 
to avoid adding a »useless« empty field, the value of which is 
questionable anyway.

Also, I hope that I didn't come across too grumpy – if so, it was 
certainly not intended, as I know that I'm not exactly sticking to 
well-trodden ground in some parts of the Thrift implementation. It's 
just that I already ended up tracking down seven issues during what I 
hoped would be a bit of hassle-free pre-release testing, and currently, 
I'm working on reducing another strange, possibly related bug…

David


On 11 Apr 2012, at 2:35, Walter Bright wrote:
> I mostly agree with you, and apologize for the trouble it caused you. 
> The fact that it worked at all before was a fluke, caused by 
> incomplete checking by the compiler, and that incomplete checking 
> caused numerous other problems.
>
> Allowing forward references in general is a very tricky problem in the 
> situation of circular definitions. The strategy that dmd originally 
> followed was to do things in lexical order, and dang the consequences. 
> The more advanced strategy dmd has been migrating to is to allow 
> circular references as long as there is enough information about the 
> partially analyzed type to break the cycle. For example, sometimes 
> only the size of a struct is required. Therefore, dmd requires only 
> that the members of the struct that contribute to its size are 
> analyzed - the other members need not be.
>
> In your case, you had a static if turning on and adding members by 
> checking a condition that must check all the members. This cannot 
> possibly work. I spent a lot of type trying to figure out a way that 
> the cycle could be legitimately broken, but could not.
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta


More information about the dmd-beta mailing list