5 ms·
I think the hard part will be loops. What type would you then give to your integers? If you want it to be precise, the type checking might become undecidable. T
by Jaxan 5y ago
I think the hard part will be loops. What type would you then give to your integers? If you want it to be precise, the type checking might become undecidable. Too loose, and you end up with Int without any additional info.
- thrwyoilarticle 5y agoI'd envisage that working like Rust failing to compile when you have a mutable reference inside a loop but working if you clone it or make it immutable except with the additional case that you can just promote it to the catch-all type. If it's a loop over a range of ints, it might be possible to use that range to determine the necessary type. All that said, if you're using unbounded loops doing arithmetic on signed integers then you're already dealing with UB in C/C++ land.