ewasm / design

Ewasm Design Overview and Specification
Apache License 2.0
1.02k stars 125 forks source link

Allow different type lengths to be stored and loaded #197

Open seanyoung opened 5 years ago

seanyoung commented 5 years ago

In a wasm context not all types are 256 bit like in evm. This would make easier to store smaller primitives (e.g. i32), since they would not require padding.

The bigger win is when storing/retrieving dynamically sized arrays. Strings can be stored under a single key and do not require splitting up into smaller 32 byte chunks, and arrays do not need to store a size parameter.

Signed-off-by: Sean Young sean@mess.org

Note this is how I've started implementing storage in solang: https://github.com/hyperledger-labs/solang and this works much better than the U256 values.