3 ms·
It's a good article, but touches on a pet peeve on mine: It bothers me when people who have written C or C++ mention lifetimes as a novel concept. What's novel
by hsivonen 9y ago
It's a good article, but touches on a pet peeve on mine:
It bothers me when people who have written C or C++ mention lifetimes as a novel concept. What's novel is that in Rust the compiler cares about lifetimes. As a concept, though, lifetimes aren't novel and thinking about lifetimes conceptually is essential to writing C or C++ that's correct enough that it can be exposed to untrusted input. It's great that the Rust compiler relieves this cognitive load on the programmer compared to C and C++ leaving it up to the programmer to take care of.
- jstimpfle 9y agoYes. And tackling vague conceptual problems by introducing a uniform mechanism and syntax leads to overcomplicated designs. That's from my experience using C++ and other languages, at least -- Rust has always intimidated me so I haven't tried it. Many problems are actually not that hard if we start only with the truly given things. Namely at C level, or even assembler level. For example, I recently had the opportunity to convert a design based on OS threads to one employing userspace threads ("cooperative multithreading"). It was a big success, since the need for synchronisation primitives completely went away, and it was much easier to program than e.g. Javascript -- which requires callback chaining. Any language that can't give as good control as C does needs to build huge infrastructure to support approaches like that (if it at all suits the language's semantics). And strictly, even C is too much abstraction - to support green threads some non-portable parts are needed.