Why do we need appimage when we can have single binary statically compiled executable?

Additionally, I can't really understand why are dynamically linked libraries so popular and how on earth anyone who ever had a ".dll / .so not found" error thinks this is a good idea.

The main idea as far as I understand was to be able to share code which I think everyone knows work only in theory, besides would it not be easier to just recompile the executable from source with updated dependency statically linked?

Other idea behind dlls were that you could replace a dll with different dll as long as the api was compatible which is very unlikely scenario for average people.

Yet another possible advantage would be that the library code is shared so it takes less space on disk which might be true for some libraries which are very common but on the other hand static compilation only includes the part of library code that is used by the program so it takes less space anyway and is more optimized.

So the reasons to use the dlls can be easily dismissed.

About the disadvantages - if the dll is not present the program will not work. It's quite simple and in my view if you create a program which does not work by itself then that's a failure on your side.

The dlls are just nightmare most of the time, static compilation for the win. (pic for attention)

  • arcimboldo@lemmy.sdf.org
    ·
    1 year ago

    When a basic dynamic library needs to be updated because, for instance, there is a big security issue, then all your statically linked binaries will have to be updated. Which means every one of those developer teams need to keep track of all the security fixes, release a new version of the binary and push it, and every user will have to download gigabytes and gigabytes of data.

    While if you have dynamic libs you only have to download that one, and the fix will be pushed earlier and all the apps will benefit from it.

      • Kache@lemm.ee
        ·
        edit-2
        1 year ago

        That route already exists today as "the web", where the "latest" JavaScript source is downloaded and JIT-ed by browsers. That ecosystem is also not the greatest example of stable and secure software.

      • arcimboldo@lemmy.sdf.org
        ·
        edit-2
        1 year ago

        Great idea. I'm sure Microsoft, Apple, Adobe, and almost every company that makes money with their software will be super happy to share their source code with me!

        Edit: typo

      • MNByChoice@midwest.social
        ·
        1 year ago

        Gentoo builds take a long time. Plus hard to use the computer during that time.

        (I may be presuming as the comment above yours is about OS wide. And this was how Gentoo handled things.)

  • steltek@lemm.ee
    ·
    edit-2
    1 year ago

    No one seems to mention license considerations when talking about static linking. Even if your app is open source, your particular license may not be legally compatible with the GPL, for example. 3BSD, MIT, and Apache most likely don't change in a single binary but it's kind of a new thing that no one was really thinking of before when mixing licenses together.

    I think this default okay assumption comes from most developers having a cloud-centric view where there's technically no "distribution" to trigger copyright.

    • TechieDamien@lemmy.ml
      ·
      1 year ago

      Even in the cloud you need to consider licenses such as the AGPL. Personally I don't get this almost apathetic approach many developers have towards licensing and abiding by licenses.

  • gens@programming.dev
    ·
    1 year ago

    Because programmers find a good way to do something then apply it to everything. It becomes the one true way, a dogma, a rule. Like how OOP was the best thing ever for everything, and just now 30 years later is proven to be actually bad. At least appimage is more like DOS-s "just unzip and run it" then "download another 500MB of useless stuff because the program depends on 1 20kB file in it".

    That said, well made libraries are good. As in those that have a stable API so versions don't matter that much.

    • leviosa@programming.dev
      ·
      1 year ago

      Like how OOP was the best thing ever for everything, and just now 30 years later is proven to be actually bad.

      Alan Kay coined the term 57 years ago and we have to look at the landscape back then to see just how much OOP has actually influenced pretty much all languages, including ones that distance themselves from the term now. Avoiding shared global state. Check. Encapsulating data and providing interfaces instead of always direct access. Check. Sending signals to objects/services for returned info. Check check check.

      • gens@programming.dev
        ·
        edit-2
        1 year ago

        Data oriented design is the new thing, much different from that.

        OOP, other then smalltalk and maybe few other languages, is somewhat different in practice from the original idea. I can dig up a great talk from Alan Kay on OOP if you want. Actually i want to watch it again so i'l edit it in here when i find it.

        Edit: https://www.youtube.com/watch?v=fhOHn9TClXY Great talk, as far as i remember.

        That said, we often have to process seemingly unrelated data together which is slow with the model of passing data arround (even when by reference). When OOP was invented memory access was as fast as actual operations on it, while today memory is much slower then processing. With caches and simd and such, it is much faster if everything is an array. Peronally i'm not a fan of OOP because of the "everything has to be an object" mentality, but do whatever you like.

  • glockenspiel@programming.dev
    ·
    edit-2
    1 year ago

    From Ellen Ullman's Close to the Machine:

    "The project begins in the programmer's mind with the beauty of a crystal. I remember the feel of a system at the early stages of programming, when the knowledge I am to represent in code seems lovely in its structuredness. For a time, the world is a calm, mathematical place. Human and machine seem attuned to a cut-diamond-like state of grace.

    ...

    Then something happens. As the months of coding go on, the irregularities of human thinking start to emerge. You write some code, and suddenly there are dark, unspecified areas. All the pages of careful documents, and still, between the sentences, something is missing.

    Human thinking can skip over a great deal, leap over small misunderstandings, can contain ifs and buts in untroubled corners of the mind. But the machine has no corners. Despite all the attempts to see the computer as a brain, the machine has no foreground or background. It cannot simultaneously do something and withhold for later something that remains unknown[1]. In the painstaking working out of the specification, line by code line, the programmer confronts all the hidden workings of human thinking.

    Now begins a process of frustration.

    [1] clarifies how multitasking typically works, which was usually just really fast switching at the time of the book.

  • leviosa@programming.dev
    ·
    1 year ago

    Windows shared libs could do with having an rpath equivalent for the host app. I tried to get their manifest doohickeys working for relative locations but gave up and still just splat install them in the exe directory.

    Aside from that shared libraries are great. Can selectively load/reload functions from them at runtime which is a fundamental building block of a lot of applications that have things like plugin systems or wrappers for different hardware etc. Good for easier LGPL compliance as well.