Skip to content

Functions

Bean Pringles edited this page Dec 11, 2025 · 2 revisions

Functions are declared with the keyword "fn"

There are two types, returning and non-returning.

Returning

Returning functions have a "-> " at the end, so they look like:

fn testFunc() -> int {}

These functions are compiled into an "int" function in C, looking like:

int testFunc() {}

Non-returning

Returning functions do not have a "->" and are compiled down to "void"

fn testFunc() {}

These functions in C are:

void testFunc() {}

Clone this wiki locally