3 ms·
The decision to require explicit global type annotation in Rust has nothing to do with "compiled programs are usually correct, and compiled programs run really
by masklinn 4y ago
The decision to require explicit global type annotation in Rust has nothing to do with "compiled programs are usually correct, and compiled programs run really fast", you can do that with global type inference.
It has to do with documentation, intent, and clarity. Also clarity of error messages, compilation errors with generic functions under GTI are as bad as C++ template errors.
- CoastalCoder 4y ago> It has to do with documentation, intent, and clarity. I wish it were common [0] for source code to show a combination of programmer-specified and compiler-deduced details. Seems like we could get the best of both worlds. [0] I know some IDEs show e.g. type information as mouse-over text. I'm talking about something that integrates more cleanly into the actual source-code text. So, e.g., it would show up when diff'ing the source code.
- cxr 4y agoSee <http://cr.yp.to/qhasm/literature.html http://cr.yp.to/qhasm/literature.html>