[MLton] an analysis to flatten refs into tuples

Daniel C. Wang danwang@CS.Princeton.EDU
Tue, 18 May 2004 17:23:53 -0400

Stephen Weeks wrote:
{stuff deleted}
>>With the ref flattening and the bit packing optimizations, I'm really 
>>tempted to write a naive Scheme to ML source to source translator, and see 
>>how well MLton does with the output... If MLton will "do the right thing" in 
>>this case, I'd be very happy.
> If the naive translator introduces a single universal type for all
> scheme values, then MLton isn't likely to do much.  For almost all of
> its analyses, MLton merges together information from all applications
> of a given constructor.  So, it is unlikely to simplify the universal
> datatype significantly.  About the best I can see is that the packing
> stuff will avoid boxing small variants of the universal datatype (like
> characters).

The ref flattening would also be important.. so I can represent a cons cell 
as a tuple of refs. But I think, your right, I'm micro-optimizing I 
shouldn't worry about these issues until, I look at the profile traces.