[TYPES] Optimizing data representation

Stefan Monnier monnier at iro.umontreal.ca
Thu Dec 10 13:49:23 EST 2020


> declaration and its use sites. For example, the tool could figure out that
> `data Nat = Zero | Succ Nat` should really be a number stored in binary, not
> a linked list with no information stored in the nodes. (I don't remember how
> it dealt with the unbounded nature of Nat vs the bounded nature of machine
> integers.)

In most circumstances, the bounded nature of the memory means that the
bounds on machine integers is no worse.

> The analysis could also, if I recall, figure out that a list accessed
> by index is better represented as an array. Having performed this
> analysis, the tool could then transform the code to use the more
> efficient representation.

That sounds much more impressive than turning Nats into machine
integers, indeed, I'm interested to hear what you find.


        Stefan



More information about the Types-list mailing list