Re:The Law of Conservation of Complexity
by AstralStorm on Tuesday March 28, 2017 @02:03PM
(#13978988)
I like the rebuttal but would disagree that addressing memory safety without GC is harder than writing a correct garbage collector that addresses your specific performance needs.
Former is solved by formal proof, latter as well - though there is less to prove it requires much more involved proofs for a nontrivial and especially concurrent application.
Stories related to badly written GCs exist in quite a number in the internet.
Plus action at a distance by GC makes debugging harder in general.
Rust's way with static checking is better, writing a good correctness proof is yet better still.
[ Parent
| on HN ]
Re:The Law of Conservation of Complexity
by nickpsecurity on Tuesday March 28, 2017 @08:27PM
(#13982191)
Appreciate the reply. Yeah, I need to make extra clear on my GC claim I was implying the usual divide between things done in unsafe languages like C or languages with a GC. Getting all the code in a platform memory-safe consistently in an unsafe language is much harder than putting in solid effort for a GC. The counterpoint you use works both ways on that: one team published a paper on using Rust to build a GC with its safety boost. Full correctness is much harder but that's true for programs in general. There's at least some GC's that were verified already and just separation logic could probably handle at least pointer safety. Microsoft's VCC tool makes that much easier than in past although still much harder than just Rust for average developer.
So, GC's do reduce difficulty. Getting a GC right in a language like Rust is easier than getting arbitrary apps through borrow checker or arbitrary apps in unsafe language done safely. There's a reduction there in most cases that aren't toy problems, CRUD apps, etc on the app side. The complexity isn't equal.