5 ms·
There are definitely real uses for this is this got traction and wide adoption and developed into a robust product - for example, games would just work on Linux
by ActorNightly 4y ago
There are definitely real uses for this is this got traction and wide adoption and developed into a robust product - for example, games would just work on Linux or windows without the need for specialized drivers for either, since Nvidia would just write the drivers and compile them with this which would make them effectively multi OS, followed by all game engines targeting these drivers, and so on.
However to wish for that to happen on the same level as wishing that Linux was the dominant OS for personal computers, which would render APE mostly moot except for a few specialized cases.
- flohofwoe 4y agoAFAIK the idea behind 'actually portable executables' only works for POSIX-style command line programs. As soon as system-level DLLs (like OpenGL/X11/XGL or D3D11/DXGI) need to be accessed the problem becomes a lot more complicated (solving this problem would be massive though).
- kaba0 4y agoHow do you imagine the drivers would just run on any OS, talking to the kernel in a very very kernel-specific way? This is just a hack in the respective executable file format headers (a genius hack nonetheless from Justine), but it only works for very very basic things. Anything higher level is highly OS-specific.
- hunterb123 4y agoYou can do quite a lot with redbean, I wouldn't call it very very basic. But agreed graphical use cases are limited.
- ActorNightly 4y ago>This is just a hack in the respective executable file format headers (a genius hack nonetheless from Justine) Its a lot more then that. Look at the code. https://github.com/jart/cosmopolitan https://github.com/jart/cosmopolitan You compile an executable with flags --nostdlib and --nostdinc because it includes cross platform standard libraries mapped to the OS specific magic numbers for system calls. Think about a desktop computer with a graphics card. You can install either windows or linux on it. In both cases stuff gets rendered to the screen using the graphics cards. That is done through the driver, which maps higher level commands in libraries to instructions that graphics cards understands. While library format, is OS specific, the driver is essentially doing either ioctls or memory mapped io, both of which are the same x64 instructions. So compiling everything with APE, means that library entry points are platform agnostic, and everything up the chain all the way to the game engine. And, yes cosmopolitan only works on very basic things, as would be expected by the small number of people developing it, thats why I said IF it was adopted widely and developed further it would be possible.
- kaba0 4y ago> That is done through the driver, which maps higher level commands in libraries to instructions that graphics cards understands Which is a very highly privileged thing to do, that you can’t just circumvent. No mainstream OS does userspace drivers. And honestly, now you just introduce two levels of abstraction - one at the APE level, and one at Python’s level, so I don’t get that. Also, that’s why we have cross-platform libraries. The executable-header is hardly the “bottleneck” in cross-platform tooling - that’s why I think it is hardly more than a very cool and genius hack.