Quick Start
Your First Kode Program
Create a file named hello.kode:
bash
echo 'print("Hello, Kode!")' > hello.kodeRun It
bash
kode hello.kode
# Hello, Kode!Compile to Bytecode
bash
kode build hello.kode # produces hello.kbc
kode hello.kbc # run the bytecodeMore Examples
Variables and Functions
kode
let name = "Kode"
let version = 3
func greet(lang: string) {
print("Hello from ${lang}!")
}
greet(name)For Loop
kode
for (let i = 0; i < 5; i++) {
print(i)
}
// Output: 0 1 2 3 4Functions and Recursion
kode
fn factorial(n: int) = if (n <= 1) { 1 } else { n * factorial(n - 1) }
print(factorial(5)) // 120