<story><title>Up to 4GB of Memory in WebAssembly</title><url>https://v8.dev/blog/4gb-wasm-memory</url></story><parent_chain><item><author>xscott</author><text>I wish new platforms would embrace 64 bit as the default.  C and C++ for all common platforms use 32 bit literals and prefer 32 bit operations (char * short =&amp;gt; int).  Rust made a similar mistake.  Java arrays use 32 bit subscripts, etc...  I don&amp;#x27;t have a single computer (including my phone) using 32 bit pointers, but integers are stuck in the late 80s.  (We already had 64 bit DEC alphas in the early 90s)&lt;p&gt;For a web page, 4 gig seems like a courtesy limitation to users, but that should be enforced by the browser refusing to suck up the entire computer rather than the language being unable to.  I routinely write (non-web) applications which use arrays larger than 4 gigasamples.</text></item></parent_chain><comment><author>gpm</author><text>I, on the other hand, wish everyone would embrace 32 bit by default. Doubling the size of every index, integer, etc comes at significant memory cost for next to no benefit. Increasing the amount of memory used directly impacts performance considering how slow memory is and how important it is to keep commonly used items in cache.&lt;p&gt;If you&amp;#x27;re seriously using more than 4gb in a web page... I wouldn&amp;#x27;t mind a non-default wasm64 format. You should also be considering shipping a native app at that point, wasm is not free in terms of performance.</text></comment>
<story><title>Up to 4GB of Memory in WebAssembly</title><url>https://v8.dev/blog/4gb-wasm-memory</url></story><parent_chain><item><author>xscott</author><text>I wish new platforms would embrace 64 bit as the default.  C and C++ for all common platforms use 32 bit literals and prefer 32 bit operations (char * short =&amp;gt; int).  Rust made a similar mistake.  Java arrays use 32 bit subscripts, etc...  I don&amp;#x27;t have a single computer (including my phone) using 32 bit pointers, but integers are stuck in the late 80s.  (We already had 64 bit DEC alphas in the early 90s)&lt;p&gt;For a web page, 4 gig seems like a courtesy limitation to users, but that should be enforced by the browser refusing to suck up the entire computer rather than the language being unable to.  I routinely write (non-web) applications which use arrays larger than 4 gigasamples.</text></item></parent_chain><comment><author>skybrian</author><text>Using 32-bit pointers can save a lot of memory in pointer-heavy data. Saving memory matters on mobile devices.</text></comment>