Repository navigation
Finch 1.0.0
The first release of Finch: a small, fast programming language on LLVM, with C-like syntax
that is simple enough to learn in an hour.
Language
fn name(int a) -> int { ... }functions,x := 5/int x = 5variables- Types:
int,float,bool,char,str; sizedi8…i64,u8…u64,f32,f64; pointersptr[T]withaddr(x),p.value,null if/else if/else,while,for i in 0..10,break,continue- Arithmetic, comparison, logical and bitwise operators, with Go-style precedence (
x & 1 == 0means(x & 1) == 0) - Implicit conversions only when nothing is lost; number literals adapt to their target type
print(...)for every type
Safety without a runtime
- No silent narrowing, no signed/unsigned mixing
- Division by zero,
MIN / -1and.valueonnullstop with a clear runtime error and line number - Readable compile errors with a source excerpt and a suggested fix
C interop
import "stdio.h": functions (including variadic), enum values, numeric#defines and globals, read through libclanglink "glfw": uses pkg-config when available; a forgottenlinkgets a precise suggestion
Performance
- LLVM O2 pipeline, native code, no GC. Recursive
fib(40): about 0.19 s (clang -O2on the same C: about 0.23 s)
Docs
Three guides, in English and Polish: beginners, technicians and engineers (full compiler internals). Start at the README.
Requirements
Linux x86-64, LLVM 21, libclang, CMake, Ninja. nix-shell sets everything up.