comp.lang.ml posting

Stephen Weeks MLton@sourcelight.com
Wed, 11 Oct 2000 14:23:45 -0700 (PDT)


> I was amused at your posting in comp.lang.ml.  The bit about manually doing
> the uncurrying is a bit embarassing (since even though we don't use that
> style, it shouldn't be punished).  Why did the oCaml people use arrays
> (vector, or really arrays) for their representation of points? 

It was a mistake on their part.

> Did you convert
> because of the fact that SML doesn't have a representation for array contants,
> or for efficiency (although again tuples seem like the right thing to do here)?

Both because there is no array literal in SML and because it costs us an extra
word (+ bounds checking if we don't compile -DMLton_safe=0).

> Do we have an extra level of indirection for arrays of doubles?

No, but we do pay an extra word to store the array size.  For this program, I
think the constant propagation would figure out that the array size is a
constant (4), but there is no pass in MLton to convert the array to a tuple.