Cosmopolitan is an [[ISC]] licensed cross-platform binary generator written in [[3. Reference/Software/Programming Languages/C|C]]. - [Website](https://justine.lol/cosmopolitan/index.html) - [Github](https://github.com/jart/cosmopolitan) > Cosmopolitan Libc makes C a build-once run-anywhere language, like Java, except it doesn't need an interpreter or virtual machine. Instead, it reconfigures stock GCC and Clang to output a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS with the best possible performance and the tiniest footprint imaginable. # Notability The idea of being able to distribute a single file that will run on almost any system is incredibly appealing. # Philosophy > One day, while studying old code, I found out that it's possible to encode Windows Portable Executable files as a UNIX Sixth Edition shell script, due to the fact that the Thompson Shell didn't use a shebang line. Once I realized it's possible to create a synthesis of the binary formats being used by Unix, Windows, and MacOS, I couldn't resist the temptation of making it a reality, since it means that high-performance native code can be almost as pain-free as web apps. \- via [Actually Portable Executable](https://justine.lol/ape.html) # Platform Support ## OS - [[Linux]] - [[MacOS]] - [[Windows]] - [[FreeBSD]] - [[OpenBSD]] - [[NetBSD]] - BIOS ## ISA - [[AMD64]] - [[ARM64]] # Features Creates a single binary file that can run on Linux, Mac, Windows, and BSD. - A hack that lets you use cosmo binaries as a login shell. # References