Hopper
Basics

Functions

Give a function a name, parameters, and an optional return type.

src/main.hop
fn main() -> i32 {
    return Sum(20, 22);
}

fn Sum(left: i32, right: i32) -> i32 {
    return left + right;
}
terminal

hopper run demo src

A function can call another function in the same module before its declaration. Use void for a function that returns no data.