News for hackers. Stuff that matters.
Re:What Is Rust's Hole Purpose? by nu11ptr on Friday February 18, 2022 @12:38PM (#30388636)
Are there other languages with compile time GC prior to Rust? I thought that was a pretty novel feature. I recall an ML variant with region inference, but that was just an optimization I believe for it's runtime GC.

Edit: MLKit was the ML dialect I was thinking of - looked it up

Re:What Is Rust's Hole Purpose? by lmkg on Friday February 18, 2022 @01:00PM (#30388958)
Nothing that has hit the mainstream like Rust. To my knowledge, Rust's lifetimes take influence from a language called Cyclone.
Re:What Is Rust's Hole Purpose? by nu11ptr on Friday February 18, 2022 @02:13PM (#30389874)
Cyclone I believe (has been a while) used region based inference like MLKit I mentioned. I'm not sure off hand if Cyclone was influenced by MLKit or the other way around. Cool tech, but Rust took it to the next level by making it pure compile time.
Re:What Is Rust's Hole Purpose? by rurban on Friday February 18, 2022 @02:47PM (#30390230)
Pony has some references how they came to it before Rust. Easily doable with escape analysis. Just that pony added a proper GC protocol for it's threaded actors and proper concurrency safety by avoiding blocking IO.

More important is tracking the owner, which perl6 used.

Re:What Is Rust's Hole Purpose? by nu11ptr on Friday February 18, 2022 @05:17PM (#30391863)
Interesting, thx for the response. Pony is on my list of languages to do a deeper dive on at some point in the future. It has some interesting ideas I thought when I last glanced at it.
Re:What Is Rust's Hole Purpose? by dataangel on Sunday February 20, 2022 @01:55PM (#30408249)
Could you elaborate on what Perl6 does? I thought it was just regular old GC.
Re:What Is Rust's Hole Purpose? by ribit on Friday February 18, 2022 @01:11PM (#30389086)
What exactly do you mean by compile time GC? Various techniques like compiler-optimized GC have been around for a while. If you are looking for mainstream stuff, Apple’s automatic reference counting for Objective C comes to mind (has been shipping since around 2009)
Re:What Is Rust's Hole Purpose? by nu11ptr on Friday February 18, 2022 @01:22PM (#30389214)
I mean that Rust knows exactly when something will be deallocated at compile time due to its lifetime system (for things that are single ownership, Rc/Arc excluded). In contrast, ARC does compiler assisted increments/decrements if I recall, but still uses runtime ref count to know if something needs deallocation.
Re:What Is Rust's Hole Purpose? by ribit on Friday February 18, 2022 @05:34PM (#30392042)
Ah, I see. True, Rust has a more restricted model that allows it to track lifetimes more precisely. As far as I know, Clang will omit reference counting if it can be statically determined but of course it has fewer optimization opportunities here. In the end, the two approaches are not entirely dissimilar: ARC uses static analysis to detect dependencies and will fallback to dynamic RC n complex scenarios; while Rust enforces certain rules that only allow most basic dependencies and requires the user to mark these by using dedicated tools.
Re:What Is Rust's Hole Purpose? by ionicgiraffe on Friday February 18, 2022 @05:25PM (#30391953)
C++ programmers where selectively implementing borrow checkers at runtime decades ago (see library omnetpp as an example). Moving those borrow checkers to compile time with templating is possible (but people did not do it because the borrow checking could be disabled after testing and no overhead would be paid neither at runtime nor compile time). That Rust implements borrow checking as pillar of the language I think it is great.