• 0 Posts
  • 112 Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle
  • But how does the Rust compiler do that? What does it actually check? Could I write a compiler in C that does this check on a piece of Rust code?

    C is so simplictic, that if I can write a piece of functionality in C, I must understand its inner workings fully. Not just how to use the feature, but how the feature works under the hood.

    It is often pointless to actually implement the feature in C, since the feature already has a good implementation (see the Rust compiler for the memory safety). But understanding these features, and being able to mentally think about what it takes in C to implement them, is still helpfull for gaining an understanding of the feature.




  • I have this experience with a certain type of pedestrian traffic light “button”.

    I quote button, because nothing physically moves when you press it. I’m not sure if it registers pressure or heat, but you don’t even feel anything move when you press it.

    Usually when you press the button, a red text lights up on the button, telling you to wait. This text gives you feedback that the button registered your press, and the traffic light will schedule a green light for you.

    However, sometimes you didn’t press hard enough, and the text doesn’t light up. Simple solution: press harder.

    But there is a scenario where it doesn’t matter how hard you press, the button won’t light up. You keep staring at it, while slamming the damn thing with the fury of a Hulk wealding Mjolnir. Still, nothing lights up. The reason: the light instantly went green, so it never needed to light up the text telling you to wait. And all that time slamming your fist on the button, could have been spend crossing the intersection. Instead you have been standing there, looking like a drunk person having a fistfight with an inanimate object.





  • The “rationale” behind such atrocities is always based on emotion, not actual reason. Usually fear. Analyzing why you feel that fear, and whether it is justified, will help to avoid falling into such logical fallacies.

    Ignoring the fear, and dismissing it as illogical will not help anyone. You have to acknowledge the emotion, and analyse it. Allow it to exist, but avoid acting on it before analyzing it.

    In fact, acting on emotions, especially on fear, will often result in such atrocities. Since it is fear, not reason, that eliminates compassion.

    Ps. I like the discourse. Please don’t see my comments as a personal attack. Even if neither of us changes their oppinion, understanding the other is valuable.


  • But understanding, predicting, and reacting differently on emotions are all learnable, and very rational.

    For example: don’t punch the TV when you are angry about loosing a game. Instead realise where the anger is coming from. Probably frustration, but why are you so frustrated when you loose? Some frustration is understandable, but what causes so much frustration that it turned into violent anger? And can you predict what actions or circumsfamces may result in that frustration or and anger (e.g. alcohol consumption)?

    The most rational fictional species I know, Vulcans, do not lack emotion. Quite the opposite. But they have learned to control their emotions.





  • I remember a javascript library where the was a function that returned, according to the documentation, “a color”. Did it return an object with 3 fields? Were those fields RGB or some other color scheme? Is it a string encoding a color? What format is that string? None of these questions could be answered without just running the code, and analyzing the object you got back.





  • Large beer containers are “rare” for the same reason large soda containers are rare: carbonization. If you store an opened bottle of beer for a few hours, it will go flat, killing part of the taste with it. Beer is even worse in this regard than soda. You want to finish the whole thing in one sitting for beer. Very few people consume 2 litres of beer in one sitting. … But … Every single self respecting bar has beer from the tap, right? That stuff doesn’t appear magically. It comes in kegs. You can buy those kegs from a wholesaler, or from the internet. These kegs work by inserting CO2 to pressurize it. So you will need CO2 tanks and a system to pressurize the whole thing. Not super hard to get, but not something you find in your supermarket either. But if you consume enough beer, it can absolutely be worth it to buy a tap, CO2 and kegs instead of bottles.


  • Most people here are taking the moral high road or talking about the current state of society. Lets look at game theory instead to get some fundamental understanding.

    Consider a game with 10 players. Each player has two options: be charitable or be selfish. If they are charitable, they add 3 points to the collective score. If they are selfish, they add 2 points to their own score. All players decide at the same, and afterwards the collective is evenly divided among all players. So if all players are charitable, everyone ends up with a personal score of 3. If everyone is selfish, everyone ends up with a score of 2.

    If you are the only selfish person in the game, you score a jackpot. You get a total score of 4.7.

    Now consider the idea that you play this game over and over with random players, accumulating score in each game. If everyone is always selfish, no-one will score higher than 2. But if you, individually are never selfish, you never score higher than 3.

    If we consider all players to follow the same strategy, then we get an optimization puzzle for individual score. How often do you randomly choose for selfish? Instinct and DNA, but also culture and social norms create a common recipe in humans for how to make this decision. So while reality is more complex, we still act anough alike to get some wisdom when applying this assumption.

    But it turns out that we don’t play these games with random people, but we are grouped by our strategy for choosing selfish or charitable (e.g. grouped by culture). And the groups also compete. If a group does particularly bad with their global score, they will be removed from the game (conquored, culture changed, etc). So not only does your choice for selfish or charitable need to optimize for personal gain to get a survival edge within your group, it also needs to optimize for survival of the group. A group with only selfish people will never thrive.

    Hence, in this simple example, randomly doing good can be good for the survival of your DNA and culture. Real life is much more complicated, but a similar balance of interests may be at play. After all, evolution means that life is constantly competing with itself, yet it also benefits from working together with itself.

    Whether you feel survival of your DNA and culture are relevant, is up to you. But when entire groups exist that don’t feel like that, they tend to go extinct.