[MLton] Constant folding vector expressions

Matthew Fluet fluet at tti-c.org
Mon Sep 17 11:09:10 PDT 2007


On Mon, 17 Sep 2007, Vesa Karvonen wrote:
> On 9/17/07, Matthew Fluet <fluet at tti-c.org> wrote:
>> You want "WordSize.seqIndex ()", the size of sequence (i.e., array and
>> vector) indices (and lengths).  [...]
>
> Seems to work.  Regression tests seem to pass and compiling with
> -default-type int64 and -default-type int32 seems to work on my 32-bit
> machine.
>
> One thing that makes me wonder is the int type used by the compiler.
> It might differ from the sequence index type of the target executable.

That is true.

> OTOH, for this to make a difference, you'd need to have a vector
> constant of over 2G elements.

Also true.  But, I suspect a compile with a 2G string constant will break 
long before constant folding.

> Any objections to applying it?

Looks great to me.




More information about the MLton mailing list