Open Serentty opened 4 years ago
Hi there, thanks for commenting.
I didn't think much about sizes and lengths >32bit so far. What you say makes a lot of sense.
Did you think about a way to do it already? I can think about a couple of ways but those either generate a ton of wasm code to cast back and forth 32<>64bit numbers when interacting with lengths and sizes or are specialized "big strings" "big lists" which are unpleasant to think about..
Regarding pointers, even though Lys is wasm32, the memory layout of pointers is ready for wasm64. To get the memory address of a reference (64bit) we take the first 32bits
Well, I expect that even after multiple memories, WebAssembly modules will still generally have a “home” address space, and I would expect usize
to the be same number of bits as that address space.
Right now, lengths and sizes seem to be stored using a
u32
. At the moment, this is fine for all existing WebAssembly code. However, given that there will be 64-bit linear memories in the future, I think it would make sense to abstract this detail away to allow the same code to be recompiled for such larger linear memories.