Make `uint` default to `uint64` rather than `uint256`
The default size for int and uint is currently 256 bits. This is very inefficient on all the chains we support.
We should change the default for solidity and yul.
How much contract breakage will we have? Is this a bad idea?
On Wasm, pointers are 32 bit. Will this break stuff?
In Solang, uint rr = uint(address(this)); works fine. How are we going to handle this on Solana, where addresses are 256-bit wide and uint is 64-bit wide?
In Solang,
uint rr = uint(address(this));works fine. How are we going to handle this on Solana, where addresses are 256-bit wide anduintis 64-bit wide?
Of course it is possible to write code that breaks if we change the default type of uint and int. We should be concerned about actual existing code that people use that will break. To paraphrase, what will users complain about if we change this?
I am not sure whether this is a good idea. As a Solidity compiler, we should stick to whatever is default in the Solidity language. I fear that by changing that we open a can of worms.
Based on the real world contracts I saw so far. The 256bit int types are used heavily. We'd have to spend a lot of time on analyzing all the implication stemming from changing that. And I'm sure there are unpredictable bad side effects in existing contracts if this is changed.
Yes, using this integer type should be avoided on the targets we support mainly for performance reasons, but I think we can just declare this to be a documentation issue.