3 ms·
> Very strange to have no GC as a innovative feature for a modern programming language. It's because, first, there was manual memory management, which was erro
by shrimp_emoji 4y ago
> Very strange to have no GC as a innovative feature for a modern programming language.
It's because, first, there was manual memory management, which was error-prone.
Then came garbage collection, which was safe but slow.
Most recently came borrowing and move semantics, which offers the best of both worlds -- safety and speed -- at the cost of some (arguably justified) cognitive overhead and code flexibility.
- adgjlsfhk1 4y agoGarbage collection isn't slow. good GC systems have similar overhead to malloc/free.
- kaba0 4y agoGC is first and foremost a code design tool. Not having a GC causes less flexible code, every refactor will likely has to reimagine the memory ownership model at every relevant area. So I absolutely don’t think of the borrow checker as superior to a GC, it’s a different tool with different tradeoffs. It was a good choice for a low-level language like Rust, but not necessarily for a high level language.