[dmd-beta] dmd 1.074 and 2.059 beta 5

David Nadlinger code at klickverbot.at
Tue Apr 10 17:03:55 PDT 2012


On 10 Apr 2012, at 19:09, Walter Bright wrote:
> Includes fixes for all […]

I'll leave you with the last word on this, but I'm still not quite happy 
with the idea that the result of 7868 [1] is to just accept that an 
expression silently yields a different result if it is somehow evaluated 
from a static if condition. The (semi-)regression took me quite some 
time to track down due to its elusiveness and you some hours to make 
sense of, and I'm afraid that it will hit other users as well (who 
probably have no idea about how to debug the frontend).

I am not quite sure about the best way to fix this particular problem 
– from trying to figure out a way to get the Thrift code working with 
current Git master it seems that DMD more or less no longer allows 
adding something to a type based on its current members. It is clear 
that the semantics of this must be carefully defined, but it is useful 
for certain »declarative« kinds of meta-programming (especially due to 
the lack of something like ADL allowing you to »associate« code with a 
type in another way), it worked in previous DMD releases, and now fails 
in confusing ways. Maybe we finally need to sit down and formalize our 
forward reference model (perhaps along the lines of the proposal that 
came up some time ago – was it by Don? –, for doing semantic 
analysis one layer of conditionals at a time).

The underlying problem is really that as a developer doing 
metaprogramming-heavy stuff, you have no idea what actually is supposed 
to work, and after you found out the hard way by testing what DMD 
accepts, you still don't know whether it will continue to work in future 
releases. And this is a much bigger problem than e.g. breaking standard 
library changes, because you can easily work around the latter.

Oh, and while trying to get Thrift to work, I hit another related crash 
regression, issue 7886 [2].

David


[1] http://d.puremagic.com/issues/show_bug.cgi?id=7868
[2] http://d.puremagic.com/issues/show_bug.cgi?id=7886


More information about the dmd-beta mailing list