Formerly u/CanadaPlus101 on Reddit.

  • 2 Posts
  • 2.73K Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle
  • Just in case you missed it, that was unsafe rust that lacks the overheads.

    It says some overheads. It’s different overheads, because Rust does not have reference counting garbage collection, even when safe.

    Either you should go back and read what I said about reference counting being a runtime garbage collecting algorithm, or I think we’re just done. Why say more if it’s ignored anyway?

    I don’t think I’m the zealot here.





  • Did you think rust doesn’t free up memory for you? That would be the biggest memory leak in history! No! Rust does reference counting, it just makes sure that that number is always one! What did you think the borrow checker was for?

    There is no runtime garbage collection in Rust. Given a legal program, it can detect where free-type instructions are needed at compile time, and adds them. From there on it works like C, but with no memory leaks or errors because machines are good at being exactly correct. If you want to say that’s just a reference counting algorithm that’s so simple it’s not there, sure, I guess you can do that.

    Roc has runtime overhead to do garbage collection, it says so right on their own page. It might be a post-Rust language but this feels like the same conversation I’ve had about D and… I can’t even remember now. Maybe Roc is a cool, innovative language. It’s new to me. But, it doesn’t sound like it’s doing anything fundamentally new on that specific part.

    Edit: Reading your follow up to the other person, it sounds like it has both a Rust-style compile time algorithm of some sort, and then (reference count-based) garbage collection at run time for parts of the program that would just be illegal in Rust.






  • That sounds pretty great. My impression is that relatively little code actually runs that often.

    but with none of the footguns of manual memory management, no garbage collection pauses, but yet also no evil stepparent style borrow checker to be beaten by.

    That part sounds implausible, though. What kind of memory management are they doing?









  • Sure, except you get all the same issues with countries not getting along, and now something the federal government could handle, like a space program, has to either be done redundantly by all the states separately which is wasteful and might render the whole thing impractical, or in some politicised clusterfuck of an international organisation.

    There’s a reason the trend has been towards less sovereign countries and borders over time.


  • Constructive replies are much more fun, so probably that, but if hundreds of people read what I wrote that does make it feel like it was worth the time to write. Especially if some devoted research or math went into it.

    If there’s 100 upvotes on something socially relevant I want tens of downvotes. If it’s all upvotes you’re preaching to the choir, and that’s a circlejerking waste of time.