Re:Benefits of named return values in Go
by heythere124 on Friday June 30, 2017 @08:25AM
(#14670263)
Your "solution" is possible in many languages. It's just to give threads complete ownership of data they use. It doesn't require a special type system.
In general I don't think Rust actually adds much abstraction that isn't already in say Python. What it does is enforce tight constraints.
The constraints are important. They're what let you code safely, and also give the compiler the ability to optimize better.
Re:Benefits of named return values in Go
by heythere124 on Friday June 30, 2017 @10:09AM
(#14670806)
Not sure those optimisations are worth much. And it's only safety by forcing lowest common denominator code and making you justify everything to a dumb compiler. Rust serves a niche, but it is a tight niche IMO.
For languages with less sophisticated type systems you get a choice between inefficiency (Go), or complicated rules which state that the programmer is wrong for coding that way (C).