git404hub

what is cosmopolitan fr?

jart/cosmopolitan — explained in plain English

Analysis updated 2026-06-21

20,798CAudience · developerComplexity · 4/5Setup · hard

tl;dr

Cosmopolitan Libc lets you compile a C or C++ program once and run the resulting binary natively on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, and BIOS, no virtual machine or per-platform build toolchain needed. It works by producing a special Actually Portable Executable format using standard GCC or Clang.

vibe map

mindmap
  root((cosmopolitan))
    What it does
      Single cross-platform binary
      No VM needed
      Build once run anywhere
    Tech Stack
      C and C++ source
      GCC and Clang
      x86-64 hardware
      APE format
    Supported Platforms
      Linux macOS Windows
      FreeBSD OpenBSD NetBSD
      BIOS bare metal
    Use Cases
      Ship CLI tools
      Port autotools projects
      Runtime tracing
    Audience
      Systems developers
      C and C++ programmers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Ship a C command-line tool as a single binary that works on Linux, macOS, and Windows without separate per-platform builds.

VIBE 2

Port an existing autotools C project to all major operating systems by compiling with the cosmocc wrapper instead of a standard compiler.

VIBE 3

Debug a cross-platform C program using built-in runtime flags for system call and function call tracing without installing extra tools.

what's the stack?

CC++GCCClangx86-64

how it stacks up fr

jart/cosmopolitanpostgres/postgresallinurl/goaccess
Stars20,79820,82820,514
LanguageCCC
Setup difficultyhardhardmoderate
Complexity4/55/52/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · hard time til it works · 1h+

Requires x86-64 hardware and using the cosmocc compiler wrapper instead of a standard C compiler, the APE binary format has a learning curve.

The explanation does not specify a license.

in plain english

Cosmopolitan Libc is a C library that lets you compile a C or C++ program once and have the resulting binary run natively on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, and even BIOS without needing a virtual machine or interpreter. It achieves this by configuring standard compilers (GCC and Clang) to output a special file format called an Actually Portable Executable (APE), a POSIX-approved polyglot format that each operating system can understand and run directly. The key value proposition is eliminating the "build once per target platform" problem. Normally, if you want a C program to run on both Linux and Windows, you need separate build toolchains and outputs for each. Cosmopolitan produces a single binary that works everywhere. The project ships its own compiler wrapper called cosmocc, which developers use in place of a standard C compiler. Existing open-source projects that use the autotools build system can often be compiled with Cosmopolitan with minimal changes. Built-in debugging aids include --strace (logs system calls) and --ftrace (logs function call traces) flags that any Cosmopolitan program can accept at runtime. The project supports x86-64 hardware and is crowdfunded through GitHub Sponsors and Patreon.

prompts (copy fr)

prompt 1
Show me how to compile a simple C hello-world program using Cosmopolitan cosmocc and produce an APE binary that runs on both Linux and macOS without modification.
prompt 2
I have an existing autotools C project. Walk me through the steps to build it with Cosmopolitan Libc so it produces a single cross-platform binary.
prompt 3
Use the --strace flag on a Cosmopolitan APE binary on Linux to trace its system calls and explain what the output means.
prompt 4
Compare a native Linux C binary and a Cosmopolitan APE binary in terms of file size and startup overhead for a small file-processing tool.
prompt 5
What are the known limitations of Cosmopolitan Libc? What kinds of programs or system features does it not support or approximate differently?

Frequently asked questions

what is cosmopolitan fr?

Cosmopolitan Libc lets you compile a C or C++ program once and run the resulting binary natively on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, and BIOS, no virtual machine or per-platform build toolchain needed. It works by producing a special Actually Portable Executable format using standard GCC or Clang.

What language is cosmopolitan written in?

Mainly C. The stack also includes C, C++, GCC.

What license does cosmopolitan use?

The explanation does not specify a license.

How hard is cosmopolitan to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cosmopolitan for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.