Open jdpage opened 6 years ago
i am okay with this.
i only hesitate because i think explicit types always make code easier to read, but type inference does make refactors cleaner. so i'm on board.
I definitely think that we should have explicit types in the function signatures, for what it's worth. I don't really see us having more complicated type inference than what I'm suggesting above.
I think it could be helpful to provide simple type inference for
let
andfor
statements, to make the language a little cleaner. So the following would be allowed:Since the type-checker has to derive what
y
andw
should be anyway, it should be simple to allow it to just assume the type. (One might wanty
orw
to be a longer type, but we'd still have to deriveu8
andu16
respectively to determine which types are longer.)