
Hello Robert, Wednesday, December 07, 2005, 2:19:22 AM, you wrote:
In Clean, you can (and often are required to) assign uniqueness attributes to some parts of a function's type signature. The extended type checker ensures that none of those parts is referred to more than once during a single run of the program. Based on this guarantee, a function does not have to allocate new memory at all to store a unique result but can overwrite the unique arguments in place.
My question is - and this might better suit to Haskell -, can't uniqueness be inferred (and exploited) automatically in many cases?
RD> Yes, probably. There is a technique called sharing analysis that attempts to RD> determine when a datastructure is only referenced once (ie, NOT shared). If RD> you can prove a datastructure node is not shared then you can reuse it RD> destructively. may be, John Meacham can say something about it? his JHC compiler uses region analysis to avoid garbage collection - may be these techniques has something in common? -- Best regards, Bulat mailto:bulatz@HotPOP.com