Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Han (한) Programming Language

Han is a statically-typed, compiled programming language where every keyword is written in Korean (Hangul). It compiles to native binaries through LLVM IR and includes a tree-walking interpreter for instant execution.

Quick Example

함수 인사(이름: 문자열) {
    출력("${이름}님 안녕하세요")
}

인사("세계")

Output: 세계님 안녕하세요

Key Features

  • Korean keywords함수, 만약, 이면, 반복, 변수
  • Korean word order만약 조건 이면 { }, 조건 동안 { }
  • String interpolation"${expr}" auto-desugars to 형식()
  • Korean logical operators그리고, 또는
  • Dual execution — interpreter (hgl interpret) and compiler (hgl build)
  • Toolinghgl check, hgl init, VS Code extension, and LSP support
  • Learning pathexamples/교육_*.hgl includes 10 SOV-first educational programs
  • Arrays, structs, enums, tuples, closures, pattern matching
  • Error handling시도 / 처리 with Elm-style source-context errors
  • File I/O, format strings, module imports

How It Works

Source (.hgl) → Lexer → Parser → AST → Interpreter (direct execution)
                                     → CodeGen → LLVM IR → clang → Binary