• FooBarrington@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      7 months ago

      Different platforms have different layouts for executable files. Most platforms support multiple formats, some older and some newer. Luckily it happens that pretty much all platforms have formats that don’t overlap each other (or if they do, they do so in a compatible manner), which means that the executables can be “jump-started” on every platform.

      Now, the libraries developers usually rely on aren’t cross-platform at runtime, but at build time (i.e. I can use the same library to create separate executables for separate platforms), so the developer and contributors of cosmopolitan re-implemented all the low-level stuff to work on all separate platforms with one codebase. And since they have the jump-starting routines, the whole application works anywhere!

      It’s a massive effort, but it’s starting to work really well. And the best part is that you can even build applications with emulators included that translate code for different architectures. And, to top it off, you can run the applications without an OS, since they are basically mini-OSs themselves!