[MLton] Constant folding vector expressions
Matthew Fluet
fluet at tti-c.org
Mon Sep 17 11:38:26 PDT 2007
On Mon, 17 Sep 2007, Henry Cejtin wrote:
> Vesa's point reminds me: is there any notion of the best way to have arrays
> and vectors with more than 2^31's elements (on 64-bit machines)? There are
> definitely times when I would like it even (I think) when an int is only 32
> bits.
What would you like? I don't think you would need to change anything in
the compiler proper. You just need to expose what you want from the
Basis Libary implementation. All of the primitives
(<src>/basis-library/prim/prim-seq.sml) are in terms of SeqIndex.int,
which will be mapped to Int32.int on 32-bit platforms and Int64.int on
64-bit platforms. The <src>/basis/arrays-and-vectors/sequence.fun module
takes care of using the range checking SeqIndex.{from,to}Int to raise
Overflow/Size when native sequence indices can't be represented by
Int.int.
More information about the MLton
mailing list