TryC documentation

TryC is a compiled systems language with a Python-like syntax, a scope-based memory model (no free(), no garbage collector) and no dependency on libc: programs talk to the Linux kernel directly, and the same code can target a bare-metal kernel with --noheap --nosyscall.

About this documentation

This documentation, like the comments and the other docs in the codebase, is written by AI. I work on TryC alone, and to move faster I use AI to write the comments and the documentation. The code it describes is mine; if a page and the code disagree, the code is right.

Getting started

Requirements, how to compile and run a program, what the pipeline does with your file.

Read →

Compiler options

Every flag of the compiler: output, memory knobs, freestanding targets, the verification runtime.

Read →

Language

Types, operators, control flow, functions, strings, arrays, classes, lists and dicts, pointers, macros, inline asm and FFI.

Start →

The arena

How memory is allocated and released by scope, what a promotion is, and what escapes a function.

Read →

Runtime internals

Pool chunks, bitmaps, the allocation hash table, huge pages, the string builder, scope elision: the algorithms behind the arena.

Read →

Memory safety

What is checked today, --check-arena (the arena's address sanitizer), and the roadmap to a memory-safe language.

Read →

Standard library

Reference for every libstd module: I/O, strings, lists, dicts, files, processes, threads, sockets, regex, JSON, SQLite, MySQL, X11, Vulkan.

Browse →

A first look

#include <libstd/stdio>

class Point:
    x int
    y int

def make_point(px: int, py: int) -> Point:
    p = new Point
    p.x = px
    p.y = py
    return p            // the arena keeps 'p' alive for the caller

def main() -> int:
    p = make_point(3, 4)
    total = 0
    for i = 0; i < 3; i++:
        total = total + i * p.x
    print("total = ", total, "\n")
    return 0

main()
total = 9

What makes it different

status

TryC is a personal research project. The language is usable and the standard library is large, but the memory model is not yet memory-safe in the strict sense; the memory safety page states exactly what is guaranteed, what is not, and what is planned.