[MLton] Conversions and the Basis Library

Wesley W. Terpstra wesley at terpstra.ca
Wed Nov 28 10:04:28 PST 2007


On Nov 28, 2007, at 6:25 PM, Vesa Karvonen wrote:
> val convert1 = Int64.fromFixed o IntX.toFixed
> val convert2 = Int64.fromFixed o Real.toFixedInt IEEReal.TO_ZERO

This is what we all do in practice ATM anyway.

Converting in and out  of the largest available integer type is  
certainly faster than IntInf, but it's still not as good as composing  
the conversions during SSA after inlining. Also, I could imagine a  
case where the integer being converted actually *was* an IntInf, but I  
didn't know this in my functorized code. Conversions through IntInf  
are thus still safer than through the largest fixed type.

> I believe that with these additions to the Basis library, most  
> performance issues with integer conversions could be eliminated with  
> a relatively small effort.

Weren't you the one talking about the Genius Tailor? ;-)




More information about the MLton mailing list