Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How 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.


>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 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.


> 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.


You can do quite a lot with redbean, I wouldn't call it very very basic.

But agreed graphical use cases are limited.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: