On Jan 2, 2009, at 2:29 PM, Jon Harrop wrote:>>> I don't think you would want to build discriminated unions on top of >>> C-style unions though. >> >> Why? > > Uniformity when nesting and space efficiency. Users of a language > front-end > will want to nest discriminated unions, e.g. to manipulate trees.Okay, so you're just talking about boxed vs unboxed discriminated unions, or "by ref" vs "by value" discriminated unions. Clearly the LLVM IR support for "c style unions" would only be useful for "unboxed" or "byvalue" discriminated unions. That doesn't mean that *your* specific uses would need them. If you're doing "by-ref" or "boxed" unions, then our current support should already be sufficient. -Chris
On Sunday 04 January 2009 01:25:05 Chris Lattner wrote:> On Jan 2, 2009, at 2:29 PM, Jon Harrop wrote: > >>> I don't think you would want to build discriminated unions on top of > >>> C-style unions though. > >> > >> Why? > > > > Uniformity when nesting and space efficiency. Users of a language > > front-end > > will want to nest discriminated unions, e.g. to manipulate trees. > > Okay, so you're just talking about boxed vs unboxed discriminated > unions, or "by ref" vs "by value" discriminated unions. Clearly the > LLVM IR support for "c style unions" would only be useful for > "unboxed" or "byvalue" discriminated unions. That doesn't mean that > *your* specific uses would need them.Yes. I expect relatively few people would need C-style unions.> If you're doing "by-ref" or "boxed" unions, then our current support should > already be sufficient.Yes, LLVM's existing support is fine. Incidentally, is there any way for LLVM users to vote on a "wish list" in such a way that developers can see which features are most sought after? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e
On Jan 4, 2009, at 5:07 AM, Jon Harrop wrote:>> Okay, so you're just talking about boxed vs unboxed discriminated >> unions, or "by ref" vs "by value" discriminated unions. Clearly the >> LLVM IR support for "c style unions" would only be useful for >> "unboxed" or "byvalue" discriminated unions. That doesn't mean that >> *your* specific uses would need them. > > Yes. I expect relatively few people would need C-style unions.We obviously don't have them yet, so there hasn't been a driving need to make it happen.>> If you're doing "by-ref" or "boxed" unions, then our current >> support should >> already be sufficient. > > Yes, LLVM's existing support is fine. > > Incidentally, is there any way for LLVM users to vote on a "wish > list" in such > a way that developers can see which features are most sought after?Nope, but you can add things to the open projects list if you want. -Chris