jart/cosmopolitan
View on GitHub ↗ ★ 21,431 C
build-once run-anywhere c library
293 mentions on Hacker News by 135 people: 24 stories, 269 comments · first 2020-06-20 · latest 2026-10-11
20082026
-
It may be time to revisit cosmopolitan ( https://github.com/jart/cosmopolitan ) and redbean (redbean.dev - although the tls certs are expired and it seems scrubbed off of github).
comment by simpaticoder · 2026-10-11 · in Unikernels were hard. key word: were -
Also Cosmopolitan lib: https://github.com/jart/cosmopolitan/blob/master/libc/README... Note how all the "wrong" lines are down to markdown formatting.
comment by ncruces · 2026-08-31 · in “I just chose words carefully” -
…Cosmopoliton[2] instead. [1] https://www.pcjs.org/software/pcx86/sys/windows/win95/4.00.9... [2] https://github.com/jart/cosmopolitan
comment by jasomill · 2026-08-12 · in I hate packaging my software for Linux -
…it? That's what Cosmopolitan/APE does though, and they deliver a python: * Source: https://github.com/jart/cosmopolitan/ * Python Binary: https://cosmo.zip/pub/cosmos/bin/python which is ~ 40MB.
comment by zie · 2026-07-27 · in Self-contained highly-portable Python distributions -
…+ BIOS with the best possible performance and the tiniest footprint imaginable." * Python Source: https://github.com/jart/cosmopolitan/tree/master/third_party... * Python Binary: https://cosmo.zip/pub/cosmos/bin/python which is ~ 40MB.…
comment by zie · 2026-07-27 · in Self-contained highly-portable Python distributions -
FWIW, that's existed for a while. Source at https://github.com/jart/cosmopolitan/tree/master/third_party... with downloadable binary at https://cosmo.zip/pub/cosmos/bin/sqlite3 . % curl -LO 'https://cosmo.zip/pub/cosmos/bin/sqlite3' %…
comment by eesmith · 2026-07-16 · in SQLite should have (Rust-style) editions -
…bunch of options from a Google search, but embedding it in a thin C program and building that with https://github.com/jart/cosmopolitan would be a pretty go-like experience, I'd think.
comment by zdragnar · 2026-06-25 · in LuaJIT 3.0 proposed syntax extensions -
…would be even faster. Or just make your code boot directly. It's not hard to make a .efi, or use https://github.com/jart/cosmopolitan to make a binary that runs in many places including bare metal.
comment by yjftsjthsd-h · 2026-06-15 · in Boot Naked Linux -
…which runs anywhere. Would be fun to be able to pass around self-executable website archives. https://github.com/jart/cosmopolitan https://justine.lol/cosmopolitan/index.html https://redbean.dev (Certificates just expired for justine's…
comment by soulofmischief · 2026-06-14 · in Show HN: Kage – Shadow any website to a single binary for offline viewing -
…make sure to check out the portable C library used to create it, which is also fascinating: https://github.com/jart/cosmopolitan
comment by arcanemachiner · 2026-06-06 · in Zeroserve: A zero-config web server you can script with eBPF -
…as a single cross-OS/arch fat binary. It looks like this may be a way to actually accomplish that: https://github.com/jart/cosmopolitan .
comment by buu700 · 2026-05-17 · in XS: A programming language. Anywhere, anytime, by anyone -
The power move would have been Cosmopolitan, or a package similar to it. https://github.com/jart/cosmopolitan Cosmopolitan can be used to bundle up any gui package, and your code, and a team of professional software devs should be able to…
comment by observationist · 2026-03-04 · in Claude is an Electron App because we've lost native -
…essentially a "libc virtualization". But Musl is only available on Linux, isn't it? Cosmopolitan ( https://github.com/jart/cosmopolitan ) goes further and is available also on Mac and Windows, and it uses e.g. SIMD and other performance…
comment by Rochus · 2026-01-26 · in The Holy Grail of Linux Binary Compatibility: Musl and Dlopen -
There is this project "actually portable executable"/cosmopolitan libc https://github.com/jart/cosmopolitan that allows a compile once execute anywhere style type of C++ binary
comment by alas44 · 2026-01-26 · in The Holy Grail of Linux Binary Compatibility: Musl and Dlopen -
Naturally this makes me think of the brilliant Justine Tunney's https://justine.lol/ape.html / https://github.com/jart/cosmopolitan / https://redbean.dev/
comment by gegtik · 2026-01-18 · in Overlapping Markup -
Reminds me of the Cosmopolitan project: https://github.com/jart/cosmopolitan
comment by hyperbrainer · 2026-01-12 · in This game is a single 13 KiB file that runs on Windows, Linux and in the Browser -
https://github.com/jart/cosmopolitan/issues/35#issuecomment-... The idea of "fuck it, let's do Windows everywhere" was introduced by Justine Tunney as an April Fools Joke in the Cosmopolitan repository. That's it. An april fools joke.
comment by gaigalas · 2025-12-31 · in Loss32: Let's Build a Win32/Linux -
That makes sense. Some digging turns up some workarounds; the best I found was https://github.com/jart/cosmopolitan/releases/tag/3.1
comment by CGamesPlay · 2025-12-15 · in Go is portable, until it isn't -
Looks like this is the relevant code https://github.com/jart/cosmopolitan/compare/master...igravi...
comment by simonw · 2025-11-21 · in FAWK: LLMs can write a language interpreter -
I've gotten Claude Code to port Ruby 3.4.7 to Cosmopolitan: https://github.com/jart/cosmopolitan I kid you not. Took between a week and ten days. Cost about €10 . After that I became a firm convert. I'm still getting my head around how…
comment by igravious · 2025-11-21 · in FAWK: LLMs can write a language interpreter -
Cosmopolitan C library would like to have a word with you then https://github.com/jart/cosmopolitan
comment by stefanos82 · 2025-11-17 · in Write once, run anywhere: The promise C couldn't keep -
Maybe Jart's APE could "host" the multiple flavors of the executable: https://github.com/jart/cosmopolitan/blob/master/ape/specifi...
comment by DrNosferatu · 2025-11-06 · in Introducing architecture variants -
…make it cross-platform executable[1] that has no dependencies to get the perfect file format. [1]: https://github.com/jart/cosmopolitan
comment by Waraqa · 2025-09-07 · in Show HN: I recreated Windows XP as my portfolio -
yeah, C is great xplat. so I wait Zig to target https://github.com/jart/cosmopolitan at some point too
comment by dlahoda · 2025-08-31 · in Red: A programming language inspired by REBOL -
…which, contrary to the headlined NANOG mailing list thread, is being parsed, as we can see: * https://github.com/jart/cosmopolitan/blob/master/net/turfwar... * https://justine.lol/threads/ I think that the person who thinks that…
comment by JdeBP · 2025-08-16 · in One person was able to claim 20M IPs -
…13 bytes (I _believe_ previously it was incorrectly stating 17 which it should have been 14) [0] https://github.com/jart/cosmopolitan/blob/master/libc/nexgen... [1] https://github.com/jart/cosmopolitan/commit/e96aceae41121630...
comment by anitil · 2025-08-06 · in Consider using Zstandard and/or LZ4 instead of Deflate -
…first guess would be: server honors X-Forwarded-For where it should not? Edit: looks like thats it: https://github.com/jart/cosmopolitan/blob/master/net/turfwar... So basically someone is running a script iterates over the whole ipv4 range…
comment by maverwa · 2025-08-05 · in Welcome to the IPv4 Games -
…without a rewrite, looks like someone has figured out compiling python 3.11.4 with it[1] [0] https://github.com/jart/cosmopolitan [1] https://ahgamut.github.io/2021/07/13/ape-python/
comment by 9029 · 2025-07-28 · in Copyparty – Turn almost any device into a file server -
I guess https://github.com/jart/cosmopolitan might just be the WebAssembly for the command line then.
comment by aninteger · 2025-07-08 · in WebAssembly: Yes, but for What? -
Wouldn't Cosomoplitan be the true cross-compiling in this case? https://github.com/jart/cosmopolitan
comment by haunter · 2025-06-30 · in Cross-Compiling Common Lisp for Windows -
My early contributions to https://github.com/jart/cosmopolitan were focused towards getting a single-file Python executable. I wanted my Python scripts to run on both Windows and Linux, and now they do. To try out Python, you can: wget…
comment by ahgamut · 2025-06-25 · in Gemini CLI -
I guess that makes https://justine.lol/ape.html and https://github.com/jart/cosmopolitan hacks on top of a hack.
comment by timschmidt · 2025-06-03 · in The initial version of the /etc./magic file used by the file(1) command -
…math is the enlightened way to do things. I wrote an example in the cosmo repo of how to use it. https://github.com/jart/cosmopolitan/blob/master/examples/tr...
comment by jart · 2025-06-01 · in Beware of Fast-Math -
…that can run natively on Windows, Linux, Mac, etc: https://news.ycombinator.com/item?id=32648359 https://github.com/jart/cosmopolitan https://en.m.wikipedia.org/wiki/Fat_binary
comment by rkagerer · 2025-04-11 · in My Own Private Binary: An Idiosyncratic Introduction to Linux Kernel Modules -
Um? Should it be noted that cosmopolitan is currently at version 4? https://github.com/jart/cosmopolitan/tree/4.0.2
comment by bjconlan · 2025-02-01 · in Cosmopolitan Third Edition -
That feels like the ISO equivalent of Cosmopolitan libc [0]. [0] - https://github.com/jart/cosmopolitan
comment by bpye · 2024-12-25 · in T2 24.12 "Sky's the Limit " – 37 ISOs for 25 CPU ISAs -
…you need to worry about. For an example of a modern C++ toolchain that uses SJLJ exceptions, see https://github.com/jart/cosmopolitan/releases/tag/3.7.1 Please note that SJLJ exceptions carries a tradeoff. While SJLJ will make throwing…
comment by jart · 2024-12-13 · in C++ exception performance three years later -
https://github.com/jart/cosmopolitan/blob/master/third_party...
comment by jart · 2024-11-26 · in Fly.io outage – resolved -
…was originally written in C. It hasn't changed a whole lot since Gautham and I originally wrote it: https://github.com/jart/cosmopolitan/blob/master/tool/net/lj... I feel perfectly comfortable calling C++11 "classic" or even "baroque"…
comment by jart · 2024-11-14 · in JSON for Classic C++ -
Use Plinko https://github.com/jart/cosmopolitan/tree/master/tool/plinko Back in the 1980s it was my greatest ambition to go on The Price Is Right and play Plinko. However all I could accomplish was making this cursed programming language…
comment by jart · 2024-10-21 · in Skeptical of rewriting JavaScript tools in "faster" languages -
…But some changes to ld.bfd ended up breaking that. Now I have to use these custom defines like https://github.com/jart/cosmopolitan/blob/706cb6631021bbe7b1... and https://github.com/jart/cosmopolitan/blob/706cb6631021bbe7b1... and…
comment by jart · 2024-10-12 · in Run Llama locally with only PyTorch on CPU -
…involved, it is inevitably a hack with questionable long-term stability prospects. Case in point: https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s... The system call numbers of all the unixlikes are bitwise packed into a single…
comment by matheusmoreira · 2024-10-03 · in The Fastest Mutexes -
…a specification for APE that documents this file format, its ABI, and its historical encodings. https://github.com/jart/cosmopolitan/blob/master/ape/specifi... One day in the future, when we have the support of major OSes for the native…
comment by jart · 2024-10-03 · in The Fastest Mutexes -
…enough for this purpose), nor did it ever have universal first-class OS support. And stuff like https://github.com/jart/cosmopolitan/issues/1263 shows that just because it works today, it doesn't mean that it'll work tomorrow. What's the…
comment by int_19h · 2024-10-03 · in The Fastest Mutexes -
…find an opportunity to dive into another rabbit hole. Even ones as seemingly unimportant as clocks: https://github.com/jart/cosmopolitan/commit/dd8544c3bd7899ad...
comment by jart · 2024-10-02 · in The Fastest Mutexes -
…of those too? A separate question -- is using the upstream nsync as safe as using your fork? [1] https://github.com/jart/cosmopolitan/commits/master/third_pa...
comment by 1st1 · 2024-10-02 · in The Fastest Mutexes -
I don't think so. OpenBSD 7.3 works great. Their latest release broke APE in two ways: https://github.com/jart/cosmopolitan/issues/1263 I'm not sure if something like this is an accident. We might need to shift our support to something…
comment by jart · 2024-09-23 · in Flappy Bird for Android, only C, under 100KB -
…be solved. We added C++ exception support shortly after that issue was filed. You may want to try https://github.com/jart/cosmopolitan/releases/tag/3.9.2 and see if it still impacts you.
comment by jart · 2024-09-22 · in Embedded Common Lisp gets initial Cosmopolitan port -
Cosmo gives you what you described above and it’s <10kb https://github.com/jart/cosmopolitan
comment by tiffanyh · 2024-09-22 · in Flappy Bird for Android, only C, under 100KB -
Maybe portable CL binaries soon-ish (in CL units of time, mind you)! Conditional on https://github.com/jart/cosmopolitan/issues/939 as mentioned in INSTALL
comment by BoingBoomTschak · 2024-09-22 · in Embedded Common Lisp gets initial Cosmopolitan port