News for hackers. Stuff that matters.
Re:Ask HN: Rust or Swift for system programming? by Manishearth on Tuesday July 05, 2016 @12:42AM (#12034435)
Swift cannot implement ARC without conditional releases. Rust can. What Rust effectively does is compile an if statement into something a tiny bit more complicated (two if statements, really), in certain conditions. It doesn't need to. The if statement uses function-local information known statically, so it could be compiled in a different way without the drop flag. Basically, the condition already existed, Rust just inserts another one instead of piggybacking on the one inserted by the programmer. ARC needs new conditionals everywhere, and whether or not something will be cleared is often not obvious without looking at the whole program, and even then it could be undecidable.

I can't answer for Patrick, but I don't see the term "automatic memory management" as useful as distinction, I look at it more as a spectrum, and Rust/C++ fall squarely on the "more manual" end of that.

Re:Ask HN: Rust or Swift for system programming? by winstonewert on Tuesday July 05, 2016 @11:35AM (#12037131)
"I can't answer for Patrick, but I don't see the term "automatic memory management" as useful as distinction, I look at it more as a spectrum, and Rust/C++ fall squarely on the "more manual" end of that."

I agree 100%. My objection was to the assertion that Rust and Swift were completely different because Swift was garbage collected and Rust was not. That's just not a helpful way of looking at it, because in many ways Swift's strategy is closer to Rust's then Java's.

Re:Ask HN: Rust or Swift for system programming? by winstonewert on Tuesday July 05, 2016 @03:25PM (#12038868)
Sure there are significant differences between Rust and Swift.

But characterizing that as Swift = GC, Rust = No GC, as I was originally objecting to is a pretty terrible way of describing it.

Re:Ask HN: Rust or Swift for system programming? by Manishearth on Wednesday July 06, 2016 @05:04AM (#12041990)
Right, but the significant difference does lie in the memory management thing. GC/No GC is (a) correct, according to the academic definition, and (b) a decent approximation to the difference.
Re:Ask HN: Rust or Swift for system programming? by Manishearth on Tuesday July 05, 2016 @01:50PM (#12038204)
Right, which is why in my other comment I explained why the memory management strategies make them different, and make that difference important :)

type system wise they are pretty comparable otherwise; As a Rustacean who is used to nice type systems, Swift's type system is a pleasure to work with.