On Sun, Dec 18, 2011 at 5:55 PM, Timon Gehr <[email protected]> wrote: > On 12/19/2011 12:45 AM, Vladimir Panteleev wrote: >> >> On Sunday, 18 December 2011 at 23:31:03 UTC, Timon Gehr wrote: >>> >>> On 12/19/2011 12:24 AM, Vladimir Panteleev wrote: >>>> >>>> On Sunday, 18 December 2011 at 23:18:22 UTC, Timon Gehr wrote: >>>>> >>>>> You are right. I have had in mind a generational GC that uses a >>>>> copying collector for the nursery as this is what most >>>>> state-of-the-art VM GCs do. >>>> >>>> These changes are too invasive for the language at this point, I >>>> believe. We need to work with what we have. >>> >>> >>> I disagree. Code that relies on other semantics would just have to use >>> conservative GC. >> >> >> Please elaborate on how you would hypothetically change D to accustom >> such changes. I am having trouble imagining such an implementation that >> would not have a considerable impact on D's performance. > > > If you have an union > > union X{ > int x; > int* y; > } > > The compiler would just lay out x and y sequentially instead of at the same > memory location. Alternatively, it could add a tag to each union.
Wait, what? So you would convert unions into structs and break every semantic expectation a programmer might have? This would remove unions from the language. Calling it anything else is just silly.
