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:
fidis the compiler (written in Fid).fid emitwrites a native executable with no other tools: a Windows.exeby default, or a static Linux executable with--target x86_64-linux(partly tested).fid buildon Linux goes through C and needs a C compiler (gcc, clang,zig ccor 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}");
}valdeclares an immutable binding,vara mutable one. Types are inferred.for i in 1..=100iterates an inclusive range.f"..."is an f-string, part of the language.
Run it
The interpreter needs no other tools:
fid run hello.fdCompile 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 compilerfid 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.