[bitc-dev] Semantics of unboxed

EricNorthup digitale at digitaleric.net
Wed Oct 20 21:13:46 EDT 2004


Shap wrote:
> Consider two similar types.
> 
>   (tuple-of int (tuple-of char float))
>   (tuple-of int (unboxed tuple-of char float))
> 
> So far as I can tell, there appears to be NO semantic difference to
> these two things. In particular, the relationship between the inner
> tuple and the outer tuple is 1:1 in both cases, and since our language
> now allows obtaining a reference to a boxed thing in a fashion that
> works just like a reference to an unboxed thing, it appears to me that
> there are no statements that can differentiate the fact that the inner
> tuple is boxed.

There is perhaps one difference, which is not an issue of semantics but
rather performance.  Taking a reference to a boxed object never requires
the (typeid, bits *) pointer form.  So if we are going to be making lots
of references to something, it might be desirable to leave it boxed.

However this strikes me as a bit of a u-optimization, which is obviously
less important than simplifying (and spec'ing + implementing!) the language.
 
> If this is really correct, then we can omit all consideration of
> "boxedness" from the language semantics...

agree

--Eric


More information about the bitc-dev mailing list