• 1 Post
  • 23 Comments
Joined 1 year ago
cake
Cake day: July 5th, 2023

help-circle


  • Ah I didn’t realize most people have moved onto OnceCell. The issue with both lazy static and oncecell is that they can only be assigned to once. You need a global mutable state, so neither OnceCell or lazy_static are the right choice.

    You’re going to be fighting the borrow checker if you try to have global mutable state. It will bite you eventually. You can potentially use an interior mutablity pattern along with a mutex. Have you looked into interior mutability?



















  • Pretty soon too. I love programming simulations of chaotic systems. One thing that they all seem to have in common is that there’s a very fine line between fairly stable chaos and absolutely runaway crazy chaos. It’s something that scientists call the edge of chaos. That’s where our world and all life on it thrives. We have to be right on the knifes edge between order and disorder for complexity to emerge and stabilize.

    Push the system slightly too far in one direction and things spiral out of control VERY quickly. It’s not going to slowly get worse for decades… it’s going to slowly get worse then BOOM… things will get really fucking bad really fucking fast.