After working with linux drivers for far too long, I’ve developed some strong opinions on the so-called “APIs” they implement.

  • tills13@lemmy.world
    link
    fedilink
    arrow-up
    33
    ·
    1 year ago

    Sorry isn’t Linus the one that always says “never break user code”? Or are you complaining about how you actually use those APIs?

    Plus I’ve seen many, many shitty closed source APIs. You are conflating correlation and causation.

    • nevemsenki@lemmy.world
      link
      fedilink
      arrow-up
      4
      arrow-down
      2
      ·
      1 year ago

      Good points, but there’s undeniably some poor choices here and there. Like trying to recompile a bunch of kernel modules every time the kernel version changes makes me wish they had a better system in place… or even worse , if you have a blob driver, you’re SOL or stuck on an old version.

    • MooseBoys@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      edit-2
      1 year ago

      never break user code

      That’s a fine mantra to have but is rarely true in practice. I’ve seen way to many needlessly breaking changes in open-source libs that are explained away with “users can just pin the old version until they update their code”.

      To be clear, the linux kernel itself is almost never the cause of the breakage per se, but some other library often implementing one of the APIs it defines. Often the reason for the breakage is under-specification of the original API, for example including a uint32 flags field that is not checked against a known set of valid flags, and inevitably ends up populated with vendor-specific (and often conflicting) usages.

      As much as API design is about exposing the functionality you want, it also involves avoiding exposing functionality you dont’t want to expose. Open-source software often omits that critical design consideration, waving it away under the false virtue of “openness”.

      • style99@kbin.social
        link
        fedilink
        arrow-up
        8
        ·
        edit-2
        1 year ago

        FOSS leads to bad API design

        Later…

        …some other library often…

        How long until…

        I swear I’m right, guys. Just trust me!