C without the ceremony
NanoC is a small programmable frontend for C. You write less, the compiler emits ordinary, readable C11, and your C compiler, libraries and tools keep working unchanged.
InstallTry it in the browserTake the tour
+stdio
f main
for i := 1; i <= 3; i++
printf("hello %d\n", i)
0#include <stdio.h>
int main(void) {
for (int i = 1; i <= 3; i++) {
printf("hello %d\n", i);
}
return 0;
}The left side is NanoC, the right side is exactly what the compiler writes. No runtime library, no hidden allocation, no new ABI.
Why NanoC
- Less noise. Indentation replaces braces and semicolons;
f name(args) typedeclares functions; the last expression is the result. - Real C underneath. Unmarked C passes through untouched, so existing headers, libraries and build systems just work.
- Programmable. Token macros (
@m) and translate-time programs (@tt) generate code during translation, with the generated C visible. - Inspectable. Output is deterministic and readable, with
#linedirectives and source maps back to your NanoC. - Portable. The compiler is self-hosted and bootstraps from a generated C seed with only a C11 compiler.
Explore
- InstallBuild from source with any C11 compiler.
- TourSeven short snippets with the C they produce.
- GuideNine lessons from hello world to translate time.
- LanguageTypes, functions, control flow, @tt and C interop.
- ExamplesSixteen programs with generated C and real output.
- ReferenceEvery translate-time builtin with a checked example.
- PlaygroundThe real compiler in your browser.
- Prompt builderTurn an idea into a prompt for any LLM.
Built for AI-assisted coding
NanoC ships a compact syntax card, JSON diagnostics and a repair loop, so an LLM can write and fix it with few tokens. Use the prompt builder to turn an idea into a ready-to-paste prompt, or point your agent at llms.txt.
nanoc help syntax
nanoc check file.nc --json