Earlier quoted context omitted.
it depends completely on what you put in "modern features"
Pattern matching, usable abstractions, non null types, tagged unions or w/e enums are, build tools etc
Garbage collection for Rust: The finalizer frontier
51–60 of 184 posts
Re: Garbage collection for Rust: The finalizer frontier
#52Before making criticisms that Garbage Collection "defeats the point" of Rust, it's important to consider that Rust has many other strengths: - Rust has no overhead from a "framework" - Rust programs start up quickly - The rust ecosystem makes it very easy to compile a command-line tool without lots of fluff - The strict nature of the language helps guide the programmer to write bug-free code. In short: There's a lot…
Re: Garbage collection for Rust: The finalizer frontier
#53Earlier quoted context omitted.
Pattern matching, usable abstractions, non null types, tagged unions or w/e enums are, build tools etc
I'm not sure what you mean by "usable abstractions" and tagged unions are a little verbose because they are defined in terms of closed sets of subtypes, but otherwise Dart has all of those.
Re: Garbage collection for Rust: The finalizer frontier
#54Earlier quoted context omitted.
You've just listed "Compiled language" features. Only the 4th point has any specificity to Rust, and even then, is vague in a way that could be misinterpreted. Rust's predominant feature, the one that brings most of its safety and runtime guarantees, is borrow checking. There are things I love about Rust besides that, but the safety from borrow checking (and everything the borrow checker makes me do) is why I like pr…
What other language has modern features like rust and is compiled?
Re: Garbage collection for Rust: The finalizer frontier
#55Before making criticisms that Garbage Collection "defeats the point" of Rust, it's important to consider that Rust has many other strengths: - Rust has no overhead from a "framework" - Rust programs start up quickly - The rust ecosystem makes it very easy to compile a command-line tool without lots of fluff - The strict nature of the language helps guide the programmer to write bug-free code. In short: There's a lot…
In all honesty, there are three topics I try to refrain myself from engaging with on HN, often unsuccesfully: politics, religion, and rust. I don't know what you had to go through before reaching rust's secure haven, but what you just said is true for the vast majority of compiled languages, which are legions.
Is there a real distinction between any of those?
Re: Garbage collection for Rust: The finalizer frontier
#56Earlier quoted context omitted.
Just going to jump in here and say that there's another reason I might want Rust with a Garbage Collector: The language/type-system/LSP is really nice to work with. There have indeed been times that I really miss having enums + traits, but DON'T miss the borrow checker.
Maybe try a different ML-influenced language like OCaml or Scala. The main innovation of Rust is bringing a nice ML-style type system to a more low level language.
Re: Garbage collection for Rust: The finalizer frontier
#57Earlier quoted context omitted.
One clear use case for GC in Rust is for implementing other languages (eg writing a JS engine). When people ask why SpiderMonkey hasn't been rewritten in Rust, one of the main technical blockers I generally bring up is that safe, ergonomic, performant GC in Rust still appears to be a major research project. ("It would be a whole lot of work" is another, less technical problem.) For a variety of reasons I don't think…
Would you plug Boehm GC into a first class JS engine? No? Then you're not using this to implement JS in anything approaching a reasonable manner either.
Re: Garbage collection for Rust: The finalizer frontier
#58The whole point of Rust is to not have a garbage collector while not worrying about memory leaks, though.
Rust has loads of other advantages over C++, though.
Re: Garbage collection for Rust: The finalizer frontier
#59The whole point of Rust is to not have a garbage collector while not worrying about memory leaks, though.
Worth highlighting: library-level GC would not be convenient enough to use pervasively in Rust anyway . library-level GC does not replace Rust's "point". It's useful to have when you have complex graph structures. Or when implementing language runtimes. I've written a bit about these types of use cases in https://manishearth.github.io/blog/2021/04/05/a-tour-of-safe... And there's a huge benefit in being able to narro…
Re: Garbage collection for Rust: The finalizer frontier
#60Earlier quoted context omitted.
Would you plug Boehm GC into a first class JS engine? No? Then you're not using this to implement JS in anything approaching a reasonable manner either.
It looks like the API of Alloy was at least designed in such a way that can somewhat easily change the GC implementation out down the line and I really hope they do cause Boehm GC and conservative GC in general is much too slow compared to state of the art precise GCs.
If, OTOH, Alloy is handle based, then maybe there's hope. Still a weird choice to use Rust this way.