Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What Flint Is

Flint is a portable, memory-safe systems programming language that compiles directly to machine code for targets such as ARM, RISC-V, x86-64, and WebAssembly.

The project starts with microcontrollers because they are where the tradeoffs are harshest. Toolchains are often large, setup is fragile, memory is limited, and the gap between “hello world” and “works on real hardware” is wider than it should be. Flint tries to narrow that gap.

Design Goals

Flint is built around a few strong constraints:

  • Keep the language small enough to learn quickly.
  • Keep mutation explicit everywhere.
  • Keep the toolchain self-contained.
  • Keep the generated program close to the hardware.
  • Keep the language readable for humans and predictable for agents.

What Flint Looks Like

Flint favors direct syntax and visible effects:

use micro/gpio
use time/delay

fn main() {
    let builtin_led = gpio.builtin_led()
    if builtin_led.is_none() {
        return
    }

    if let Option.Some(led) = builtin_led {
        loop {
            led.toggle()
            delay.millis(500)
        }
    }
}

The important ideas are visible in the surface syntax:

  • let creates an immutable binding.
  • mut marks mutation explicitly.
  • use imports a module.
  • return is always explicit.
  • and, or, and not are the logical operators.
  • Ownership and moves are part of the language, but there is no & or &mut syntax in safe code.
  • Optional hardware capabilities can be handled explicitly with a guard plus if let, or with match.

Current Status

Flint is in active development. The current compiler pipeline is functional end to end: lexer, parser, type checker, FIR lowering, ARM Thumb-2 code generation, ELF output, and UF2 output for RP2040.

That means Flint already works as a real compiler project, even though large parts of the language, hardware library surface, and target matrix are still being filled in.