Kyna

Write and run strongly typed programs with Kyna’s compiler, CLI, and VS Code extension.

Account
qentrah
License
MIT
Technology
C++
Status
Preview
Loading video…
0:00 / 0:00

About Kyna

Write and run strongly typed programs with Kyna’s compiler, CLI, and VS Code extension.

  • A strongly typed programming language with a real compiler and CLI.
  • Preview packages for macOS, Linux, and Windows.
  • Language specification and VS Code extension available in the repository.
Original project page

Install & get started

Terminal
Shell
npm install --global @kyna-language/cli@preview
ky --version
ky new hello --template minimal
cd hello
ky run
Follow the installation guide

From the repository

Kyna

Loading video…
0:00 / 0:00
Watch Kyna run real code and catch a type error in the
Loading video…
0:00 / 0:00
, or watch it on TikTok.

Tags: Kyna · ProgrammingLanguage · Coding · Compiler · OpenSource · BuildInPublic · Developer

A small, strongly typed programming language with a real compiler and a practical CLI.

npm · Releases · Documentation · Language specification · VS Code

Install

Install the current preview from the official npm organization:

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

Other installation paths:

Bun, curl, and Windows PowerShell

Terminal
Shell
# Bun must be allowed to run the verified native-install step.
bun add --global --trust @kyna-language/cli@preview
 
# macOS or Linux without a package manager.
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
PowerShell
powershell
# Windows PowerShell without a package manager.
& ([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.

Each installer supports macOS and Linux on x64/ARM64, and Windows on x64. It downloads the matching native release, verifies its SHA-256 checksum, and provides both ky and kyna commands.

Create and run a project:

Terminal
Shell
ky new hello --template minimal
cd hello
ky run

Kyna is preview software. Read the implementation status and roadmap before using it in production.

The language

example.kyna
kyna
fn greet(name: str): str {
    return "Hello, " + name;
}
 
var visits: int = 1;
visits = visits + 1;
 
const audience = if (visits > 1) {
    "returning visitor"
} else {
    "new visitor"
};
 
console.log(greet("Kyna"), audience);

Kyna includes:

  • inferred or explicit static types, with nullable types written as T?;
  • mutable var and immutable const bindings;
  • arrays, objects, functions, closures, classes, and structural interfaces;
  • modules with explicit exports;
  • exhaustive match, switch, and typed error handling;
  • HIR, MIR, bytecode, and tree-walk execution paths.

Runnable examples live in examples/language/. For the complete syntax and behavior, read the language specification.

CLI

CommandPurpose
ky new / ky initCreate a project from a template
ky runRun a source file or project
ky checkType-check without running
ky fmtFormat source code
ky dev / ky serveDevelop or serve an HTTP backend
ky replOpen the interactive shell
ky doctorCheck the installation and environment
ky tokens, ast, hir, mir, bytecodeInspect compiler stages

ky hello.kyna is shorthand for ky run hello.kyna.

Architecture

Instructions
Plain text
source
  → lexer
  → parser / syntax tree
  → type checker
  → HIR
  → MIR
  → bytecode
  → virtual machine

The repository keeps compiler stages, runtime components, standard libraries, the embedding SDK, and developer tools in separate modules:

Instructions
Plain text
compiler/   lexing, parsing, types, checking, HIR, MIR, bytecode
runtime/    virtual machine, interpreter, and host capabilities
library/    core and standard-library modules
sdk/        embedding API
tools/      CLI and benchmarks
tests/      unit, integration, and architecture verification
docs/       specifications, research, and design records

Read the architecture guide, source-layout rules, and compiler research for the complete design.

Build from source

Requirements: CMake 3.25+, Python 3.10+, a C++23 compiler, and libcurl.

Terminal
Shell
git clone https://github.com/Up-to-code/Kyna.git
cd Kyna
cmake --preset debug
cmake --build --preset debug
ctest --preset debug

See CONTRIBUTING.md before changing the compiler or adding a language feature.

Documentation

Created and maintained by Ahmed Mansour with help from open-source contributors and coding agents.

Kyna is available under the MIT License.