Skip to content

Finch 1.0.0

Choose a tag to compare

@Nexoniarz Nexoniarz released this 08 Oct 16:21
· 84 commits to main since this release

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 = 5 variables
  • Types: int, float, bool, char, str; sized i8…i64, u8…u64, f32, f64; pointers ptr[T] with addr(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 == 0 means (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 / -1 and .value on null stop 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 libclang
  • link "glfw": uses pkg-config when available; a forgotten link gets a precise suggestion

Performance

  • LLVM O2 pipeline, native code, no GC. Recursive fib(40): about 0.19 s (clang -O2 on 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.