> ## Documentation Index
> Fetch the complete documentation index at: https://hypotenuse.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# What is C△? Introduction to a Modern Systems Language

> C△ extends C11 with strings, dynamic arrays, memory ownership, lambdas, and more — bridging the gap between bare C and the complexity of C++.

<Note>
  C△ is under active development. Some documented features — `auto` type inference, `tuple`, struct constructors / methods / `typed struct` inheritance, `lamb` lambdas, `autoremove`, Robbery, and `printfs` — are not yet implemented in the current compiler. See [Compiler Status](/reference/compiler-status) for the full list.
</Note>

C△ (pronounced "C Triangle") is a systems programming language born out of frustration with two extremes: C's featurelessness and C++'s overwhelming complexity. C△ extends C11 with a curated set of modern features — first-class strings, dynamic arrays, memory ownership, inline assembly, and a growing standard library — while staying close to C's spirit and remaining fully C11-compatible. The Hypotenuse Compiler compiles `.ctri` source files to C and assembly, then links them into native binaries using GCC and NASM. The result is a language you can learn quickly, reason about clearly, and deploy anywhere C runs.

## Three Design Principles

Every decision in C△ follows three guiding principles.

<CardGroup cols={3}>
  <Card title="Explicit over Implicit" icon="eye">
    Nothing happens in your program without you knowing about it. Memory allocation, ownership transfers, and type conversions are always visible in the source.
  </Card>

  <Card title="Simple over Clever" icon="square-check">
    The syntax stays close to C's spirit. If a feature would require you to understand a deep layer of compiler magic to use it correctly, it does not belong in C△.
  </Card>

  <Card title="Extensible over Fixed" icon="puzzle-piece">
    The language can grow through libraries. You can package reusable C△ code as `.plib` files and distribute them — the standard library (`plstd`) itself is built this way.
  </Card>
</CardGroup>

## Key Features

<Note>
  The cards below describe the C△ language as designed. Several features are still being wired up in the Hypotenuse Compiler — see [Compiler Status](/reference/compiler-status) for the authoritative list of what's implemented today.
</Note>

C△ adds the following capabilities on top of the full C11 feature set.

<CardGroup cols={2}>
  <Card title="First-Class Strings" icon="font">
    The `string` type manages heap-allocated character sequences with automatic duplication, reassignment, and concatenation. No more manual `malloc`/`strcpy` chains.
  </Card>

  <Card title="Dynamic Arrays" icon="list">
    The `dynam` type gives you a growable array literal with a syntax you already know. Pair it with `len()` from `plstd` to iterate safely.
  </Card>

  <Card title="Memory Ownership" icon="lock">
    `allocate` and `free` handle raw heap memory. `autoremove` frees a variable when it falls out of scope. The **robbery** mechanism transfers ownership explicitly between scopes without hidden copies.
  </Card>

  <Card title="Inline Assembly" icon="microchip">
    Write `asm` blocks directly in your source file. The compiler routes them through NASM and links the resulting object files into the final binary alongside your C△ code.
  </Card>

  <Card title="Typed Struct Inheritance" icon="diagram-project">
    Use `typed struct` to define a struct that inherits fields and behaviour from a parent struct — a lightweight alternative to C++'s inheritance model.
  </Card>

  <Card title="Named Lambdas" icon="function">
    Declare inline functions with `lamb`. Named lambdas are first-class values you can pass, store, and call without the boilerplate of a full function declaration.
  </Card>

  <Card title="Namespace System" icon="folder-tree">
    Import individual symbols or whole libraries with `using`. Selective imports (e.g. `using printd from <plstd>`) keep your namespace clean and your intent explicit.
  </Card>

  <Card title="plstd Standard Library" icon="box">
    The `plstd` library ships with the compiler and provides type-aware printing (`printd`), formatted output (`printfs`), string operations, file I/O, and more — all built from `.plib` modules.
  </Card>
</CardGroup>

## Supported Platforms

The Hypotenuse Compiler currently targets the following platforms. All are under active development.

| Architecture | Platform | Output Format | Backend       | Notes                                                       |
| ------------ | -------- | ------------- | ------------- | ----------------------------------------------------------- |
| x86\_64      | Linux    | ELF64         | GCC + NASM    | Fully automatic                                             |
| ARM64        | macOS    | ELF64         | Containers    | Uses Apple's Containers software to virtualize Linux output |
| x86\_64      | Windows  | PE/COFF       | MSVC (manual) | Only emits `.c`files, doesn't support asm or `msvc`         |

The standard library (`plstd`) uses conditional compilation to handle the differences between the Linux syscall ABI (`mov rax, N; syscall`) and the macOS syscall ABI (`mov x16, N; svc #0x80`), so the same C△ source code works on both targets without modification.

<Tip>
  Ready to write your first C△ program? Head over to the [Quickstart](/quickstart) guide and have a running binary in under five minutes.
</Tip>
