// A SMALL, SELF-CONTAINED LANGUAGE

K.

K is a general-purpose language where variables, closures, classes, error handling, and matrix math are all built-in syntax — not a library you import. Source compiles to bytecode and runs on a stack-based VM: one binary, no interpreter to install, no package manager.

v1.1.0 · initial release
MIT licensed
Windows · macOS · Linux
LEXER PARSER COMPILER VM .k
// SPEC SHEET

What K borrows, and what it fixes

K's syntax will feel familiar if you've used Python, C++, or Java — each choice below is there to remove a specific piece of friction those languages carry.

01
Scripting languages
Tree-walking interpreters spend time re-resolving the same variable on every loop iteration
K compiles source to bytecode ahead of time — variable references are resolved to fixed stack slots at compile time, not looked up in a scope chain at runtime.
02
C-family languages
Manual memory management, undefined behavior, a crash on the first unhandled fault
No manual memory management — the VM manages memory for you, and every runtime error (a bad index, a missing key, division by zero) is a catchable value, not a crash.
03
Verbose OOP languages
Boilerplate to start a program, ceremony around types, multi-file class declarations
No boilerplate to start a script — top-level code just runs. Type annotations are optional and currently documentation-only. try / catch is a single clause.

Read this honestly: K is a real bytecode-compiled language today, not a prototype. Type annotations are parsed for readability and not yet enforced; a bigger standard library and package ecosystem are the next honest milestones, not "done."

// SYNTAX

Classes, closures, and matrix math — no imports required

Everything below is built-in language syntax, not a library.

dog.k
class Dog {
    fn init(name) { self.name = name; }
    fn speak() { return f"{self.name} says Woof!"; }
}
let d = new Dog("Rex");
print(d.speak());

let weights = [[0.8, -0.1], [0.4, 0.9]];
let inputs  = [[1.5, 0.2]];
print(relu(inputs @ weights)); // matrix multiply is a language operator, '@'
// DOWNLOAD

Get K running on your machine

v1.1.0 — built straight from the GitHub release. Each installer includes both the k CLI and the built-in GUI IDE.

Windows
K-Setup.exe installs the k CLI and IDE, adds them to PATH, and associates .k files.
K-Setup.exe · 24.22 MB
Download for Windows ↓
macOS
K-Installer.pkg installs the k CLI and IDE. Open the .pkg and follow the standard macOS installer prompts.
K-Installer.pkg · 2.73 MB
Download for macOS ↓
Linux
Debian/Ubuntu package. Install with sudo dpkg -i k-language_1.1.0-1_amd64.deb (or double-click in a graphical package manager).
k-language_1.1.0-1_amd64.deb · 3.89 MB
Download for Linux (.deb) ↓

Prefer to build from source? All installers above are built from release v1.1.0. K is written in Rust — clone the repo and build with Cargo:
git clone https://github.com/K-S-C/K.git && cd K && cargo build --release
Or grab the raw source: .zip · .tar.gz

// LEGEND

What's implemented today

The core language, its built-in methods, and matrix math are all documented in the repository README.

let / const

Bindings, with optional : type annotations kept as documentation.

fn name(a, b = 1) { }

Functions with default parameters, closures, and nested functions.

class Name(Parent) { }

Single inheritance, implicit self, init, and new.

if / elif / else

Standard branching, plus while and for x in iterable { }.

break / continue / return

Familiar control-flow escapes, including in nested loops.

try { } catch e { }

Runtime errors are catchable values — throw raises any K value.

f"{expr}"

String interpolation, plus ints, floats, true/false/null.

[1,2,3] / {"a":1}

Lists and dicts with indexing and built-in methods.

relu · sigmoid · softmax · @

Matrix multiply and elementwise ML activations as native builtins.

// ROADMAP

Honest next steps

Real static type checking

Turn the currently-decorative type annotations into an actual checker, or remove them from the grammar.

Standard library

File I/O, JSON, real math builtins, and collection helpers beyond the current core set.

Tooling

A formatter, a test runner, and editor support so K is comfortable to work in day to day.

Package manager

Usually where a language's real-world capability actually comes from.