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.
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:
| Stage | Command |
|---|---|
| Tokens | ky tokens app.kyna |
| Syntax tree | ky ast app.kyna |
| Type checking | ky check app.kyna |
| HIR | ky hir app.kyna |
| MIR | ky mir app.kyna |
| Bytecode | ky bytecode app.kyna |
| Execution | ky run app.kyna |
Choose your next step
| Goal | Read |
|---|---|
| Install Kyna and create a project | Getting started |
| Learn the language in order | Language tour |
| Understand bindings and types | Variables and types |
| Organize multiple files | Modules and packages |
| Find exact language behavior | Language reference |
| Copy a complete pattern | Examples |