Install NanoC
You need git and a C11 compiler (cc, gcc or clang). The compiler is plain portable C11, so it builds on Linux, macOS, BSD and Windows (MSYS2 or Git Bash).
git clone --depth 1 https://github.com/NanoLanguages/NanoC
cd NanoC
cc -std=c11 -O2 mach.c -o mach
./mach installThis installs nanoc to ~/.local/bin and configures the editors it detects. Add --no-editors to skip editors or --prefix DIR to choose another location.
Check it works
cat > hello.nc <<'EOF'
+stdio
f main
puts("Hello from NanoC!")
0
EOF
nanoc run hello.ncnanoc run emits C, builds it with your C compiler and runs it. To keep the C, use nanoc c hello.nc -o hello.c.
Everyday commands
| Task | Command |
|---|---|
| Update | nanoc update |
| Uninstall | nanoc uninstall (asks first; --yes skips the question) |
| Custom location | ./mach install --prefix DIR |
| Language card | nanoc help syntax |
| Check without writing | nanoc check file.nc --json |
Editors
Syntax highlighting is generated from one token table and installed for the editors detected on your machine.
| Editor | Command |
|---|---|
| VS Code, VSCodium, Cursor | nanoc editor install vscode |
| Vim | nanoc editor install vim |
| Neovim | nanoc editor install neovim |
| Emacs | nanoc editor install emacs |
| micro | nanoc editor install micro |
| GNU nano | nanoc editor install nano |
| Sublime Text 4 | nanoc editor install sublime |
Build and test from source
./mach bootstrap # C seed -> NanoC -> NanoC, byte-identical
./mach test # unit tests, real C, sanitizers
./mach site # build this website into _site