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. …happen. Cosmopolitan implements a simplified version of the Address Sanitizer (ASAN) runtime. See https://github.com/jart/cosmopolitan/blob/master/libc/log/as... I've been systematically working towards using it to vet the entire codebase.…
  2. …trying to support like WYSE terminals or actual teletypewriters. Here's the dox on the subject: https://github.com/jart/cosmopolitan/blob/1fc91f3/tool/build... > If a user hits Ctrl-C during clean-up operations that might take a long time,…
    comment by jart · 2020-12-21 · in Command Line Interface Guidelines
  3. Sorry here's what a build file looks like, which should hopefully clarify: https://github.com/jart/cosmopolitan/blob/master/libc/mem/me... As you can see, it's just vanilla make. The package program is just a helper that checks to make…
  4. …that checks some build configuration, augments C and postprocesses executable files? (Looking at https://github.com/jart/cosmopolitan it's an interesting hack. Might be useful in some cases, for example command-line tools like git.) Have…
    comment by s_gourichon · 2020-11-28 · in Please – A cross-language build system
  5. …stays sanely formed. It totally got make working like a dream in a way I simply hadn't seen before. https://github.com/jart/cosmopolitan/blob/master/tool/build/...
  6. …supported. CGA is kind of just a uint16_t[20][80] array for personal computers. See also: https://github.com/jart/cosmopolitan/blob/ea0b5d9/tool/build... You're absolutely right that the inconsistencies with textmode used to be about as…
  7. …ps://justine.storage.googleapis.com/ape.html It even supports fork() on windows as of a few days ago: https://github.com/jart/cosmopolitan/commit/db33973e0aae7ffc...
    comment by jesuscyborg · 2020-11-17 · in Best aspects of C
  8. …this day and age like being able to build once run anywhere TUI apps for Windows/Mac/Linux/BSD. See https://github.com/jart/cosmopolitan/commit/9e3e985ae5fdccc9... and https://justine.storage.googleapis.com/ape.html
    comment by jart · 2020-10-23 · in Rejuvenating Autoconf
  9. …days to retool the standard x86_64 compiler to generate 16-bit boot code for The LISP Challenge. https://github.com/jart/cosmopolitan/blob/b6793d42d5ed6b4f78...
    comment by jart · 2020-10-01 · in Defer Reference Implementation for C
  10. Thanks for the feedback! The README has now been updated: https://github.com/jart/cosmopolitan/commit/fd22e55b42503093... It could use more work though. See also https://justine.storage.googleapis.com/ape.html and the HN thread about it…
    comment by jart · 2020-09-30 · in Defer Reference Implementation for C
  11. …That should just work with GCC and Clang. That code is originally from the Cosmopolitan C Library ( https://github.com/jart/cosmopolitan ) so check it out if you like the Gist and want more! Please note the macro operates at function call…
    comment by jart · 2020-09-30 · in Defer Reference Implementation for C
  12. …I put together recently that builds over 9000 objects, 72 libraries, and a few hundred executables. https://github.com/jart/cosmopolitan/blob/master/Makefile The interesting part I've noticed is tuning the makefile so it correctly orders…
    comment by jart · 2020-09-04 · in The Quest to the Perfect Makefile
  13. You can read more in the libc source. The readme gives an overview. https://github.com/jart/cosmopolitan/tree/master/libc
  14. He talks about it a bit as the "magic numbers". You can see the big table: https://github.com/jart/cosmopolitan/blob/c91b3c50068224929c... I guess there's also syscall emulation stubs for Windows but since he only supports "stdio and…
    comment by Mathnerd314 · 2020-08-24 · in αcτµαlly pδrταblε εxεcµταblε
  15. …and distribute tiny native portable programs (like Kilo!) using hermetically sealed tools. See https://github.com/jart/cosmopolitan
    comment by jart · 2020-07-01 · in The End of the Redis Adventure
  16. Static linking ( https://github.com/jart/cosmopolitan ) jart@debian:~/cosmo$ make -j12 CPPFLAGS+=-DIM_FEELING_NAUGHTY MODE=tiny o/tiny/examples/hello.com jart@debian:~/cosmo$ ls -sh o/tiny/examples/hello.com 20K o/tiny/examples/hello.com…
    comment by jart · 2020-06-26 · in Dynamic linking
  17. …like native machine learning code. For example one build system that enables that use case is: https://github.com/jart/cosmopolitan At best these new POWER or ARM architecture Apple PCs are going to be like a C-class Mercedes. So I'm…
  18. …also taught us last year that 4kb of code is all it takes to decode every x86 isa (i.e. 1977-2020) https://github.com/jart/cosmopolitan/blob/d51409c/third_part... Thanks Mark Charney. https://github.com/intelxed/xed
  19. …I want is stdio and math; how can I do that without all the breaking builds and broken hearts?" https://github.com/jart/cosmopolitan Please consider supporting us. These old technologies are widely supported and have stood the test of…