News for hackers. Stuff that matters.
Re:Cosmopolitan v3.1 by sgammon on Sunday November 19, 2023 @10:08PM (#38341788)
Build once against a universal libc layer, and produce universal binaries which run on a variety of different architectures and operating systems.

It’s like LLVM or JVM but even for C, and without the overhead of virtualization.

(Hope I did it justice I am merely a fan)

Re:Cosmopolitan v3.1 by skybrian on Sunday November 19, 2023 @10:54PM (#38342071)
Yes, but who builds binaries this way and what do they use them for?
Re:Cosmopolitan v3.1 by ajusa on Sunday November 19, 2023 @11:41PM (#38342331)
Honestly - CLI apps that need to run on multiple platforms. I once built a version of https://github.com/lovebrew/lovebrew (back when it was written in Nim) using Cosmopolitan 2, and I got back a single binary that ran on all major operating systems.

This greatly reduces the time GitHub actions would need to run, as you just build and release for one OS. As others have mentioned, this does not really work for native GUI apps, that isn't supported by Cosmopolitan as far as I know. But for small CLI tools it works great!

Re:Cosmopolitan v3.1 by jhardy54 on Sunday November 19, 2023 @11:37PM (#38342312)
Python wheels are one use-case I’m excited about.
Re:Cosmopolitan v3.1 by BiteCode_dev on Monday November 20, 2023 @07:29AM (#38347038)
And nuitka.
Re:Cosmopolitan v3.1 by brabel on Monday November 20, 2023 @01:13AM (#38343236)
Even though GitHub Actions did wonders for people to be able to build their software in multiple platforms, you still have to run one build per platform and distribute one file per platform. If you could run a single build instead (and be confident that Cosmo guarantees that if it works on one, it works on the others, which may be difficult of course) and distribute a single file, that would make things much simpler and more efficient. You could save a lot of electricity if you run builds on premise (not to mention it's good for the environment). I can't believe people don't see a value in this.
Re:Cosmopolitan v3.1 by cookiengineer on Monday November 20, 2023 @01:50AM (#38343581)
Malware.

Most binaries that I have seen in the wild use cosmo/ape binary format to have "free obfuscation" that is hard to analyze by antivirus and EDR software due to its mutating self-extracting pkzip-like behavior.

Well, and of course CLI tools. I guess it's the same selling points that fit golang as well - aside from cosmo's binary format having a universal header.

Re:Cosmopolitan v3.1 by krackers on Monday November 20, 2023 @07:24PM (#38357043)
>hard to analyze by antivirus

Isn't it just a matter of updating the AV to be aware of this format? It's not like APE is the only "weird" binary format that exists, since there's stuff like UPX (which is indeed flagged by many AVs).

Re:Cosmopolitan v3.1 by xobs on Monday November 20, 2023 @03:03AM (#38344289)
I absolutely would use this for workshops I give, where users bring a variety of oddball hardware and want to do things like run FPGA synthesis or run software that pokes USB packets to communicate with debug endpoints.

In the past I've made sure to build for each platform in CI and distribute USB drives, and this just makes it one notch easier by letting me ship the same binaries to everyone.

Re:Cosmopolitan v3.1 by nxobject on Monday November 20, 2023 @05:02PM (#38355540)
I imagine portable apps might be nice. It would be cool to be able to create a flash drive with universal PGP toolkit. We're limited to console apps, though.

It would be amusing to use it to create X servers – after all, we have sockets.