I thought I’ll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!

I’ll try my best to answer any questions here, but I hope others in the community will contribute too!

  • SagXD@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    Hey, Thanks I have one more question. Is it possible to ship all required library with software?

    • Nibodhika@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      7 months ago

      It is, that’s what Windows does. It’s also possible to compile programs to not need external libraries and instead embed all they need. But both of these are bad ideas.

      Imagine you install dolphin (the KDE file manager) It will need lots of KDE libraries, then you install Okular (KDE PDF reader) it will require lots of the same library. Extend that to the hundreds of programs that are installed on your computer and you’ll easily doubled the space used with no particular benefit since the package manager already takes care of updating the programs and libraries together. Not just that, but if every program came with it’s own libraries, if a bug/security flaw was found in one of the libraries each program would need to upgrade, and if one didn’t you might be susceptible to bugs/attacks through that program.

    • Bienenvolk@feddit.de
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      That is possible indeed! For more context, you can look up “static linking vs dynamic linking”

      Tldr: Static linking: all dependencies get baked into the final binary Dynamic linking: the binary searches for libraries in your system’s PATH and loads them dynamically at runtime

    • PlexSheep@infosec.pub
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      Absolutely! That’s called static linking, as in the library is included in the executable. Most Rust programs are compiled that way.

      • SagXD@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        7 months ago

        Yea, That’s why I am learning Rust but I didn’t know it called Static Linking I think it just how Rust works LMAO. And Thanks again

      • jack@monero.town
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        edit-2
        7 months ago

        Doesn’t that mean that you have a lot of duplicate libraries when using Rust programs, even ones with the same version? That seems very inefficient

        • PlexSheep@infosec.pub
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          7 months ago

          It’s true that boundaries get inflated as a result, but with today’s hard drives it’s not really a problem.