Write a sorting algorithm or mathematical computation in Classical Chinese syntax for fun or artistic expression.
Learn how esoteric languages work by studying a Turing-complete language with unconventional syntax.
Explore the intersection of programming and Classical Chinese literature through executable code.
Wenyan is an esoteric programming language, a language created more as an experiment or artistic statement than as a practical tool, whose syntax is modelled on Classical Chinese, the formal written language used in Chinese literature and official documents for over two thousand years. Programming in Wenyan means writing code that looks like ancient Chinese prose rather than conventional source code. The language is Turing complete, meaning it can theoretically compute anything any other programming language can. The README demonstrates this with a "hello world" example: a short snippet of Classical Chinese characters that declares a number, uses it to control a loop, and prints a phrase three times, functionally equivalent to a simple JavaScript for-loop. Punctuation and line breaks are entirely optional, matching the style of Classical Chinese texts where spacing is absent. Wenyan compiles to JavaScript, Python, or Ruby, so the programs it produces can actually run. There is an online IDE where you can try it in a browser without installing anything. For local use, the compiler is installed via npm. Editor plugins exist for VS Code, Vim, and Sublime Text. The project includes examples of classic algorithms, quicksort, the Sieve of Eratosthenes, Mandelbrot set, Tower of Hanoi, all written in Classical Chinese syntax. The intended audience is primarily people who find the concept amusing or intellectually interesting, programmers curious about esoteric languages, fans of Classical Chinese literature, or anyone who enjoys the absurdity of describing a sorting algorithm in the style of ancient Chinese scholarship.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.