Static typing Compiled execution Python-like readability Performance-focused runtime

# Klyn Language Documentation

Klyn is a statically typed language designed to keep source code compact without sacrificing explicit structure, predictable typing, or fast execution. This documentation is split in two: a serious tutorial for learning the language, and an API reference for exploring the standard library in detail.

Choose Your Entry Point

### Tutorial

Start here if you want to learn Klyn syntax, typing rules, control flow, classes, generics, exceptions, and the standard collection literals in a coherent order.

### API Reference

Browse the generated reference for packages, types, members, and examples from the standard library. Use this once you know the language basics and need precise library details.

### Quick Start

If you already know typed languages, jump straight to the first runnable Klyn script and the execution model.

What Klyn Looks Like
A complete example

    const LIMIT as Int = 5

    def describe(value as Int) as String:
        return "small" if value < LIMIT else "large"

    class Counter:
        public property current as Int = 0

        public tick() as Void:
            this.current++

    counter = Counter()
    while counter.current < LIMIT:
        counter.tick()

    print(describe(counter.current))

Core rules to remember

- Klyn is always typed. Inference is common, but the inferred type stays fixed.
- Only the `klyn` package is imported by default. Other packages or qualified types must be imported explicitly.
- Imports belong at module level. You do not import packages inside a function or a class.
- Blocks start after `:` and use spaces for indentation. Tabs are rejected.
- Public top-level types follow their package path and file name strictly.

Suggested Learning Path

### 1. Foundations

Start with Getting Started, Lexical Structure, and Packages and Imports, then Coding Conventions.

### 2. Core Syntax

Learn Typing, Expressions, Statements, and Functions.

### 3. Types and OOP

Continue with Classes, Properties, Inheritance, Generics, and Exceptions.

### 4. Advanced Topics

Finish with SQL Database Access, ORM and Entities, LLM API and Agents, Reflection, and KAR and KAB Archives.