# jart/cosmopolitan

build-once run-anywhere c library

Repository: https://github.com/jart/cosmopolitan
Canonical: https://ross.abutalabs.com/products/cosmopolitan
Language: C
License: ISC
License Family: permissive
Topics: polyglot, containers, linux, openbsd, netbsd, freebsd, windows, darwin, zip, libc, bios, efi
Last push: 2026-07-20T02:14:06+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 40, longevity 100
- inputs: {"age_days": 2270, "days_push": 45, "days_rel": 605, "gap_med": 4.5, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 21258, forks 773 (observed 2026-08-28T04:11:31.511774+00:00)

## What it is
Cosmopolitan Libc is a C/C++ library and toolchain that makes C a build-once run-anywhere language by producing polyglot executables that run natively on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, and even BIOS. It reconfigures stock GCC and Clang via the cosmocc compiler to output Actually Portable Executables with tiny footprints and native performance.

## Use cases
- compile a C program once and run it on Linux, Mac, and Windows without recompiling
- build a single-file self-contained executable with no runtime dependencies
- cross-compile C/C++ projects using autotools for every platform at once
- debug binaries with built-in --strace and --ftrace system call and function tracing
- create tiny high-performance command-line tools that boot from BIOS or EFI
- distribute a CLI tool as one zip polyglot file that runs anywhere

## When to choose
- you write C/C++ and want one binary that runs across all major operating systems
- you need minimal-footprint, dependency-free executables
- you want built-in tracing and debugging features in your binaries
- you target exotic environments like BIOS or EFI boot

## When to avoid
- your project depends on platform-specific libraries or dynamic linking
- you need a garbage-collected or interpreted language runtime
- your toolchain relies on deep OS integration like systemd or platform GUI frameworks
- you require mature ecosystem support like sanitizers or platform-specific package managers

## Facets
- artifact type: library
- maturity: active
- function: compiler, build-tool, developer-tools, file-system, concurrency, security
- domain: developer-tools, cross-platform, operating-systems, compilers, programming-languages
- platform: windows, bsd, cross-platform, cli
- tags: libc, polyglot-binary, actually-portable-executable, ape, cosmocc, c, c++, build-once-run-anywhere, linux, macos

## Member repositories
- jart/cosmopolitan (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:31.511774+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:58:27.218124+00:00, confidence not recorded.
  - readme: https://github.com/jart/cosmopolitan (fetched 2026-08-28T04:11:31.511774+00:00, sha cacb361a1f59)
- Data as of 2026-08-30T08:39:29.467469+00:00.
