Skip to content

Kinal-Lang/Kinal

Repository files navigation

English | 简体中文

Kinal

Kinal

A compiled language with native control and modern ergonomics

Docs | Installation | Quick Start | Language Overview | CLI Reference


Kinal was born from dissatisfaction with the trade-offs made by existing languages.

We don't accept "sacrifice ergonomics for performance", and we don't accept "give up low-level control for ease of use".

Kinal's goal is simple -- provide genuine native control and cross-platform capability, with clear and intuitive syntax.


Core Features

  • Statically typed -- compile-time type checking with Var inference for concise, safe code
  • Three-tier safety -- Safe / Trusted / Unsafe precisely bound dangerous operations
  • Native OOP -- classes, interfaces, virtual methods, generics, with clean syntax
  • Dual backends -- LLVM native compilation and KinalVM bytecode, same code both ways
  • Block objects -- a unique suspendable code-block mechanism with Record labels and Jump transfers
  • First-class async -- Async/Await with a built-in event loop
  • C interop -- zero-overhead Extern/Delegate calls into C libraries
  • Meta annotations -- custom attribute system queryable at compile time or runtime
  • Complete toolchain -- compiler, VM, formatter, package manager, LSP server

Quick Start

Installation

Option 1: use the install script (recommended, it handles the toolchain layout and PATH setup for you)

curl -sSL https://kinal.org/install.sh | bash

Option 2: install manually

Download the pre-built package for your platform from Releases and place kinal (and optionally kinalvm) on your PATH.

Then verify the installation:

kinal --version

Your First Program

Create hello.kn and run:

kinal run hello.kn

Repository Layout

Kinal/
apps/  kinal/ kinal-lsp/ kinalvm/
libs/  runtime/ std/
docs/  zh-CN/
dev/
tests/
infra/

Building from Source

Requirements: Python 3.10+ CMake 3.20+ Ninja LLVM/Clang

python x.py fetch llvm-prebuilt
python x.py dev
python x.py test
python x.py release

See Build Guide for details.


Documentation

English Chinese
User docs docs/ docs/zh-CN/
Developer docs dev/ dev/zh-CN/

Toolchain

Tool Description
kinal build Compile to native executable, object file, assembly, or LLVM IR
kinal run Compile and run immediately
kinal vm build/run/pack KinalVM bytecode build, run, and pack
kinal fmt Code formatter
kinal pkg build/info/unpack Package management
kinal-lsp LSP server for editor completion and diagnostics

Editor Support

Kinal has an official VS Code extension.

Extension source: Kinal-Lang/Kinal-VSCode


Diagnostic Localization

kinal build --lang en main.kn
kinal build --lang zh main.kn

License

This project is open source under the MIT License.

About

A compiled language with native control, modern syntax, and LLVM + VM backends.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors