Quickstart
This walkthrough gets you from an installed runtime to a real .kel file with
functions, locals, and output. If kelvra --version does not work yet, follow
Install Kelvra first.
First Program
Section titled “First Program”Create a file named hello.kel:
fn applyTwice(f fn(i32) i32, value i32) i32 { return f(f(value))}
var addOne = fn(x i32) => x + 1
print(applyTwice(addOne, 40))Run it:
kelvra run hello.kelWhat This Shows
Section titled “What This Shows”- Named function declarations
- Function types in parameter position
- Local type inference with
var - Expression-bodied lambdas
print(...)output through the runtime
Next Sample
Section titled “Next Sample”Kelvra already supports structs, methods, and inferred locals:
type Counter struct { value i32
fn reset() { this.value = 0 }}
fn buildCounter() Counter { var counter = Counter() counter.reset() return counter}
var current = buildCounter()print(current.value)Where To Go Next
Section titled “Where To Go Next”- Read Values and Bindings and Control Flow for the core language model.
- Read Collections, Functions and Closures, and Types and Inheritance for the day-to-day language surface.
- Read Modules and Imports and Using Native Packages when the program stops being single-file.
- Read CLI and Debug Flags and VS Code and LSP when you want the surrounding tooling.