English | Türkçe | Русский | 日本語 | 简体中文 | 한국어 | Français
Self-Hosting x86_64 Compiler • Direct PE32+ & ELF64 Codegen (No LLVM / No C-Runtime) • Multi-Lingual Syntax • Experimental Self-Healing & Embedded AI
Benchmarks • Download & Quick Start • Documentation • AI Layer (Experimental) • Architecture • YknOS • Honest Boundaries • Ecosystem
Yukinary (YKN) is an independent, self-hosting systems programming language and native compiler. Rather than targeting LLVM IR or transpiling to C, Yukinary lowers its AST directly to standalone x86_64 machine code—writing PE32+ (Windows) and ELF64 (Linux) binary headers, syscalls, and opcodes from scratch with zero external runtime dependencies (libc, msvcrt, or external linkers).
- Bit-Identical Self-Hosting: The compiler (written in Yukinary) compiles itself deterministically (
Stage 2 SHA-256 == Stage 3 SHA-256). - Canonical + Educational Multi-Lingual Syntax: Keywords can be written in English, Turkish, Russian, Japanese, Simplified Chinese, Korean, or French—designed for localized programming education, with
ykn fmtcurrently handling layout formatting and canonical keyword/comment translation planned as future tooling. - Freestanding Systems & OS Target: Powers an experimental Linux-based OS userspace (
examples/yknos).
All benchmark harnesses, C/Rust/Python competitor implementations, and raw JSON telemetry are published in our dedicated benchmark repository:
Official Benchmark Suite: github.com/ykncode/benchmarks • Industrial Benchmark Report (TR)
| Benchmark | Yukinary (ykn) |
C (gcc -O3) |
Rust (rustc -O3) |
Python (3.13) |
Notes |
|---|---|---|---|---|---|
Compiler Build Time (optimizer) |
18.6 ms | 219.4 ms | 272.2 ms | — | Zero LLVM/linker overhead (11x–31x faster builds) |
| Systems B-Tree (100k nodes, 50k search) | 213 ms | 133 ms | 221 ms | 327 ms | Exact verified checksum (19526 / 6363996222) |
| BitNet b1.58 (3.35 GOP ternary kernel) | 0.71 GOP/s | 1.79 GOP/s | 1.74 GOP/s | 0.02 GOP/s | Scalar native codegen (GCC/Rust use LLVM/GCC AVX2) |
| Peak Memory (BitNet RSS) | 2.6 MB | 4.8 MB | 5.2 MB | 22.4 MB | Lowest footprint (freestanding, zero libc) |
| Cold-Start Latency | 5.4 ms | 5.9 ms | 6.8 ms | 35.0 ms | Direct OS entry point (ExitProcess / sys_exit) |
Engineering Note: C (
gcc -O3) and Rust (rustc -O3) remain ~2.5x faster on dense matrix arithmetic due to GCC/LLVM auto-vectorization (SIMD AVX2). Yukinary relies on a custom scalar x86_64 encoder with linear-scan register allocation, prioritizing instant compilation, small zero-libc footprint, and zero external toolchain dependencies. Browse all source workloads inykncode/benchmarks.
You do not need a C++ compiler or external toolchain to run Yukinary. Standalone native binaries are available in Releases:
Download Yukinary from GitHub Releases
- Download
yukinary-setup-windows-x86_64.zipfrom Releases and extract it. - Double-click
setup.cmd(or runpowershell -ExecutionPolicy Bypass -File setup.ps1).
- Download
yukinary-setup-linux-x86_64.tar.gzand extract it (tar -xzf yukinary-setup-linux-x86_64.tar.gz). - Run
./setup.sh.
code --install-extension yukinary-lang-1.0.0.vsix# English syntax (canonical keywords; native stdio intrinsic: ekrana_yaz)
fn main() -> i64 {
ekrana_yaz("Hello, Yukinary!\n".ptr);
return 0;
}
Compile directly to native Windows PE32+ or Linux ELF64 machine code:
# Windows PE32+
ykn hello.ykn hello.exe
.\hello.exe
# Linux ELF64 cross-compile from Windows or native Linux
ykn --target linux hello.ykn helloDeveloper guides and syntax references are available across supported spoken languages:
| Language | File | Description |
|---|---|---|
| English | docs/guide_en.md |
Developer Guide, Syntax Reference, #convert Engine, Architecture, and Tooling |
| Türkçe | docs/kullanim_rehberi_tr.md |
Türkçe Kullanım Kılavuzu, sözdizimi, #convert, Micro-LLM ve FFI motoru |
| Русский | docs/guide_ru.md |
Руководство разработчика, многоязычный синтаксис, #convert и архитектура |
| 日本語 | docs/guide_ja.md |
開発者ガイド、日本語ネイティブ構文、#convert変換、自己修復機能 |
| 简体中文 | docs/guide_zh.md |
开发者完全指南、原生中文语法、#convert多语言转译与嵌入式 AI |
| 한국어 | docs/guide_ko.md |
개발자 가이드, 한국어 네이티브 문법, #convert 변환 엔진 및 메모리 안전성 |
Tip
Localization Design Note: Multi-lingual keywords use dynamic lexer token mappings (docs/Multi-lingual-add-language.md) to lower the barrier for students and non-English speakers. For collaborative open-source packages, English is recommended as the canonical standard.
Yukinary integrates experimental neural tooling into the compilation pipeline through two distinct layers:
┌────────────────────────────────────────────────────────────────────────┐
│ YUKINARY AI ENGINE ARCHITECTURE │
└────────────────────────────────────────────────────────────────────────┘
│
┌──────────────────────────┴──────────────────────────┐
▼ ▼
┌───────────────────────────────────┐ ┌───────────────────────────────────┐
│ 1. EMBEDDED MICRO-LLM │ │ 2. EXTERNAL FULL LLM │
│ (Always-On) │ │ (On-Demand) │
├───────────────────────────────────┤ ├───────────────────────────────────┤
│ * std/ai/micro_llm.ykn │ │ * src/llm.ykn │
│ * std/ai/embedded_weights.ykn │ │ * std/ai/gguf_loader.ykn │
│ • Size: 16,448 Bytes (~16 KB) │ │ • Size: 1 GB – 40 GB GGUF v3 │
│ • Baked into binary (.rodata) │ │ • Loaded dynamically from disk │
│ • Zero files, zero internet, │ │ • CLI: `--llm-model model.gguf` │
│ zero external dependencies │ │ • Polyglot `#convert` Engine │
│ • Sub-millisecond latency (<1ms) │ │ (Deep semantic library trans- │
│ • Purpose: Compiler Reflexes, │ │ pilation: C/C++/Python/Rust) │
│ Self-Healing, LSP Autocomplete, │ │ • Natural language `#prompt "..."`│
│ Offline signature fallback │ │ algorithmic code synthesis │
└───────────────────────────────────┘ └───────────────────────────────────┘
| Dimension | Embedded Micro-LLM (16 KB) | External Full LLM (1B – 70B GGUF) |
|---|---|---|
| Location & Storage | Baked directly into the compiler binary (.rodata section) |
External .gguf file loaded dynamically from user storage |
| Size & Weights | 16,448 Bytes (~16 KB) ternary {-1, 0, +1} BitNet weights |
1 GB – 40 GB (BitNet b1.58, Llama-3, Mistral, Qwen, etc.) |
| Hardware Reqs | Zero GPU, Zero Python, Zero Internet. Runs on any 64-bit CPU using Q16.16 fixed-point math | Requires 4 GB – 32 GB RAM / VRAM depending on quantization and context size |
| Inference Latency | Sub-millisecond (< 1 ms) — minimal compile-time overhead | 10 – 50 milliseconds per token |
| Primary Scope | Compiler Reflexes & Tooling: • Syntax & typo repair ( --self-heal: semicolons, parens)• Defensive null-guard injection against crashes• Real-time LSP struct field and token autocompletion • Lightweight offline keyword/signature fallback |
Experimental Generative Tooling: • Polyglot #convert: Assisting translation of C, Python, and Rust snippets into YKN• Natural language prompt directives ( #prompt "...") |
| Activation Mode | Always-On (no external model required) | Opt-In via --llm-model <path.gguf> |
Yukinary compiles code out-of-the-box with zero model downloads. When testing heavyweight #prompt or #convert workflows, you can point the compiler to standard GGUF models hosted on Hugging Face.
# Windows (PowerShell)
powershell -File tools/download_models.ps1 bitnet # Microsoft BitNet b1.58 (1.18 GB)
powershell -File tools/download_models.ps1 bonsai # Prism ML Bonsai 8B (1.15 GB)
powershell -File tools/download_models.ps1 all# Linux / macOS (Bash)
sh tools/download_models.sh bitnet
sh tools/download_models.sh bonsai
sh tools/download_models.sh all| Model | Size | Format | Direct Download Link | Target Local Path |
|---|---|---|---|---|
| Microsoft BitNet b1.58 2B4T | 1.18 GB | GGUF (i2_s) | Download from Hugging Face | models/bitnet-b1.58-2B-4T/ggml-model-i2_s.gguf |
| Prism ML Bonsai 8B | 1.15 GB | GGUF | Download from Hugging Face | models/bonsai-8b/Bonsai-8B.gguf |
#config {
model: "bitnet", # Loads 'models/bitnet-b1.58-2B-4T/ggml-model-i2_s.gguf'
optimizasyon: 3, # Enable O3 loop and register optimization
yigin_boyutu: 16777216, # 16 MB stack size stamped into binary headers
guvenli: true # Enable compile-time bounds checking
}
#PY-convert
def multiply(a, b):
return a * b
#end-convert
isv ana() -> tamsayi {
degisken res: tamsayi = multiply(6, 7);
dondu 0;
}
ykn main.ykn# Compile with #prompt Generative Directives
ykn main.ykn --llm-model models/bitnet-b1.58-2B-4T/ggml-model-i2_s.gguf
# Translate a Python file into Yukinary
ykn convert math_helper.py -o math_helper.ykn --llm-model models/bitnet-b1.58-2B-4T/ggml-model-i2_s.gguf
# Experimental self-healing syntax repair (uses embedded 16 KB engine)
ykn main.ykn --self-heal- Emits standalone executables directly from the AST without LLVM, C transpilation, or external linkers.
- Windows PE32+ binaries invoke Kernel32 / NT calls directly (
VirtualAlloc,WriteFile,ExitProcess). - Linux ELF64 binaries invoke raw 64-bit syscalls (
sys_mmap,sys_write,sys_exit).
Keywords are mapped dynamically at the lexer stage:
# Turkish
isv topla(a: tamsayi, b: tamsayi) -> tamsayi { dondu a + b; }
# English
fn add(a: i64, b: i64) -> i64 { return a + b; }
# Russian
функция сумма(а: целое, б: целое) -> целое { вернуть а + б; }
# Japanese
関数 合計(a: 整数, b: 整数) -> 整数 { 戻す a + b; }
# Chinese
函数 求和(a: 整数, b: 整数) -> 整数 { 返回 a + b; }
# Korean
함수 합계(a: 정수, b: 정수) -> 정수 { 반환 a + b; }
- Direct FFI (
harici isv): Invoke compiled C/C++/Rust shared libraries (.dll/.so) via OS dynamic loaders (LoadLibraryA/dlopen). - Convert Directives (
#C-convert,#PY-convert,#JS-convert): Experimental transpilation blocks cached with SHA-256 in.ykn_cache/convert/.
Supports variants with and without payloads using 16-byte aligned { discriminant, payload } representations:
enum Result {
Success(tamsayi),
Failure(tamsayi),
Pending
}
isv process(r: Result) -> tamsayi {
esles r {
Result.Success(val) => { dondu val; }
Result.Failure(err) => { dondu 0 - err; }
Result.Pending => { dondu 0; }
}
}
Tune OS binary headers, stack allocations, and target flags directly from source:
#config {
yigin_boyutu: 16777216, # 16 MB Stack stamped into PE32+/ELF headers
is_parcacigi: 8, # Worker pool capacity
bellek: "arena", # Default memory allocator
islemci: "native" # Target microarchitecture
}
- Automatic Snapshots: Creates a
.baksnapshot before applying repairs. - Typo & Punctuation Healing: Repairs misspelled keywords and missing semicolons via Levenshtein matching.
- Null-Guard Injection: Injects protective guards (
if ptr != null) around unguarded dereferences. - Compile Verification Gate: Patches must pass compilation before touching source on disk.
- Tracks pointer lifetimes and deallocations statically.
- Dereferencing a freed pointer triggers a compile-time diagnostic to catch Use-After-Free patterns before execution.
Restricts untrusted scripts at the AST level from invoking unauthorized OS APIs (CreateProcess, socket, send, LoadLibrary, dlopen).
Loop induction variables are assigned directly to callee-saved machine registers (RBX, R12..R15), avoiding redundant stack traffic.
The compiler compiles itself cleanly; Stage 2 and Stage 3 binaries produce 100% bit-for-bit identical SHA-256 hashes:
EF607B9A47F8586970C7F7C68404B96BF7E58B1C2BC6B25C51DA280522B4A225
Because Yukinary compiles directly to unmanaged, zero-dependency 64-bit machine code, it is designed for:
- CLI Tools & Compilers: Fast build iteration and sub-megabyte executables (
src/itself is self-hosted in Yukinary). - Network Services: Low-level async primitives (
std/ag/http.ykn, Windows IOCP, Linuxio_uring/epoll). - Storage Engines: B-Tree indexing (
std/veritabani/b_tree.ykn), Write-Ahead Logging (wal.ykn), and vector indexing (hnsw.ykn). - Embedded Fixed-Point Inference: Q16.16 integer inference and GGUF v3 parsing (
std/ai/) without Python or PyTorch. - Embedded Systems & Bare-Metal Targets: Direct pointer access without C-runtime dependencies.
Because Yukinary emits freestanding x86_64 code without relying on libc, it can target bare-metal environments and OS userspaces directly:
- Inside
std/os/kernel_real/, a minimal proof-of-concept Ring-0 x86_64 kernel implements Multiboot2 entry (boot.asm), GDT (gdt.ykn), IDT (idt.ykn), PML4 paging (paging.ykn), COM1 serial UART, and VGA text output. - Inside
examples/yknos/, Yukinary powers a working Linux 6.6 LTS + Alpine musl + YKN ELF64 Userspace system (ykn-initPID 1 supervisor,yknshshell,yukiCLI) bootable in QEMU.
- Deterministic Bit-Identical Fixpoint: Stage 2 and Stage 3 self-hosted binaries match bit-for-bit (
EF607B9A...). - Zero External Dependencies: Executables run on stock Windows (Kernel32) and Linux (raw syscalls) with zero external DLLs or shared libraries.
- Measured Performance Transparency: Full source benchmarks against GCC, Rustc, Go, and CPython are published openly in
ykncode/benchmarks.
- Experimental Status: Yukinary is a v1.0.0 systems research compiler built by a solo developer. It has not accumulated the decades of edge-case hardening that GCC, Clang, or Rust possess. Do not deploy it in safety-critical or financial production systems.
- Dense Auto-Vectorized Math: Because Yukinary uses a custom scalar x86_64 backend without LLVM SIMD AVX2 auto-vectorization, C (
-O3) and Rust (opt-level=3) remain faster (~2.5x) on heavy floating-point or matrix loops. - Native Mobile UI: There are currently no native UI bindings for iOS UIKit/SwiftUI or Android Jetpack Compose.
Distributed under the MIT and Apache 2.0 licenses, provided "AS IS", WITHOUT WARRANTY OF ANY KIND.
┌────────────────────────────────────────────────────────────────────────┐
│ YKNCODE GITHUB ECOSYSTEM │
└────────────────────────────────────────────────────────────────────────┘
│
┌───────────────────┬───────────┴───────────┬───────────────────┐
▼ ▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ ykncode/ │ │ ykncode/ │ │ ykncode/ │ │ ykncode/ │
│ yukinary │ │ packages │ │ bootstrap │ │ benchmarks │
├──────────────┤ ├──────────────┤ ├──────────────┤ ├──────────────┤
│ • Pure YKN │ │ • Package │ │ • C++17 seed │ │ • C, Rust, │
│ Compiler │ │ Registry │ │ for initial│ │ Go, Python │
│ • src/ & std/│ │ • Community │ │ bootstrap │ │ workloads │
│ • docs/ & │ │ libraries │ │ • Porting │ │ • Compile & │
│ examples/ │ │ • ykn add │ │ targets │ │ cold-start │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
ykncode/yukinary: Self-hosting Yukinary compiler, standard library, documentation, and YknOS Linux userspace example.ykncode/benchmarks: Industrial performance comparisons, compile-time telemetry, and competitor workloads (C, Rust, Go, Python).ykncode/packages: Package registry for modular libraries (net/http,math,crypto/sha256,data/json,terminal/colors).ykncode/bootstrap: Standalone C++17 seed compiler for bootstrapping Yukinary from scratch on new machines.
Yukinary is dual-licensed under either the MIT License or the Apache License (Version 2.0), at your option:

