Hacker GitHub

← All repos

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

Mentions per year 293 mentions · busiest year 2021 (69)
20082026
  1. 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
  2. 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”
  3. …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
  4. …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.
  5. …+ 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.…
  6. 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
  7. …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
  8. …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
  9. …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…
  10. …make sure to check out the portable C library used to create it, which is also fascinating: https://github.com/jart/cosmopolitan
  11. …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 .
  12. 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
  13. …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…
  14. 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
  15. 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
  16. Reminds me of the Cosmopolitan project: https://github.com/jart/cosmopolitan
  17. 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
  18. 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
  19. Looks like this is the relevant code https://github.com/jart/cosmopolitan/compare/master...igravi...
  20. 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
  21. Cosmopolitan C library would like to have a word with you then https://github.com/jart/cosmopolitan
  22. 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
  23. …make it cross-platform executable[1] that has no dependencies to get the perfect file format. [1]: https://github.com/jart/cosmopolitan
  24. yeah, C is great xplat. so I wait Zig to target https://github.com/jart/cosmopolitan at some point too
  25. …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
  26. …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...
  27. …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
  28. …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/
  29. 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?
  30. 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
  31. 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
  32. I guess that makes https://justine.lol/ape.html and https://github.com/jart/cosmopolitan hacks on top of a hack.
  33. …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
  34. …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
  35. 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
  36. That feels like the ISO equivalent of Cosmopolitan libc [0]. [0] - https://github.com/jart/cosmopolitan
  37. …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…
  38. https://github.com/jart/cosmopolitan/blob/master/third_party...
    comment by jart · 2024-11-26 · in Fly.io outage – resolved
  39. …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++
  40. 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…
  41. …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…
  42. …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
  43. …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
  44. …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
  45. …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
  46. …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
  47. 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…
  48. …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.
  49. Cosmo gives you what you described above and it’s <10kb https://github.com/jart/cosmopolitan
  50. 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