Skip to main content
Kira

Design Philosophy

Kira is a functional programming language built around three core principles:

  1. Explicit Types: Every binding must have a type annotation. No type inference.
  2. Explicit Effects: Side effects are tracked and visible in function signatures.
  3. No Surprises: One obvious way to do things, predictable behavior.

Why Explicit?

Kira is designed for clarity and predictability, making it ideal for:

  • AI code generation — explicit types make generation more reliable
  • Teams that value readable, self-documenting code — no hidden behavior
  • Applications where side effect tracking matters — I/O boundaries are clear

Explicit Types

In most languages, type inference means you often need to trace through multiple files to understand what a variable holds. In Kira, every binding declares its type:

let x: i32 = 42
let name: string = "Alice"
fn add(a: i32, b: i32) -> i32 { return a + b }

This eliminates ambiguity. When reading code, you immediately know the type of every value.

Explicit Effects

Most languages don't distinguish between functions that perform I/O and functions that don't. In Kira, this distinction is first-class:

// Pure — guaranteed no side effects
fn double(n: i32) -> i32 {
    return n * 2
}

// Effect — can perform I/O
effect fn greet(name: string) -> void {
    std.io.println("Hello, " + name)
}

The compiler enforces this: pure functions cannot call effect functions. This means you can trust that a pure function is truly pure.

No Surprises

Kira eliminates common sources of confusion:

  • No null — use Option[T] instead
  • No exceptions — use Result[T, E] instead
  • No implicit conversions — all conversions are explicit
  • No undefined behavior — predictable semantics throughout
  • Keyword-based logicand, or, not instead of &&, ||, !
  • One way to do things — consistent syntax patterns

Comparison with Other Languages

AspectTraditional LanguagesKira
Type AnnotationsOften optional/inferredAlways explicit and required
Side EffectsHidden, implicitTracked in type system
Syntax FlexibilityMultiple ways to do the same thingOne obvious way
Error HandlingExceptions, nullResult[T, E] and Option[T]
Default BehaviorPure or impure (unclear)Pure by default; effects opt-in