• 0 Posts
  • 61 Comments
Joined 11 months ago
cake
Cake day: August 4th, 2023

help-circle

  • Find the mutual aid networks in your community and join / support them.

    Just generally be in community with those around you.

    Join or form local weekly protests for a permanent ceasefire.

    Join a union and encourage others to. Help ensure that your union has enough resources to provide support for more vulnerable members when they need to strike.

    Run for local office.


  • Jordan_U@lemmy.mlto196@lemmy.blahaj.zonerule
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    4 months ago

    I quite happily run HAOS on my raspberry pi 3 to control the lights, my Roomba, and various other devices in my home.

    Interacting with it via the home-assistant Android app, or the web interface, I’m never waiting for anything, and interacting via mosh is quite pleasant.

    Part of what makes Linux nice is that you can use just what you need.

    If what you need includes something like a web browser, then yes; 4 GiB of RAM is going to be a bad time, and 1 GiB is going to be unusable.




  • Jordan_U@lemmy.mltoMemes@lemmy.mlTrolley Problem Solution
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    5 months ago

    A concrete example of this is doctors and hospitals creating guidelines about how to triage care when ICUs were/are full because of unmitigated spread of COVID.

    It is definitely an “interesting” phylisophical question to ask:

    “If a long term ventilator user comes into the ICU, with the ventilator they own and brought from home, and they are less likely to survive than an otherwise healthy young man who needs a respirator due to COVID infection, is the morally best choice to steal the disabled person’s ventilator (killing them) and use it to save the young man’s life?”

    The policy question that should be asked instead, and never really ways, is “How do we make sure that we never get to the point where we have so many people in the ICU from a preventable disease that we run out of respirators and need to start choosing who to let die?”

    This is not just a hypothetical question:

    https://www.reuters.com/legal/government/long-term-ventilator-users-lose-bid-revive-suit-over-ny-emergency-guidelines-2022-11-23/

    Disabled people continue to plead with us for the bare minimum, like requiring doctors who work with immunocompromised patients to wear N95 respirators while treating those patients.

    We continue to chose to stack more people on both sets of tracks instead.


  • Either way, this is a rule that you as a human are required to follow, and if you fail the compiler is allowed to do anything, including killing your cat.

    It’s not a rule that the compiler enforces by failing to build code with undefined behavior.

    That is a fundamental, and extremely important, difference between C and rust.

    Also, C compilers do make optimization decisions by assuming that you as a human programmer have followed these strict aliasing rules.

    https://gist.github.com/shafik/848ae25ee209f698763cffee272a58f8

    Has a few examples where code runs “properly” without optimizations but “improperly” with optimizations.

    I put “improperly” in quotes because the C spec says that a compiler can do whatever it wants if you as a human invoke undefined behavior. Safe rust does not have undefined behavior, because if you write code which would invoke UB, rustc will refuse to build it.



  • To put it another way:

    Strict aliasing is an invariant that C compilers assume you as a developer will not violate, and use that assumption to make optimization choices that, if you as the developer have failed to follow the strict aliasing rules, could lead to undefined behavior. So it’s a variant that the compiler expects, but doesn’t enforce at compile time.

    I guess it is possible to just disable all such optimizations to get a C compiler that doesn’t create UB just because strict aliasing rules were broken, but there are still many ways that you can trigger UB in C, while safe rust that compiles successfully theoretically has no UB at all.












  • Jordan_U@lemmy.mltoProgrammer Humor@lemmy.mlSTOP WRITING C
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    5 months ago

    Fun fact!

    The Asahi Linux drivers for the Apple M1 GPU were originally written in Python: https://asahilinux.org/2022/11/tales-of-the-m1-gpu/

    GPU drivers in Python?!

    Since getting all these structures right is critical for the GPU to work and the firmware to not crash, I needed a way of quickly experimenting with them while I reverse engineered things. Thankfully, the Asahi Linux project already has a tool for this: The m1n1 Python framework! Since I was already writing a GPU tracer for the m1n1 hypervisor and filling out structure definitions in Python, I decided to just flip it on its head and start writing a Python GPU kernel driver, using the same structure definitions. Python is great for this, since it is very easy to iterate with! Even better, it can already talk the basic RTKit protocols and parse crash logs, and I improved the tools for that so I could see exactly what the firmware was doing when it crashes. This is all done by running scripts on a development machine which connects to the M1 machine via USB, so you can easily reboot it every time you want to test something and the test cycle is very fast!