Why static languages suffer from complexity
Fascination with type systems does not seem to be all that useful in practice. Go has a minimal type system, and is able to do much of Google&#x27;s internal server side work.<p>Most of the problems that cause non-trivial bugs come from invariant violations. At point A, there&#x27;s some assumption, and way over there at point B, that assumption is violated. That&#x27;s an invariant violation.<p>Type systems prevent some invariant violations. Because that works, there are ongoing attempts to extend type systems to prevent still more invariant violations. That creates another layer of confusing abstraction. Some invariants are not well represented as types, and trying makes for a bad fit. What you&#x27;re really trying to do is to substitute manual specification of attributes for global analysis.<p>The Rust borrow checker is an invariant enforcer. It explicitly does automatic global analysis, and reports explicitly that what&#x27;s going on at point B is inconsistent with what point A needs. 
This is real progress in programming language design, and is Rust&#x27;s main contribution.<p>That&#x27;s the direction to go. Other things might be dealt with by global analysis,  Deadlock detection is a good example. If P is locked before Q on one path, P must be locked before Q on all paths. There must be no path that leads to P being locked twice. That sort of thing. Rust has a related problem with borrows of reference counted items, which are checked at run time and work a lot like locks. 
Those potentially have a double-borrow problem related to program flow. I&#x27;ve heard that someone is working on that for Rust.