Skip Navigation
Jump
[BLOG] Why Rust mutexes look like they do - Cliffle
  • Best practice when using .unwrap() in production code is to put a line of documentation immediately above the use of .unwrap() that describes the safety invariants which allow the unwrap to be safe.

    Since code churn could eventually cause those safety invariants to be violated, I think it's not a bad thing for a blunt audit of .unwrap() to bring your attention to those cases and prompt to reevaluate if the invariants are still satisfied.

    1
  • Jump
    [BLOG] Why Rust mutexes look like they do - Cliffle
  • This makes a lot of sense, but the functions were Rust bindings for plain C functions, they weren't function pointers. Granted I could have put pointers to the function bindings into fields in a struct and stored that struct in the mutex, but the ability to anyhow call the bindings would still exist.

    2
  • Jump
    [BLOG] Why Rust mutexes look like they do - Cliffle
  • It's a massive win, and I would question the credibility of any systems programmer that doesn't recognize that as soon as they understand the wrapper arrangement. I would have to assume that such people are going around making egregious errors in how they're using mutexes in their C-like code, and are the reason Rust is such an important language to roll out everywhere.

    The only time I've ever needed a Mutex<()> so far with Rust is when I had to interop with a C library which itself was not thread safe (unprotected use of global variables), so I needed to lock the placeholder mutex each time I called one of the C functions.

    16
  • Jump
    Eating less beef is a climate solution. Here's why that's hard for some American men
  • I honestly believe the two are related. I think big meat agro business is paying influencers to promote toxic masculinity and push nonsense like "plants emit toxic hormones" on social media.

    41
  • Jump
    Editorial Board: The teen arrested in Georgia school shooting is not an adult, and shouldn't be treated like one
  • Valid questions. Do we have firm answers to any of them? And absent firm answers, what kind of risks to the safety of the general public are we willing to accept in service of ideological values?

    1
  • Jump
    Editorial Board: The teen arrested in Georgia school shooting is not an adult, and shouldn't be treated like one
  • Yeah... I'm all for compassion and understanding, but if someone is missing the voice in their head that says "Hey, we shouldn't be killing people" then their circuitry is broken, no matter what age they are or what their circumstances are. And that broken circuitry poses a real and present danger to everyone in that person's orbit.

    I don't support punitive incarceration, but the general public has the right to exist with a reasonable degree of certainty that they're not likely to encounter a cold blooded murderer on any given day, and part of ensuring that is to incarcerate people who are known to kill others, at least until such a time that we can have a high degree of confidence that they won't be doing that again.

    The person being a child doesn't really change that part of the social contract. I promise you won't be any less upset if someone you love is murdered by a child than by an adult.

    17
  • Jump
    Cheney endorsement tests just how many Republican votes Harris can get
  • One thing I've noticed among friends and family, who lean quite left compared to the general public and would be generally supportive of progressive policies, is that there's a belief that progressive policies are unpopular outside of our circle and therefore in the primary they must vote for a candidate who triangulates in order appeal to the majority in the general election. Because a centrist from the Democratic Party is better than anything we can hope for from the Republican Party.

    I try to show them statistics that progressive policies are broadly popular across both parties as long as they are not presented with labels of "socialism" or "progressivism" but the reality that we all need to contend with is that we cannot easily escape the unfair baggage that these labels carry in our society where the big media cartel controls the narrative.

    I think if we got rid of FPTP and got rid of primaries we'd see an enormous swing in favor progressive candidates. In my mind that electoral reform is the key thing to pursue. Well that and literally anything related to mitigating the climate crisis because that one really can't wait.

    11
  • Jump
    JD Vance says school shootings are a "fact of life"
  • Countries ranked in descending order by number of school shootings from 2009-2018:

    • United States: 288
    • Mexico: 8
    • South Africa: 6
    • Afghanistan: 3
    • Brazil, Canada, France: 2
    • Azerbaijan, China, Estonia, Germany, Greece, Hungary, Kenya, Russia, Turkey: 1

    One of these is not like the others. This isn't exactly a fact of life in other parts of the world.

    Source

    176
  • Jump
    China's chip capabilities just 3 years behind TSMC, teardown shows
  • People just don't want to believe that China can win at capitalism because it undermines all their internal narratives around the innovation power of liberalism. I say this as someone who does not personally like China and its authoritarianism.

    The fact of the matter is with a population of nearly 1.5 billion people, you're statistically guaranteed to have enormous pools of talent to draw on. Even a relatively modest per capita investment in education, focused on key objectives and funneled into the portion of the talent pool that they've managed to identify, will be able to yield massive innovation.

    A lot of people will suffer under this authoritarianism. The people from these talent pools will be exploited and burnt out at a young age. This is already happening in China. But as a nation, it will be able to position itself extremely well technologically and economically, and this is a reality the rest of the world needs to be prepared to deal with.

    8
  • Jump
    Contribute, they said. It would be fun, they said.
  • Which is exactly the position that the Rust for Linux devs have understood and accepted for themselves, and yet they still get yelled at (literally, in public, on recordings) by C Linux devs for existing.

    Oh and they get snidely told that introducing the Rust language must be a mistake because suggestions to introduce other languages to the kernel turned out to be mistakes and obviously Rust is the same as all those other languages according to C developers who, by their own admission, have never used or learned anything about Rust beyond a superficial glance at some of its syntax (again this was recorded from a public event).

    10
  • Jump
    How Elon Musk’s endorsement of Trump may have backfired
  • This is very insulting, Dr. Doom is an intelligent and effective ruler, please do not draw such an unfair comparison between him and Musk. Fictional character feelings matter.

    10
  • Jump
    Johnson pulled strings to get Trump into Arlington — and now the scandal is spreading
  • I actually remember her being a standout at the debates until Tulsi Gabbard managed to latch onto a line of attack that hurt her credibility as the progressive candidate that she was presenting herself as. Shortly after that traction was lost I think she saw the writing on the wall and exited gracefully, which obviously worked in her favor because it made it easy for Biden to tap her for VP.

    20
  • Jump
    Tulsi Gabbard and RFK Jr. added to Trump transition team
  • I really can't feel bad for these women that get involved with jackass conservative men. There were plenty of signals that they either ignored or saw as green flags. For her to be in her position is either extreme negligence or sheer karma, probably the latter.

    But I feel very bad for any children that land in that position. They did nothing to deserve what they're going through.

    4
  • Jump
    rule
  • The best way to draw a conclusion is to stop taking estrogen and keep playing until his estrogen level is back to what it was previously and see if there was any correlating loss of ranking.

    10