Can signatures be made simpler and error messages be made better?

sighoya sighoya at gmail.com
Sat Jun 12 11:14:08 UTC 2021


On Saturday, 12 June 2021 at 10:48:12 UTC, Ola Fosheim Grøstad 
wrote:
> But I think it absolutely should not be part of the type or 
> overloading. You should be able to turn it off and still get 
> the same executable.
>
> That way it has no impact on compile times, meaning, you can do 
> the "linting" in the background after compilation.
>
> That way you have fast compilation, can start testing 
> immediately, and while testing the linter produces a report on 
> borrowing-problems.

Just to reiterate the essence: The general problem with static 
dependent typing is to track type (lifetime) state to make the 
lifetime constraints useful, otherwise you have hard times to 
auto prove your code given the life times constraints.

It is true that we would save lifetime inference if we would make 
it as an opt-in. But if we turn it on, then we need anyway to 
track the lifetime state of the world before the function call, 
which could include all code possibly.
Further, code written between these opt-ins can be wrong and 
needs to be corrected to work properly, which can become a hard 
undertaking. I think, this is the reason why Rust makes it 
mandatory all the time.


More information about the Digitalmars-d mailing list