+3
Daily
5,964
stars
412
forks
42
watchers
1,575
prs
1,889
issues
42
releases
README
C3 Language
C3 is a general-purpose programming language for building fast native software:
applications, games, tools, servers, libraries, and systems.
It's an evolution, not a revolution: familiar C syntax and semantics, modernized for everyday development.
Precompiled binaries for the following operating systems are available:
- Windows x64 download, install instructions.
- Linux x64 download, install instructions.
- MacOS Arm64 download, install instructions.
- OpenBSD x64 download, install instructions.
To build the compiler from source instead, see the instructions for building C3 from source.
[Read the C3 Manual] [Try it out in the browser]
---
[!NOTE]
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 aging fork can be found at https://github.com/c3lang/vkQuake)
A non-curated list of user written projects and other resources can be found here.
---
Design Principles
- Procedural "get things done"-type of language.
- Try to stay close to C - only change what's really necessary.
- C ABI compatibility and excellent C integration.
- Learning C3 should be easy for a C programmer.
- Data is inert.
- Avoid "big ideas" & the "more is better" fallacy.
- Evolve C into an ergonomic language for modern application development.
C3 owes its inspiration to the C2 language: to iterate on top of C without inventing an entirely new language.
Example code
The following code shows generics (more examples can be found at https://c3-lang.org/language-overview/examples/).
c3
module stack ;
// Above: the parameterized type is applied to the entire module.
struct Stack
{
sz capacity;
sz size;
Type elems;
}
// The type methods offers dot syntax calls,
// so this function can either be called
// Stack.push(&my_stack, ...) or
// my_stack.push(...)
fn void Stack.push(Stack this, Type element)
{
if (this.capacity == this.size)
{
this.capacity = 2;
if (this.capacity 0);
return this.elems[--this.size];
}
fn bool Stack.empty(Stack this)
{
return !this.size;
}
Testing it out:
c3
import stack;
// Define our new types, the first will implicitly create
// a complete copy of the entire Stack module with "Type" set to "int"
alias IntStack = Stack {int};
// The second creates another copy with "Type" set to "double"
alias DoubleStack = Stack {double};
// If we had added "alias IntStack2 = Stack {int}"
// no additional copy would have been made (since we already
// have an parameterization of Stack {int} so it would
// be same as declaring IntStack2 an alias of IntStack
// Importing an external C function is straightforward
// here is an example of importing libc's printf:
extern fn int printf(char format, ...);
fn void main()
{
IntStack stack;
// Note that C3 uses zero initialization by default
// so the Top issues
#2527The big list of complaints52 comments · 2025-10-14#2077A decentralised package discovery and fetching for C349 comments · 2025-04-06#509Help getting headers working38 comments · 2022-08-02#829Tagged unions?34 comments · 2023-07-06#1456The big 1.0 27 comments · 2024-09-16#1113C headers created by c3c is not compatible for C compilers.27 comments · 2024-02-06#3463Generic Inference16 comments · 2026-08-22#1251Support shell expansion in project.json files15 comments · 2024-07-24
Discussions
#3642Clarification about the usage of Undefined Behavior in C32 comments · 2026-11-12#3641Is the following `compound literal`-like code output correct or not?3 comments · 2026-11-12#3640Interesting behavior with modules during parsing time2 comments · 2026-11-12#3632C3 for MCU programming: evaluation1 comments · 2026-11-10#3444elf-x86 target successfully running in a freestanding i686 kernel environment0 comments · 2026-08-15#3310How to pass the pointer of element of a slice to another thread?1 comments · 2026-06-08#3305Allow extension-less files2 comments · 2026-06-04#3265fresh editor now supports C31 comments · 2026-05-25
Latest release
Version 0.8.6 v0.8.6 2026-11-11Changes / improvements - @asmname allows defining external names like @cname but without normal name mangling. - Improved GfxKey mappings. - Add the source-lib target type (and c3c source-lib command) to pack the C3 sources, C sources and headers of a project into a .c3l library. - .c3l manifests without targets now work for all platforms, and may contain version, authors and langrev. - fetch, vendor-fetch and project fetch now unpack libraries into a .c3l directory by default. Use --decompress=no to keep them compressed. - fetch now verifies the downloaded library against the checksum (