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
-
…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? -
> 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 -
…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 -
…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 -
…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 -
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…
comment by jart · 2021-09-03 · in The Persistent Gravity of Cross Platform -
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…
comment by jart · 2021-08-26 · in There is no such thing as a “glibc based alpine image” -
…discover we're using the "wrong" one. Because political winds change, but good engineering endures. https://github.com/jart/cosmopolitan
comment by jart · 2021-08-24 · in IMF working paper suggests using browsing history in credit score calculations -
…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…
comment by jart · 2021-07-31 · in Show HN: Micro HTTP server in 22 lines of C -
…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…
comment by jart · 2021-07-23 · in Zip – How not to design a file format -
…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...
comment by lhorie · 2021-06-24 · in Maybe you don't need Rust and WASM to speed up your JS (2018) -
…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) -
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 -
…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…
comment by jart · 2021-05-26 · in Redbean: Actually Portable Executable Web Server [video] -
…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/... ]
comment by jart · 2021-05-20 · in Undefined behavior in C is a reading error -
…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 -
…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 -
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 -
…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 -
…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 -
…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 -
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 -
▲ 545
Cosmopolitan Libc 1.0story by Orochikaku · 2021-05-17 · 113 comments
-
…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 -
…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 -
…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 -
…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 -
▲ 2
Redbean can use its own ZIP EXE as NoSQL databasestory by tomcam · 2021-05-03 · 0 comments
-
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? -
Thanks! https://github.com/jart/cosmopolitan/commit/cef08d47b652bd98...
comment by jart · 2021-05-01 · in Redbean 0.4 -
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 -
…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 -
…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 -
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 :)
comment by imhoguy · 2021-04-02 · in This Blog is now hosted on a GPS/LTE modem -
…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 -
▲ 2
Redbean server gets Lua supportstory by johnx123-up · 2021-03-26 · 0 comments
-
…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…
comment by jart · 2021-03-20 · in SubX: A minimalist assembly language for a subset of the x86 ISA (2019) -
…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 -
…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
comment by jart · 2021-03-20 · in Senior Engineers Build Consensus (2019) -
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 -
Fixed for me (macOS) in this[1] commit. [1] https://github.com/jart/cosmopolitan/commit/218ef491476f15ab...
comment by fastball · 2021-02-28 · in Show HN: Redbean – Single-file distributable web server -
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 -
…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 -
…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 -
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 -
…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…
comment by jart · 2021-02-26 · in Show HN: Redbean – Single-file distributable web server -
…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…
comment by matheusmoreira · 2021-02-26 · in Show HN: Redbean – Single-file distributable web server -
…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…
comment by jart · 2021-02-26 · in Show HN: Redbean – Single-file distributable web server -
…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…
comment by twic · 2021-02-26 · in Show HN: Redbean – Single-file distributable web server -
Someone already reported the same https://github.com/jart/cosmopolitan/issues/56
comment by johnx123-up · 2021-02-26 · in Show HN: Redbean – Single-file distributable web server