HNHacker News
TopNewBestAskShowJobs

AngriestLettuce

85 karma · joined December 18, 2022

I am green, and I am angry about it
submissionscomments
AngriestLettuce··on The Algebra of Loans in Rust

  #!/usr/bin/env python3
  import inspect
  
  def frobnicate(unfrobbed: any) -> None:
      frame = inspect.currentframe().f_back
      for name in [name for name, value in frame.f_locals.items() if value is unfrobbed]:
          del frame.f_locals[name]
      for name in [name for name, value in frame.f_globals.items() if value is unfrobbed]:
          del frame.f_globals[name]
  
  foo = open("bar.txt")
  answer = frobnicate(foo)
  print(foo)

  
  Traceback (most recent call last):
    File "hackers.py", line 20, in <module>
      print(foo)
            ^^^
  NameError: name 'foo' is not defined
Be careful with the absolutes now :)

Not that this is is reasonable code to encounter in the wild, but you certainly can do this. You could even make it work properly when called from inside functions that use `fastlocals` if you're willing to commit even more reprehensible crimes and rewrite the `f_code` object.

Anyway, it's not really accurate to say that Python passes by reference, because Python has no concept of references. It passes by assignment. This is perfectly analogous to passing by pointer in C, which also can be used to implement reference semantics, but it ISN'T reference semantics. The difference comes in assignment, like in the following C++ program:

  #include <print>
  
  struct Object
  {
      char member{'a'};
  };
  
  void assign_pointer(Object *ptr)
  {
      Object replacement{'b'};
      ptr = &replacement;
  }
  
  void assign_reference(Object &ref)
  {
      Object replacement{'b'};
      ref = replacement;
  }
  
  int main()
  {
      Object obj{};
      std::println("Original value: {}", obj.member);
      assign_pointer(&obj);
      std::println("After assign_pointer: {}", obj.member);
      assign_reference(obj);
      std::println("After assign_reference: {}", obj.member);
      return 0;
  }

  $ ./a.out
  Original value: a
  After assign_pointer: a
  After assign_reference: b

Just like in Python, you can modify the underlying object in the pointer example by dereferencing it, but if you just assign the name to a new value, that doesn't rebind the original object. So it isn't an actual reference, it's a name that's assigned to the same thing.

ANYWAY, irrelevant nitpicking aside, I do think Python has a problem here, but its reference semantics are kind of a red herring. Python's concept of `const` is simply far too coarse. Constness is applied and enforced at the class level, not the object, function, or function call level. This, in combination with the pass-by-assignment semantics does indeed mean that functions can freely modify their arguments the vast majority of the time, with no real contract for making sure they don't do that.

In practice, I think this is handled well enough at a culture level that it's not the worst thing in the world, and I understand Python's general reluctance to introduce new technical concepts when it doesn't strictly have to, but it's definitely a bit of a footgun. Can be hard to wrap your head around too.

AngriestLettuce··on Belenios: Verifiable online voting system
Sure, as long as it's a random sample
AngriestLettuce··on How to debug your battery design
> one of the first lessons you learn on day one is how one-factor-at-a-time testing is one of the most inefficient ways you can test something

Isn't that just called unit testing?

AngriestLettuce··on Apple has reached its first-ever union contract with store employees in Maryland
> but you can for other internet connected professions in the private sectors

You can certainly try, but the quality will be noticeably poorer. You can get away with that for a while, especially as a big business, but I think the tide is already turning there. Everyone's tired of broken shitty tech that doesn't work properly with no one to really contact about it. Skilled IT professionals are in huge demand nowadays, it's only the fleas on the rats complaining that the ship is sinking. Rats can swim, they'll be fine as long as land isn't too far. Mechanics and firefighters that can actually keep the ship going (if you pay us well enough), are on the other hand doing quite well these days. Unions are great, especially for tech professionals. As long as you're still allowed to negotiate personally as well, there's no reason not to.

AngriestLettuce··on That Editor
If you're a schizo, it's probably pretty easy to rationalize: you've heard your god talk to you and tell you these things. It's easy to go "You're obviously crazy, this can't have happened!" from the outside looking in, but it's far harder to reject your own experiences out of hand as obviously false.

Doubly so because the types of experiences you get tend to be very hard to disprove. It's usually not something like "There's a yellow demonic entity running around deep in the valley by the mountain" where it's something that can be checked and explained, like actually just a moose who got tangled up in a yellow wintercoat or something, and is running around irritated trying to get it off. Rather it tends to be more "God is speaking to me through my mind, and only does so to special people" or "These people are trying to make me be as miserable as I was before I found God by making me reject him, they must be servants of Satan".

Really, if anything, I would say gifted people are probably way more likely to become religious fanatics if they have these experience. We do not have a good explanation for these things (you're sick in the head, something something dopamine does not work too well for otherwise perfectly functional and rational people), and the explanations that we do have must more or less be taken on faith. You need to trust that the person explaining these things to you is both more capable of judging the situation than you are, and has your best interests in mind. For most gifted people, the chance of both of these being true in any particular situation is abyssmally small.

This applies even more so in mental healthcare, where we're practically at the same stage of technological advancement as we were when trepanation and bloodletting were state of the art in physical medicine. We have a long way to go before we can truly make the "You're crazy!" explanation stick for those who are used to living in a world that is inevitably wrong about most things, whether subtly or overtly. Really, if you're used to being the smartest guy in the room, what choice do you have? What choice do you have but to trust yourself? Yes, you might be delusional and wrong, but you know the world at large is delusional and wrong on countless subjects as well. Why trust them more than you trust yourself, when just about every single experience you've had in life has fed into your belief that you are fundamentally better at judging reality than most people are?

AngriestLettuce··on HH70, the first high-temperature superconducting Tokamak achieves first plasma
There is none. The word has been misused to the point of ambiguity being an accepted part of its definition, and we are all worse off for it. The language is now less expressive, and you need to use more words to add context and remove ambiguity when you really do mean "literally" in the literal sense.
AngriestLettuce··on Mexico's former public security head convicted by U.S. of taking cartel bribes
Are you better off if I punch you in the face or kick you in the groin? It's a false choice, and it's pretty psychopathic.
AngriestLettuce··on Fentanyl vaccine tested in rats
With no consequences for chemically altering their products... or getting people killed...
AngriestLettuce··on Buy hi-resolution satellite images of any place on earth
Why in the world would you try to put a positive spin on it? It's bad behaviour, and you should feel bad for engaging in it. It's greedy and dishonest. Pass.
AngriestLettuce··on How to own an airline in 3 easy steps and grab the TSA nofly list along the way
Just because things should work a certain way doesn't mean they do.
AngriestLettuce··on My best techniques for evaluating character
Why should I care?
AngriestLettuce··on The global health-care collapse
Congratulations on understanding my point!
AngriestLettuce··on Revisiting KDE
I don't have an actionable list off the top of my head, but in particular, about 6-12 months ago, I started digging into how to theme my install. Wanted to have e.g. different system theme colours than Ubuntu eggplant, a different background, different login screen, etc. There were so many different ways and places of doing things (stylesheets packed in gresource files, dconf, more oldschool config files, gnome-tweaks) that after messing around with it a bit I just gave up. Didn't seem worth the time.

It isn't any one particular option that I'm missing, rather the entire experience of modifying its behaviour is a pain in the ass. They seem to labour under the delusion that if they just make this one perfect system, everyone will be happy with it, so they don't need to prioritize customizability. This is rarely ever the case when dealing with real people with different needs.

AngriestLettuce··on The global health-care collapse
Yes, it's called amphetamine. There is an alternative to being fat too, it's called broccoli. The point isn't that there are no alternatives, just that choosing to smoke is just as morally justifiable as choosing to be fat. Whether that means you should judge both categories of people, or neither, is up to you, but there can be good reasons why people are in either category. Things are rarely so black and white in the real world.
AngriestLettuce··on Revisiting KDE
On the side of the desktop environments and their usage of it, the fact that I have to "dbus-launch" to change a user's settings from a shell seems pretty insane to me.

Technology-wise I'm sure other protocols are worse and all, but DBUS does not spark joy. My experience with DBUS is that it's a pain in the ass to program with, and can cause strange issues if you for example have a service that needs to be available both for early boot and late during shutdown and you're not very careful with your dependencies. Documentation is sparse, and it seems like 99% of people just use the low-level library they keep screaming you shouldn't use anyway. I used the glib one, and it put me off programming anything GNOME ever again.

I am not a fan of DBUS.

AngriestLettuce··on Revisiting KDE
Sometimes, but that's a finnicky beast in its own right. You need to figure out which poorly documented variable you need to change to do whatever, usually from a Stack Overflow post from some other poor fucker, then make heads and tails of system settings vs. user settings, the dbus nonsense for communication, the weird gconfig shit for fiddling with system files, etc. Doing something as simple as e.g. changing the image used on the login screen for all users is far more complex than it should be.

I understand that GNOME has other goals than I do for my machine, but it's basically the antithesis of the reasons I choose to run Linux in the first place. I think it being the de facto "standard" Linux desktop environment is really hurting the ecosystem.

AngriestLettuce··on Four thousand weeks
It's not so much that I've stopped asking questions, as it is that I am no longer unsafe about what I know. I question my reality every day, but not having all the answers no longer scares me. I know what I know, I know what I don't know, and I know what I think but can't prove. I find out new things every day, and that makes me happy.

I stop asking questions once I am satisfied I understand something, not before. Sometimes I'll leave a question for later, to give my brain some time to digest it, but besides that, I'm always working through something or other. Just gotta ask the right questions is all.

AngriestLettuce··on Four thousand weeks
You misread my statement. Life has no inherent meaning. It is inherently meaningless. Therefore you make your own meaning to give it one. Simple as that. You can, of course, let someone else make a meaning for you, and choose that instead, but it's not something integral to life itself. Just your life.

That's not the same as life having no meaning, just not an inherent one. A fireplace is not inherently burning, but if you stack a bunch of logs in there and light it, it will burn all the same. The meaning of life is just the same. The physical reality of it is at it is, but what you do with it is up to you. You can follow the path laid out before you, like lighting the fireplace, but nothing's stopping you from grabbing a knife and running off to the woods to run with the wolves if that's what you'd rather do. Nothing but yourself, anyway.

AngriestLettuce··on Four thousand weeks
Yeah. Absurdism is pretty rad. Embrace the abyss, and you will never have to gaze directly at it again. Life is inherently meaningless. That means it has any meaning you want it to. Comparing it to the alternatives of what I'm told life is supposed to be all about and mean, I have to say I like making it up as I go along far better. I'll never know everything, and that means I'll always have something to live for. That makes me feel at peace.
AngriestLettuce··on Four thousand weeks
Why does it need to end?
AngriestLettuce··on Zeno’s paradox
With my feet, usually.
AngriestLettuce··on Endemic pathogens are causing psychiatric illnesses and shortening lives
I don't see how your wife's unreasonable work schedule is supposed to make me feel better about the poor quality of health care I receive. If anything, it makes me question her judgement more, that's just not healthy. How are unhealthy people supposed to educate people on health?
AngriestLettuce··on Conversation skills essentials
I don't think it is extreme, I simply choose not to surround myself with people who find me distasteful. Seems like the ideal solution for both of us.
AngriestLettuce··on Conversation skills essentials
I do not see the point. Your way made me miserable. My way makes me happy. That's all the proof I need to support myself.
AngriestLettuce··on Conversation skills essentials
What skills need improvement? I am 100% aware of when it is safe to interrupt and when it is not. People have different thresholds for what they consider acceptable, and there's a whole bunch of social factors to it, like in every situation.

All I've come to realise is that I don't need to let anyone I'm not close to police me. It's nonsensical. If I am breaking no laws, and simply sating my desires, then what business is it of a stranger what I do? What do I care if it makes them feel bad? While I am a generous person, it's important to remember that offense is taken, not given.

The only people who actually feel bad about someone who's interesting enough to capture the spotlight keeping it on, are those who feel so insecure in themselves and their own accomplishments, they are unable to let others have theirs. I understand that, and I sympathise. That's why I used to go along with what I was told. I too thought that was the right thing to do.

In my experience, I have had more positive social interactions in the past ~3 months I've been speaking my mind than the past 8 years I've lived as a "proper person" in this city. My strategy is improving my social success, not decreasing it. I simply do not accept the assertion that it is better to be reticent than assertive. It does not fit with what I've observed about who seems happy with their lives, and who feels helpless, anxious, and weak.

AngriestLettuce··on Conversation skills essentials
Which is exactly why Buddhism is for losers. No one wants to be the Dalai Lama. If standing by helplessly as others dominate you is supposed to be the highest example of holiness, then it is quite simply rotten. It got closer than the Abrahamic religions because it teaches you to accept what you can't change, but it teaches this at the cost of giving up the will to change the things you want to change that DO bother you.

Of course the things I do are a choice. Everything is. I chose to restrain myself for a good 10-11 years and it was utterly miserable. Why would I desire relationships I do not need on the condition that I do what I do not want? Makes no sense.

I don't expect anything from anyone aside from treating me with the same respect I treat them. If I am not welcome somewhere, I have no problem leaving. Being myself alone is far preferable to being someone else with a bunch of people who will never be closer than acquaintances.

AngriestLettuce··on Conversation skills essentials
I am from Norway. I know all about the importance of perservering in the face of social pressure precisely because of that. I know who I am, and I know what makes me happy. Being "proper" is not that. I know full well this trait of mine is off-putting to people when they initially meet me, but trying to be someone I'm not makes both of us even more uncomfortable.

After I broke bad during childhood due to emotional neglect, my mother reacted by buying me things and letting me mostly do what I wanted with my days in order to shut me up, and so I did. I raised myself on the internet and I know it inside out. At 15 we moved, and I decided I was going to try to be a "real" adult from now on.

That was when the REAL problems started. Hell truly is other people. Attempting to contort yourself into some strange dependencies you're somehow "supposed" to have on other people, and attachments you never formed is unnatural and painful, both for you and your victim. Though I did my best to grin and bear it, I was never happy. Though I easily accomplished anything I set out to do on the "proper" path, it brought me no joy.

Today, I am a 26 year old engineer working in a truly innovative, economically sound startup, where I am well-respected and feel fully competent. It bores me to tears, and any attempts to force me into "standups" and "OKR"s makes me want to stand up and kms.

Being "socially succesful" is no longer a goal of mine, because it's just straight up boring. People who restrain themselves from speaking their mind bore me, and people who attempt to restrain me from speaking mine infuriate me.

If that philosophy means fewer people want to interact with me, I consider that a great success.

AngriestLettuce··on C++ at the End of 2022
Good. It is high time for some breakage. When your toe is gangrenous, you should cut it off, even if you're sad to see it go. This applies doubly so if you're as strange and mysterious a beast as C++ is — sprouting body parts in random places seemingly overnight, only incidentally producing anything valuable. Maybe you don't actually need a thumb in your forehead in the first place, especially since it bleeds into your eye whenever you try to use it.
AngriestLettuce··on In-person schooling and youth suicide: Evidence from calendars, school closures
This is not surprising, but not for the reasons the authors imagine.

Of course going back to jail after being free would make any kid who values his own autonomy depressed. School in its current form is awful, because it's far too authoritarian and preachy, not because "bullying".

You wouldn't have issues with bullying if you didn't force kids who don't like each other to interact without oversight in the first place. Oversight is key, when you know kids don't like each other, don't put them together again until you know they're cool again. It's hard being a little person.

AngriestLettuce··on Conversation skills essentials
I don't care to be in rooms I am not welcomed in. Blurting things out when I have something to say is part of my character. If other people have so much of an issue with me having this characteristic, then they are perfectly free to ask me to leave.

Until then, I feel perfectly free to speak my mind, and I do not accept strangers socially policing me. Why should I? They're the ones who have an issue, not me.

Both styles are acceptable, but don't let others tell you what the room reads. You are an adult, and perfectly capable of choosing for yourself what is appropriate communication. Whether you're someone who is naturally withdrawn or not makes no difference, you should always be able to feel comfortable being yourself. If you can't, your number one goal should be to permanently remove yourself from whichever situations restricts you from that, whatever way you can while maintaining your integrity.

Don't let others scare you into thinking you'll never make it work, cause you absolutely will. Where there's a will there's a way, and I don't know a single person who moved out of home, for example, then regretted it but ended up homeless because they cut ties. I'm sure you can find me an example or two, but in the vast majority of cases, the people who are the worst off in society are those who relied on someone who was toxic for them, not those who cut ties and failed to adequately provide for themselves.

Your body is capable of more than you know, and will even naturally prioritise things for you in the way they should be. Modern society allows you to be an individual at the cost of the community we used to have. That sucks, but as a hacker, you should accept things as they are, and take advantage of what you can in the broken systems that surround us. Even in your own life. Things are what they are, and you can feel about them however you want to. The only way to make them different is to use what's in front of you.

Page 1 of 2Next →