Re:Up to 4GB of Memory in WebAssembly
by xscott on Thursday May 14, 2020 @07:53PM
(#23187213)
> Type inference works only when the types are unambiguous
It looks to me like when the types are ambiguous (because nothing placed a restriction on them), integer literals become 32 bit and floating literals become 64 bit. Then quietly, later when you add a restriction, the code above (which you've already worked through one line at a time with debug statements and all) changes from underneath you.
> You can still declare types ahead of time if you want to.
When the implicit stuff is surprising, I'd rather it wasn't ever implicit.
It looks to me like when the types are ambiguous (because nothing placed a restriction on them), integer literals become 32 bit and floating literals become 64 bit. Then quietly, later when you add a restriction, the code above (which you've already worked through one line at a time with debug statements and all) changes from underneath you.
> You can still declare types ahead of time if you want to.
When the implicit stuff is surprising, I'd rather it wasn't ever implicit.