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. …runs on M1 Macs with ARM. Daniil Kulchenko pulled off an impressive hack to make that possible. https://github.com/jart/cosmopolitan/issues/429 Redbean also works great on Windows ARM https://youtu.be/CQ7Npip88Yw As for Linux ARM, we're…
  2. …because the difficulty in making graphics cross-platform [0]. Maybe Cosmopolitan circa 2032? [0]: https://github.com/jart/cosmopolitan/issues/35#issuecomment-... .
    comment by actuallyalys · 2022-08-16 · in Win32 Is the Only Stable ABI on Linux?
  3. …seeing something I helped with on the front page of HN[1]. Thanks for the shoutout Justine! [1] https://github.com/jart/cosmopolitan/pull/490
    comment by Toaster-King · 2022-08-07 · in Using Landlock to Sandbox GNU Make
  4. …how to approach implementing this feature. - https://news.ycombinator.com/item?id=32376870 From https://github.com/jart/cosmopolitan#support-vector , supported platforms are Windows, Linux, Mac OS X, FreeBSD, OpenBSD, and NetBSD, on AMD…
    comment by yjftsjthsd-h · 2022-08-07 · in Using Landlock to Sandbox GNU Make
  5. Cosmopolitan Libc Makefile fixes this. And it does it with plain ordinary GNU Make. https://github.com/jart/cosmopolitan/blob/master/Makefile It even has Landlock LSM based sandboxing for strict dependency checking.…
    comment by jart · 2022-08-05 · in Keeping a project bisectable
  6. …Windows' approach always seemed more sensible in the first place. But it's a step worth noting. [1] https://github.com/jart/cosmopolitan/issues/426 [2] https://man7.org/linux/man-pages/man7/vdso.7.html [3]…
  7. …systems unmodified. Cosmopolitan is an incredibly cool project that does more than you think. https://github.com/jart/cosmopolitan
    comment by DenseComet · 2022-07-28 · in Rust is actually portable
  8. …to me. The library this is built on does have a bit of a weakness with respect to GUI software https://github.com/jart/cosmopolitan/issues/35 if this can be fixed this will be an amazing tool for building simple cross platform utilities…
    comment by techdragon · 2022-07-28 · in Rust is actually portable
  9. …format headers (a genius hack nonetheless from Justine) Its a lot more then that. Look at the code. https://github.com/jart/cosmopolitan You compile an executable with flags --nostdlib and --nostdinc because it includes cross platform…
    comment by ActorNightly · 2022-07-27 · in Python is Actually Portable
  10. …uses a polyglot to tell if the processor is running in real mode or long mode within its DOS stub. https://github.com/jart/cosmopolitan/blob/066ed2b2b229dce4d1... APE is also a legal EXE file because it has the MZ header. However... I…
    comment by jart · 2022-07-27 · in Python is Actually Portable
  11. Here's the latest update on TLS https://github.com/jart/cosmopolitan/blob/master/libc/runtim... We need to rewrite the x86 binary code at runtime in order to support it on Mac/Windows. I managed to speed it up from 30ms down to 1ms of…
    comment by jart · 2022-07-27 · in Python is Actually Portable
  12. …the tool to make the default virtual memory limit equal to the total amount of physical ram. https://github.com/jart/cosmopolitan/commit/7f966de48987f79a... I hope this addresses your concern. No default limit is going to be perfect. Some…
  13. As you wish. I've just pushed a change removing the restriction on MAP_POPULATE. https://github.com/jart/cosmopolitan/commit/ccd057a85daf0d2d... Now that we have -n (maximum niceness flag) I doubt anyone will object. If your app is public…
  14. …FreeBSD behavior which we polyfill on Linux using MAP_GROWSDOWN. See our docs for further details. https://github.com/jart/cosmopolitan/blob/0a589add4167c1b587...
  15. …person on earth who's written a libc for that many platforms. Here's what I learned. If you look at https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s... you can see that there's a point in history where consensus between systems…
  16. …NOPs into function calls at runtime for all locking operations as soon as clone() is called. https://github.com/jart/cosmopolitan/blob/5df3e4e7a898d223ce... The big ugly macro that makes it work is here…
    comment by jart · 2022-07-06 · in Python 3.11 vs 3.10 performance
  17. The code is interesting: https://github.com/jart/cosmopolitan/blob/master/tool/viz/me... Feels really old school. Looks like something from people used to write DOS programs.
  18. I use chibicc to generate the documentation for cosmopolitan. https://github.com/jart/cosmopolitan/blob/master/third_party... I added many of the GNU extensions too, including an assembler. https://github.com/jart/cosmopolitan/blob/master/t…
  19. Looks like people are already on this case: https://github.com/jart/cosmopolitan/issues/429
  20. …focus of the project. redbean runs on RHEL5+ (c. 2007) and Windows Vista+ (c. 2006) by default. See https://github.com/jart/cosmopolitan/#support-vector Lua is real nice and I offer support services too. See my email at…
  21. Try this: git clone https://github.com/jart/cosmopolitan cd cosmopolitan make -j8 o//third_party/python/python.com Then put Django in the zip under the .python directory. You can also use the `.args` file just like redbean to have `-m…
  22. …need the fifty or so lines of the log. Since that tells me which system call is likely the culprit. https://github.com/jart/cosmopolitan/issues Alternatively you could email it to me: jtunney@gmail.com Thanks!
  23. next step is to use https://github.com/jart/cosmopolitan to build the binary
    comment by homarp · 2022-06-17 · in Bundling binary tools in Python wheels
  24. …intent was to only use the UNIX APIs which I believe will be stable since they're much more public. https://github.com/jart/cosmopolitan/issues/426 New 2.0.2 release available on https://redbean.dev which includes the fix.
  25. …issues with MacOS running 2.0? I may have just missed a step, but I started an issue nonetheless. https://github.com/jart/cosmopolitan/issues/426#issue-127445...
  26. The Fifth Bell System Interface, Community Edition https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s...
  27. …repository, we've always had a PNG file checked-in to cope with these kinds of situations. https://github.com/jart/cosmopolitan/blob/master/libc/dns/dn...
  28. That's one of our goals! We recently started porting libcxx: https://github.com/jart/cosmopolitan/tree/master/third_party... This week we're working on getting the complex math functions in, thanks to Musl and one of our most productive…
  29. …add branches, for things like bit overflow carrying in arithmetic operations. One example is https://github.com/jart/cosmopolitan/blob/master/third_party... which I wrote to make the NSA curve much faster. I've been meaning to upstream…
  30. …already took care of that for you, by rewriting the GNU runtimes. Also this, from a GitHub issue ( https://github.com/jart/cosmopolitan/issues/354#issuecomment... ): > Probably related to #399. The recommended approach would be to use a…
  31. I wonder how fast it is compared to djbsort https://github.com/jart/cosmopolitan/blob/master/libc/nexgen... and longsort https://github.com/jart/cosmopolitan/blob/e011973593407f576d... djbsort is outrageously fast for 32-bit ints with avx2…
  32. …expressing my opinion of your software makes you unhappy, that's not my problem, it is yours. [1]: https://github.com/jart/cosmopolitan/issues/11
    comment by ghoward · 2022-05-23 · in Logging C Functions
  33. …tests of huge existing projects that use libc, e.g. Python. Try running this on Linux: git clone https://github.com/jart/cosmopolitan.git cd cosmopolitan make -j16 o//third_party/python That command will build Python and all its…
    comment by jart · 2022-05-20 · in Logging C Functions
  34. The Cosmopolitan Libc _start() function starts by intercepting the --ftrace flag. https://github.com/jart/cosmopolitan/blob/master/libc/runtim... If it exists, then it opens and sorts of the symbol table from the elf binary.…
    comment by jart · 2022-05-20 · in Logging C Functions
  35. Here's the reference I use for VT100 ANSI control sequences: https://github.com/jart/cosmopolitan/blob/c6bbca55e9f977e386... I created this reference because there wasn't one available before that could be easily copy/pasted into GNU C or…
  36. Hi I'm one of the people cited by the article. Fraktur is awesome. I implemented it in my terminal. https://github.com/jart/cosmopolitan/blob/c6bbca55e9f977e386... Now that unicode makes it easy, there's no excuse not to have fraktur!
  37. ▲ 2
    Build-Once Run-Anywhere C lib that runs on Linux, Windows, macOS, BSDs and more
    story by capableweb · 2022-05-03 · 1 comment
  38. …and uses reference counting. Have you ever seen a garbage collector that uses the NSA instruction? https://github.com/jart/cosmopolitan/tree/master/tool/plinko
  39. …I even put the little orange flag on my blog. https://justine.lol/lambda/#binaries See also https://github.com/jart/cosmopolitan#support-vector
  40. …all the VAX/OS2/DOS/Amiga code from GNU Make and it ended up being 201,049 lines of deletions. https://github.com/jart/cosmopolitan/commit/10a766ebd07b7340... A lot of what I do with Cosmopolitan Libc is because it breaks my heart how in…
  41. …Kilo editor or Linenoise) on how to build your own version of the `strace` command in pure C. https://github.com/jart/cosmopolitan/blob/master/tool/build/... If you monitor the system interfaces then you don't need to read the source code.…
  42. …is basically that. It also uses plain old GNU Make so it's not snowflake. Example build config: https://github.com/jart/cosmopolitan/blob/master/tool/decode... So far managed to port a lot of programming languages like Python including its…
  43. Shannon entropy. https://github.com/jart/cosmopolitan/blob/master/libc/rand/m... You can even measure a program in terms of physics constants too.
  44. Spoiler alert git clone https://github.com/jart/cosmopolitan cd cosmopolitan make -j8 o//third_party/quickjs/qjs.com Build it on Linux but it runs anywhere. https://github.com/jart/cosmopolitan/tree/master/third_party... Here's a prebuilt…
    comment by jart · 2022-03-08 · in QuickJS JavaScript Engine
  45. …For instance, rather than processing data at 16kbps it's able to do things like crc32 at 22gBps https://github.com/jart/cosmopolitan/blob/d6a039821f927cc81b... and memset goes 126gBps https://github.com/jart/cosmopolitan/blob/d6a039821f927c…
    comment by jart · 2022-02-28 · in Lambda Calculus in 400 Bytes
  46. Got you covered. https://github.com/jart/cosmopolitan/blob/master/examples/ru... $ git clone https://github.com/jart/cosmopolitan && cd cosmopolitan $ make -j8 o//examples/rusage.com o//examples/hello.com $ o//examples/rusage.com…
    comment by jart · 2022-02-07 · in Nim vs Rust Benchmarks
  47. …on a physical computer running Linux should be 25µs. That's two orders of a magnitude difference. https://github.com/jart/cosmopolitan/blob/master/test/libc/s...
    comment by jart · 2022-02-07 · in Nim vs Rust Benchmarks
  48. …your platform after the first run, so it can be fast and efficient for subsequent executions. [1] https://github.com/jart/cosmopolitan
    comment by mimimi31 · 2022-01-28 · in On self-modifying executables in Rust
  49. …Bazel is nice, but these days I'm running a small scrappy operation, so I just use GNU Make. https://github.com/jart/cosmopolitan/blob/7064d736e3ded15087... I like Make since it's able to build a repository with 17k .o files, 80 .a…
    comment by jart · 2021-12-21 · in Show HN: Lisp with GC in 436 Bytes
  50. …Others: - C/C++ has linker to link all to one binary - CLI/webserver only https://github.com/jart/cosmopolitan like https://redbean.dev . Same exe works on many x64 OS like Windows/macOS/Linux/BSD, it embeds .zip file and can read/w