Han v0.2.1: an experimental Korean-syntax programming language written in Rust

Hi Rustaceans,

I just published Han v0.2.1 to crates.io:

cargo install han-lang

Han is an experimental programming language where Korean is the primary syntax of the toolchain: keywords, type names, built-ins, logical operators, error-handling forms, examples, and diagnostics are written in
Korean.

The compiler/tooling is written in Rust. The installed CLI is hgl.

A tiny example:

함수 더하기(a: 정수, b: 정수) -> 정수 {
    반환 a + b
}

출력(더하기(2, 3))

Run it with:

hgl interpret hello.hgl

What is included

  • tree-walking interpreter: hgl interpret <file.hgl>
  • native build path through generated LLVM IR + clang: hgl build <file.hgl>
  • type checker: hgl check <file.hgl>
  • REPL: hgl repl
  • LSP server: hgl lsp
  • VS Code extension in the repository
  • browser playground
  • examples covering basics, structs, arrays, pattern matching, file I/O, JSON, HTTP, regex, etc.

Why I built it

This is partly a compiler/tooling project and partly a language experiment.

Korean is spoken by many people, but programming languages overwhelmingly treat English as the default syntax layer. Han asks what a compiler/toolchain feels like when a non-English language is treated as first-
class syntax rather than only comments, strings, or identifiers.

It is also interesting from an AI/tokenization angle: Korean code is rare in public corpora, so LLM tokenizers often represent it inefficiently. More real Korean-language code examples may help future tools
understand non-English programming contexts better.

Current status

Han is experimental. It is not intended as a production language today.

The current release is meant for trying the language, reading the implementation, experimenting with the CLI/LSP, and giving feedback.

One practical note: Python interop is now opt-in. The default cargo install han-lang build is Python-free so the installed hgl binary does not require a local Python dynamic library. If you want the Python built-
ins, install with:

cargo install han-lang --features python

Links

If the project looks interesting, starring the GitHub repo would help with visibility and make it easier to collect feedback from more Rust developers.

Thanks!

I don't speak Korean, but linguistically I'm curious. How did you rethink syntax to be more Korean? Maybe have it be more SOV than SVO? (I'm assuming it's more than just renaming the keywords.)

Yep. v2 fully supports both SOV and SVO, based on feedback from Hacker News. So it’s not just renamed keywords anymore; the syntax fully supports Korean word order, particles, and endings while still staying practical for programming.

How has it felt using

n < 5 동안 {
    출력(n)
    n += 1
}

when writing and reading code?

To me the point of while cond is that it gives that "up front warning" that's important to know before reading the condition, less that it's trying to be any particular word order.

That's why I like async { ... } and loop { ... } despite being a huge advocate of .await. I think { ... }.loop would be bad.

But I haven't tried it out, so would be curious to hear experience reports of different orders for various things like this.

Out of curiosity, what are your native language(s)?

I have the same intuition about while cond being useful because the while provides additional context for the cond, but I do wonder if that's an artifact of being a native English language speaker and if my native language used different word order maybe that intuition would be different?

Yeah, that's why I think the async vs await distinction is so relevant: it's more likely to be a langue maternelle thing if I also preferred await foo() to foo().await.

Makes me wonder too about whether language that demarcate questions on both sides would have different expectations. Maybe "¿question?" would fit better with if-then or if-endif or something.

That makes sense for while, but for if the suffix form makes a lot of sense to me. You first evaluate the boolean, then decide what to do based on its value:

fn abs(x: i32) -> i32 {
    x >= 0 then { x } else { -x }
}

Yeah, ditto for match.

The important point is that if and match (and ? and await) operate on a value, while while operates on a thunk.

I agree that for quickly scanning a whole program, while cond-style ordering can be more convenient because it signals the operation first. But as a native Korean speaker, 동안 { ... } doesn’t feel especially jarring either. So when designing the scheme, I try to account for both: scanability for programmers, and syntax that still feels natural to Korean speakers.