Skip to main content

Kyna documentation

Kyna is a statically typed programming language with a native CLI, an inspectable compiler pipeline, and two execution paths: bytecode and a tree-walk compatibility engine.

Preview status

Kyna is under active development. Check the implementation status before using it in production.

Install​

Install the current preview from the official npm organization:

npm install --global @kyna-language/cli@preview
ky --version

The installer supports macOS and Linux on x64/ARM64, and Windows on x64.

Use Bun or install directly

Allow Bun to run the checksum-verified native installation step:

bun add --global --trust @kyna-language/cli@preview

Install directly on macOS or Linux without Node.js:

curl -fsSL https://github.com/Up-to-code/Kyna/releases/download/v1.0.0-preview.3/install.sh | sh -s -- --channel preview --version 1.0.0-preview.3

Install directly with Windows PowerShell:

& ([scriptblock]::Create((irm 'https://github.com/Up-to-code/Kyna/releases/download/v1.0.0-preview.3/install.ps1'))) -Channel preview -Version 1.0.0-preview.3

The Bun package path currently requires Node.js 18+ for the command shim. The direct installers do not require Node.js.

First program​

Create hello.kyna:

fn greet(name: str): str {
return "Hello, " + name;
}

const language = "Kyna";
print(greet(language));

Run it:

ky run hello.kyna

Check it without executing:

ky check hello.kyna

Core ideas​

Types are explicit when they matter​

Kyna can infer simple types, while annotations document and enforce public contracts. Types are non-nullable by default; add ? when a value may be null.

var nickname: str? = null;

Mutability is visible​

Use var for a binding that can change and const for one that cannot.

var attempts = 0;
attempts = attempts + 1;

const limit = 3;

Compiler stages are inspectable​

The ky CLI exposes the compilation pipeline instead of hiding it:

StageCommand
Tokensky tokens app.kyna
Syntax treeky ast app.kyna
Type checkingky check app.kyna
HIRky hir app.kyna
MIRky mir app.kyna
Bytecodeky bytecode app.kyna
Executionky run app.kyna

Choose your next step​

GoalRead
Install Kyna and create a projectGetting started
Learn the language in orderLanguage tour
Understand bindings and typesVariables and types
Organize multiple filesModules and packages
Find exact language behaviorLanguage reference
Copy a complete patternExamples