• 1 Post
  • 37 Comments
Joined 2 years ago
cake
Cake day: June 18th, 2023

help-circle














  • Have you seen the hold France and Russia keep in Africa?

    • The CFA Franc still exists in Africa, even though France uses the euro and is an EU country. France enjoys a de facto veto on the boards of two banks of the CFA Franc zone.
    • Those “Wagner” pieces of shit were doing business in Africa before they went to Ukraine.

    If that’s not imperialism, I don’t know what is.







  • I think you don’t know what garbage collection is. Allocations and Deallocations is how the heap works in memory, and is one of the two main structures in it, the stack being the other one. No matter what language you are using, you cannot escape the heap, except if you don’t use a modern multitasking OS. ARC is a type of garbage collection that decides when to free a reference after it is allocated (malloc), by counting how many places refer to it. When it reaches 0, it frees the memory (free). With ARC you don’t know when a reference will be freed on compile time.

    In Rust, the compiler makes sure, using the Borrow checker, that there is only one place in your entire program where a reference can be freed, so that it can insert the free call at that place AT COMPILE TIME. That way, when the program runs there is no need for a garbage collection scheme or algorithm to take care of freeing up unused resources in the heap. Maybe you thought the borrow checker runs at compile time, taking care of your references, but that’s not the case, the borrow checker is a static analysis phase in the Rust compiler (rustc). If you want to use a runtime borrow checker, it exists, it’s called RefCell, but it’s not endorsed to use. Plus, when you use RefCell, you also usually use Reference Counting (Rc RefCell)