Skip to content

Finch 2.5.0

Latest

Choose a tag to compare

@Nexoniarz Nexoniarz released this 29 Oct 11:38
· 10 commits to main since this release

Finch 2.5.0 answers a long list of feedback from building a game with SDL3, miniaudio and Box2D.

Language

  • "hp \(hp), speed \(v, 2)": code inside text (, 2 = two digits after the point)
  • const, if as a value, """ text over several lines, 1e9 literals
  • test "name" { assert(...) } blocks next to the code, run with finch test
  • min, max, abs, clamp for any numbers
  • a struct variable passed where ptr[T] goes: push(body) is push(addr(body))
  • warnings for big hidden copies (a struct with 256+ bytes of numbers as a parameter or in for x in list)
  • fixes: struct defaults inside structs, exit() in or { }, x * 2.0 stays f32, floats print as the shortest exact text

C, C++ and the rest

  • C unions (SDL_Event) and their fields; #defines that are expressions, casts, text, or structs (raylib's RAYWHITE)
  • static inline C functions (header-only helpers, MinGW's printf)
  • link "glue.cpp": C++ files built and linked with the C++ compiler; Rust through a staticlib and a C header (see the guide)

Tools

  • finch.toml: entry, module and header folders, libraries, flags, and settings per system; finch run with no file
  • a build cache: the program's object and its link "x.c" files are reused until they or their headers change
  • runtime errors show the chain of calls that led there (run, test, -g, -O0, --trace)
  • finch fmt (and Format Document in editors)
  • modules: import ui/button, import ui/button as btn; modules are known by their file

Library

  • import thread: spawn, join, mutex, cpus; atomic_add/sub/load/store/swap/cas built in
  • import fs: read/write bytes, exists, is_dir, mkdir, list, remove_dir, data_dir

Systems

  • --target android (new: Finch's output compiles for Android; linking with the NDK and running on a device are not tried yet)
  • CI is green again on Linux x64/ARM64, macOS, Windows and the cross tests (it had been failing since 2.4's last merge)

Docs (English and Polish) and the Kate and VS Code support are updated for all of it.