Tiniest x86-64-Linux emulator
github.com
github.com
> The above command fixes GCC so it outputs portable binaries that will run on every Linux distro in addition to Mac OS X, Windows NT, FreeBSD, OpenBSD, and NetBSD too. Your program will also boot on bare metal too. In other words, you've written a normal textbook C program, and thanks to Cosmopolitan's low-level linker magic, you've effectively created your own operating system which happens to run on all the existing ones as well.
Brought up recently here: "Debugging C with Cosmopolitan Libc" [1]
And introduced here "Cosmopolitan Libc: build-once run-anywhere C library" [2]
[0] https://justine.lol/cosmopolitan/index.html
…No mention of the fact that an interpreter is typically at least 10x slower than native execution. The readme does say "we're still likely to add something like jit in the near future", but for now this isn't very practical.
Their pitch is "tiniest".
Also, I don't see what's the use of Cosmopolitan Libc. In what situation does one need a CLI-only binary that can run on any system?
Also, it's an awesome hack! C'mon, man, this is Hacker News!
o//blink/blink
What's the double slash for? o//blink/blink
different from o/blink/blink
?https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...