Skip to content

Docs/Getting Started/Quick Start

Quick Start

Install the toolchain and go from an empty file to a running native binary in minutes.

~1 min read

On this page

Install

On Windows, run the installer or build from source. On Linux, build from source.

Good to know: fid is the compiler (written in Fid). fid emit writes a native executable with no other tools: a Windows .exe by default, or a static Linux executable with --target x86_64-linux (partly tested). fid build on Linux goes through C and needs a C compiler (gcc, clang, zig cc or tcc).

Your first program

Create hello.fd:

fn main() {
    val name = "world";
    var total = 0;

    for i in 1..=100 {
        total += i;
    }

    println(f"Hello, {name}! total = {total}");
}
  • val declares an immutable binding, var a mutable one. Types are inferred.
  • for i in 1..=100 iterates an inclusive range.
  • f"..." is an f-string, part of the language.

Run it

The interpreter needs no other tools:

fid run hello.fd

Compile it to a native binary

fid emit hello.fd -o hello.exe     # Windows: machine code written by fid itself
fid build hello.fd -o hello        # Linux: through your C compiler

fid ccompile hello.fd -o hello goes through C on any platform. Native code is slower than code built through C today (see Backends).

Next steps

Continue to Syntax & Keywords, or see the CLI Reference for every command.

Report an issue