
On 19/11/2006, at 10:07 AM, Neil Mitchell wrote:
Hi
This brings up something that's been niggling me for a while. Why can Hat not deal with defaulting? Surely it could be handled by the first stage of hat-trans being inserting explicit type signatures based on the standard defaulting rules?
Bob
That would require hat-trans to do type checking, wouldn't it?
One idea that _might_ work is to translate Int -> Integer, then you get rid of defaulting integers, at the cost of changing the program semantics ever so slightly. Personally I'd say the cost is more than worth it, but I know some of the Hat developers disagree with me on that.
Thanks
Neil
Hi Neil, I would also argue strongly against that approach. It is important that debugging tools preserve the semantics of the underlying program as closely as possible. You might remove a slightly inconvenient problem, but at the cost of introducing subtle and difficult-to-explain changes in program behaviour. Probably the best solution is to lobby various compiler writers to generalise the defaulting mechanism, but that may be easier said than done :) Cheers, Bernie.