The programming language for the next generation

Current version: 0.5.4 Installation Guide

The C3 Programming Language

Simple, fast, safe, compiled. For developing maintainable software.

module hello_world;
import std::io;

fn void main()
io::printn("Hello, world!");

Full C ABI Compatibility

C3 fits right into your C/C++ application with full C ABI compatibility out of the box: no need for special "C compatible" types or functions, no limitations on what C3 features you can use from C.

Module System

A simple and straightforward module system that doesn't get into the way with defaults that makes sense.

Semantic Macros

Macros that are just as easy to read and write as regular functions. Packing much more power than C's preprocessor, they're deliberately balanced to ensure that code reading isn't made difficult.

C3 is an evolution, not a revolution: the C-like for programmers who like C.

C3 is a programming language that builds on the syntax and semantics of the C language, with the goal of evolving it while still retaining familiarity for C programmers.

Thanks to full ABI compatibility with C, it's possible to mix C and C3 in the same project with no effort. As a demonstration, vkQuake was compiled with a small portion of the code converted to C3 and compiled with the c3c compiler.

The fork can be found here

Gradual Contracts

C3 brings programming-by-contract to the mainstream with unobtrusive contracts that are used to express both runtime and compile-time constraints.

Zero Overhead Errors

Error handling that combines the best parts of "Result" errors with the easy use of exceptions and integrates seamlessly with C.

Built-in slices and slicing

Slices are type safe "pointer + length" types which natively supports copying and comparison.

Generic modules

C3 generic modules offer superior simplicity and clarity for creating generic types.

Runtime and compile reflection

Type introspection is available both at compile time and runtime, powering flexible macros and functions

Inline Assembly

Write asm as regular inline code without using strings or cryptic constraints.

Debug with safety checks

Feel confident in your code's correctness: in debug mode the compiler inserts extensive runtime bounds checks and value checks, which together with contracts will let you catch bugs early.

Detailed stacktraces

No more anonymous "segmentation fault" errors: the C3 standard library enables detailed stacktraces out of the box for your debug builds.

Get Started