A compiled programming language with Korean keywords, written in Rust
A compiled programming language with Korean keywords, written in Rust
A general-purpose compiled language with Korean keywords, types, built-ins, and standard library — written in Rust
Museum as Code (live site) — the National Museum of Korea rebuilt with Han. 56 catalog entries and 10 hero pages are real .hgl source files; every code block on the site runs unchanged in hgl interpret. The flagship demonstration that Korean-as-syntax scales beyond hello-world to a full content site.
Han is not just a programming language. It is an experiment with three goals:
1. Hangul is one of the most scientifically designed writing systems ever created Each character encodes the exact shape of the mouth and tongue used to pronounce it. Vowels are composed from three symbols: heaven (·), earth (ㅡ), and human (ㅣ). It was engineered for clarity, not inherited from history. Han asks: what does code look like when written in a script that was designed rather than evolved? (Invented 1443 — King Sejong)
2. Korean Code for the AI Age — BPE optimization
LLMs are trained on English-dominant data. BPE tokenizers treat Korean characters as rare, splitting 함수 into multiple byte-level tokens while function becomes one. The more Korean code exists on the internet — in repos, in documentation, in examples — the better future tokenizers will represent the Korean language. Han is a small contribution to that corpus.
3. Minority Language as First-Class Syntax Korean is spoken by ~80 million people, yet essentially zero programming languages use it as syntax. Han is an experiment: what happens when a minority language becomes the grammar of a compiler? How far can it go?
Han is a statically-typed, compiled programming language where keywords, type names, 50+ built-in functions, and standard library methods are written in Korean — with all error messages in Korean too. Arithmetic, comparison, and assignment operators follow C/Rust conventions. It compiles to native binaries through LLVM IR and also ships with a tree-walking interpreter for instant execution. The compiler toolchain is written entirely in Rust.
Install the Rust crate from crates.io. The package is named han-lang; the language is Han and the installed CLI command is hgl.
cargo install han-langCreate hello.hgl:
출력("안녕하세요, 세계!")Run it:
hgl interpret hello.hgl
# Output: 안녕하세요, 세계!Conditionals use the Korean-default 만약 조건 이면 { } form:
만약 x > 0 이면 {
출력("양수")
} 아니면 {
출력("0 또는 음수")
}Or jump into the REPL:
hgl repl
한> 출력("안녕!")
안녕!함수 계산(식: 문자열) -> 정수 {
변수 부분 = 식.분리(" ")
변수 왼쪽 = 정수변환(부분[0])
변수 연산자 = 부분[1]
변수 오른쪽 = 정수변환(부분[2])
맞춤 연산자 {
"+" => { 반환 왼쪽 + 오른쪽 }
"-" => { 반환 왼쪽 - 오른쪽 }
"*" => { 반환 왼쪽 * 오른쪽 }
"/" => { 반환 왼쪽 / 오른쪽 }
_ => { 반환 0 }
}
}
출력(계산("10 + 20")) // 30
출력(계산("6 * 7")) // 42…bash git clone https://github.com/xodn348/han.git cd han ./install.sh
This installs `hgl` globally and automatically sets up the VS Code extension (syntax highlighting + LSP) if VS Code is detected.
Alternatively from crates.io, install the published Rust package:
```bash
cargo install han-langThe crates.io package name is han-lang to avoid naming ambiguity. The language remains Han, and the command installed on your PATH remains hgl.
The default crates.io install is intentionally Python-free so hgl runs without requiring a local Python dynamic library. If you want Python interop built in, install with cargo install han-lang --features python.
hgl interpret Run with interpreter (no clang needed)
hgl build Compile to native binary (requires clang)
hgl run Compile and run immediately
hgl check Type-check only (no execution)
hgl init [name] Create new Han project
hgl repl Interactive REPL
hgl lsp Start LSP server (hover + completion)
…
bash
cargo testcargo test covers the lexer, parser, AST, interpreter, type checker, compiled backend, and integration scenarios such as closure capture, struct impl methods, tuples, and SOV parsing.
See CONTRIBUTING.md for development setup, branch conventions, and the PR checklist.
MIT
Han — where the beauty of Hangul meets the precision of code.
No open issues yet, or sync has not completed.