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. …can see our latest progress at https://github.com/jacereda/cosmogfx and the screenshots are here https://github.com/jart/cosmopolitan/issues/35#issuecomment-... which we're working hard to polish and get merged into the mainline. If you…
    comment by jart · 2021-11-08 · in Why is Excalidraw so good?
  2. > You of course have to choose your target platform for this (...) https://github.com/jart/cosmopolitan (but, yeah, you probably want one version per target, even if hacks are cool)
    comment by e12e · 2021-11-08 · in .NET 6 Released
  3. …https://justine.lol/printansi.png Program: https://justine.lol/printansi.com Source code: https://github.com/jart/cosmopolitan/blob/master/tool/viz/pr...
    comment by jart · 2021-11-07 · in ASCII Paint
  4. …bloated either since the binary footprint starts at 12kb. See https://justine.lol/ape.html and https://github.com/jart/cosmopolitan Best part is you can still use the compiler that comes with your Linux. All it does is reconfigures the…
    comment by jart · 2021-11-07 · in Never update anything
  5. …all its library dependencies (aka static linking). the super example of this is justine's project https://github.com/jart/cosmopolitan it's pr fucking cool > Cosmopolitan Libc makes C a build-once run-anywhere language, like Java, except…
    comment by grimgrin · 2021-09-27 · in Designing Low Upkeep Software
  6. Check out Cosmopolitan which vendors all its dependencies. https://github.com/jart/cosmopolitan You can't use Node with it, yet, but you can use QuickJS if you `make o//third_party/quickjs/qjs.com` and `o/third_party/quickjs/qjs.com -m…
  7. This is one of the reasons why I've been building Cosmopolitan Libc. https://github.com/jart/cosmopolitan Alpine and Musl aren't radical enough on the bloat-free angle (since they don't fix root problem which is dynamic shared objects) and…
  8. …discover we're using the "wrong" one. Because political winds change, but good engineering endures. https://github.com/jart/cosmopolitan
  9. …a walk in the park. It only takes about a hundred lines of code to create a proper O(n) parser. https://github.com/jart/cosmopolitan/blob/0b317523a0875d83d6... The Joyent HTTP parser used by Node is very good but it's implemented in a way…
  10. …since it's the web server that reads/writes to its own executable zip file as a native process. https://github.com/jart/cosmopolitan/blob/f3e28aa192d433c379... Some ZIP APIs are designed in such a way that you can even use the POPCNT…
  11. …iterations running at a couple of order of magnitudes slower before JIT speeds fully kicks in. [0] https://github.com/jart/cosmopolitan/blob/master/libc/nexgen...
  12. …loss when building for -march=k8. If you build for -march=native then they get DCE'd entirely. See https://github.com/jart/cosmopolitan/blob/master/libc/bits/p...
    comment by jart · 2021-06-12 · in The NSA Instruction (2019)
  13. Already happened; https://github.com/jart/cosmopolitan/pull/185 (Add sqlite3 support to Lua scripts in Redbean) has been merged.
    comment by paulclinger · 2021-06-08 · in Althttpd: Simple webserver in a single C file
  14. …You can help us fix that, because we're working on chibicc, which is like TCC but 10x better. https://github.com/jart/cosmopolitan/blob/master/third_party... It's not there yet. It can be built as an actually portable executable. I already…
  15. …the two lockstep style. It's harder than you'd think. [don't click here if you intend to try that: https://github.com/jart/cosmopolitan/blob/master/tool/build/... ]
  16. …binary. There's also an example of how to build TUI panel applications in the examples/ folder. https://github.com/jart/cosmopolitan/blob/master/examples/pa... The canonical example of a Cosmopolitan TUI would be…
    comment by jart · 2021-05-17 · in Cosmopolitan Libc 1.0
  17. …have on each (yes, they are not the same) and what constants are even available on each of them https://github.com/jart/cosmopolitan/blob/7cbc2bc0838a88ff46...
    comment by jart · 2021-05-17 · in Dark Side of Posix APIs
  18. It looks like the runtime has networking support. https://github.com/jart/cosmopolitan/tree/master/libc/sock
    comment by GranPC · 2021-05-17 · in Cosmopolitan Libc 1.0
  19. …this, but this will cause problems when /tmp is mounted noexec, which is fairly common for servers: https://github.com/jart/cosmopolitan/blob/da8a08fd58324a87f6... I suppose this level of portability is more a feature if you're shipping to…
    comment by nonameiguess · 2021-05-17 · in Cosmopolitan Libc 1.0
  20. …verify the DEPS list for each static archive specifies all of its directly-reachable dependencies. https://github.com/jart/cosmopolitan/blob/b8f38cf55d84bac7d7... See example build config here: https://github.com/jart/cosmopolitan/blob/b8f3…
    comment by jart · 2021-05-17 · in Cosmopolitan Libc 1.0
  21. …then remaps itself so it can restore the original APE header and modify the ZIP central directory. https://github.com/jart/cosmopolitan/blob/b8f38cf55d84bac7d7... That said, I still upvote on VirusTotal each executable I publish, so you…
    comment by jart · 2021-05-17 · in Cosmopolitan Libc 1.0
  22. Yes, I think that's correct. However, see: https://github.com/jart/cosmopolitan/issues/90
    comment by slimsag · 2021-05-17 · in Cosmopolitan Libc 1.0
  23. ▲ 545
    Cosmopolitan Libc 1.0
    story by Orochikaku · 2021-05-17 · 113 comments
  24. …The difference is probably more pronounced in functions that do block copying like https://github.com/jart/cosmopolitan/blob/master/libc/str/st... (which actually uses the ANSITRINSICS library). For more complicated functions like this:…
    comment by jart · 2021-05-16 · in Verifying Vectorized Rust Revisited
  25. …excellent documentation to anyone who wants to understand the great mystery of vector instructions: https://github.com/jart/cosmopolitan/tree/master/libc/intrin A good example is PUNPCKLBW which is such an important instruction but a name…
    comment by jart · 2021-05-16 · in Verifying Vectorized Rust Revisited
  26. …that does less things. For example, here's the ASAN runtime that's used for the redbean web server: https://github.com/jart/cosmopolitan/blob/master/libc/intrin...
    comment by jart · 2021-05-08 · in The Byte Order Fiasco
  27. …modern c++ practices to be honest, and that's something I talk about in one of my famous hacks: https://github.com/jart/cosmopolitan/blob/4577f7fe11e5d8ef0a...
    comment by jart · 2021-05-08 · in The Byte Order Fiasco
  28. ▲ 2
    Redbean can use its own ZIP EXE as NoSQL database
    story by tomcam · 2021-05-03 · 0 comments
  29. 2 minutes and 7 seconds https://github.com/jart/cosmopolitan/runs/2482398460 on travis for a repository that builds 14,479 objects, 67 libraries, and 456 static executables, 284 of which are test executables which are run too. If I want to…
    comment by jart · 2021-05-01 · in Ask HN: How Long Is Your CI Process?
  30. Thanks! https://github.com/jart/cosmopolitan/commit/cef08d47b652bd98...
    comment by jart · 2021-05-01 · in Redbean 0.4
  31. Author here. I agree. I've added the feature you've requested as a -M INT flag in https://github.com/jart/cosmopolitan/commit/1966369e8eaa894b... and pushed a new 0.4.1 release to the website https://justine.lol/redbean/index.html
    comment by jart · 2021-05-01 · in Redbean 0.4
  32. …workaround soon. If you're curious about the Makefile code used to generate the demo zip, see here: https://github.com/jart/cosmopolitan/blob/c029e83dd893b733c1...
    comment by jart · 2021-05-01 · in Redbean 0.4
  33. …cubic, so even for a fragmented messages, it only needs to consider each character a single time: https://github.com/jart/cosmopolitan/blob/master/net/http/pa...
    comment by jart · 2021-04-02 · in An HTTP server in a single .c file
  34. You are right. Indeed it falls back to QEMU on non-x86_64 https://github.com/jart/cosmopolitan/issues/73#issuecomment-... Running QEMU on a modem would be another hack for a day :)
  35. …achieved a decades-long consensus, and ignoring the APIs For a link with the actual numbers: https://github.com/jart/cosmopolitan/blob/667ab245fe0326972b...
    comment by enriquto · 2021-03-28 · in Conway's Game of Life TUI GUI
  36. ▲ 2
    Redbean server gets Lua support
    story by johnx123-up · 2021-03-26 · 0 comments
  37. …in this thread, and you've written an assembler of your own, this might be of interest to you: https://github.com/jart/cosmopolitan/blob/master/third_party... Your work was brought to my attention maybe a year and a half ago and I think…
  38. …indirect branch with overlapping moves. Here's what that looks like in "pure c" for gcc and clang. https://github.com/jart/cosmopolitan/blob/master/libc/str/me... memcpy is hard to implement in pure c99 because aliasing pointers to…
    comment by jart · 2021-03-20 · in ZPL: (Almost) C99 Powerkit
  39. …more powerful technique is to use Numerology to identify the consensus that already exists. See https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s... and https://justine.lol/ape.html
  40. Actually Cosmopolitan doesn't support threads so Java, Go and Rust won't work at all on top of it. https://github.com/jart/cosmopolitan/blob/master/libc/runtim...
    comment by roca · 2021-03-01 · in Actually Portable Executables
  41. Fixed for me (macOS) in this[1] commit. [1] https://github.com/jart/cosmopolitan/commit/218ef491476f15ab...
  42. It doesn't appear to be supported in their libc implementation: https://github.com/jart/cosmopolitan/blob/d7ac16a9ed56ebdc70...
    comment by surajrmal · 2021-02-28 · in Actually Portable Executables
  43. …are also zip files, the interpreter can even load its own sources from the binary itself. https://github.com/jart/cosmopolitan/blob/master/examples/he...
    comment by matheusmoreira · 2021-02-28 · in Actually Portable Executables
  44. …GitHub issue that's tracking progress on the changes that need to be made based on what we learned: https://github.com/jart/cosmopolitan/issues/61
    comment by jart · 2021-02-28 · in Actually Portable Executables
  45. Yup. See https://justine.lol/blinkenlights/blinkenlights-windows.png and https://github.com/jart/cosmopolitan/blob/fcfe7c108083962a3d... and https://github.com/jart/cosmopolitan/blob/fcfe7c108083962a3d... and…
    comment by jart · 2021-02-27 · in Actually Portable Executable
  46. …sbcl? I have good news for you. I did exactly that in cosmopolitan's vendored fork of chibicc here: https://github.com/jart/cosmopolitan/blob/master/third_party... I went on a coding rampage back in December, adding to chibicc pretty much…
  47. …couldn't properly optimize memcpy. I wonder how it handles system calls. Let me check the source... https://github.com/jart/cosmopolitan/blob/master/tool/build/... https://github.com/jart/cosmopolitan/blob/master/tool/build/... > void…
  48. …and http://reddit.com/r/osdev Those concepts are implemented in the Cosmopolitan codebase here: https://github.com/jart/cosmopolitan/blob/master/ape/ape.S That file runs a few hundred lines of old school assembly in order to bring us into…
  49. …driver script will try to run the binary using QEMU (which has to be installed and on the path): https://github.com/jart/cosmopolitan/blob/40291c9db386d8a952... If i have understood how the portability works, it would be pretty…
  50. Someone already reported the same https://github.com/jart/cosmopolitan/issues/56