> Why have wasm32 and wasm64, instead of just using 8 bytes for storing pointers?
> A great number of applications don’t ever need as much as 4 GiB of memory. Forcing all these applications to use 8 bytes for every pointer they store would significantly increase the amount of memory they require, and decrease their effective utilization of important hardware resources such as cache and memory bandwidth.
> The motivations and performance effects here should be essentially the same as those that motivated the development of the x32 ABI for Linux.
> Even Knuth found it worthwhile to give us his opinion on this issue at point, a flame about 64-bit pointers.
https://webassembly.org/docs/faq/#why-have-wasm32-and-wasm64...
---
> The x32 ABI is an application binary interface (ABI) and one of the interfaces of the Linux kernel. It allows programs to take advantage of the benefits of x86-64 instruction set..while using 32-bit pointers and thus avoiding the overhead of 64-bit pointers.
https://en.wikipedia.org/wiki/X32_ABI
---
> It is absolutely idiotic to have 64-bit pointers when I compile a program that uses less than 4 gigabytes of RAM. When such pointer values appear inside a struct, they not only waste half the memory, they effectively throw away half of the cache.
It can be good to store indexes instead of pointers if you want to shrink a field though.