Skip to content

Learn Flecha

This guide assumes you have built the compiler. Flecha files use the .fl extension, and an executable entry module defines either i32 main() or void main().

hello.fl
void main() {
stdoutln("Hello from Flecha");
}
Terminal window
build/flecha check hello.fl
build/flecha build hello.fl -o build/hello
./build/hello

check runs the frontend without creating an artifact. build emits and links a native executable.

Return types appear before function names. := infers a local variable’s type.

i32 square(i32 value) {
return value * value;
}
void main() {
answer := square(7);
stdoutln(answer);
}

Checked references and slices can be used in safe code. Raw pointers and raw allocation require an explicit unsafe context. Ownership contracts and definite-assignment checks help the compiler reject invalid resource flows.

Terminal window
build/longbow new hello
cd hello
../build/longbow check
../build/longbow run

Continue with modules and package layout, then explore the examples and language specification.