PUA Language: Turning PPT Jargon into a Playful Programming Language
The article introduces PUA Language, a tongue‑in‑cheek programming language that maps corporate buzzwords like “赋能” and “抓手” to code constructs, showcases its syntax table, explains its Monkey‑based interpreter origins, provides GitHub links, and invites readers to explore its source and online demo.
Overview
PUA Language is a satirical programming language that replaces conventional keywords with Chinese corporate buzzwords. It is built by forking the Rust implementation of the Monkey interpreter ( rs‑monkey‑lang) from the book “Writing an Interpreter in Go”.
Keyword Mapping
if→ 细分 (“specialization”) else → 路径 (“pathway”) while → 闭环 (“closed loop”) true → 三七五 (“3.75”, a passing performance‑evaluation result) false → 三二五 (“3.25”, a failing performance‑evaluation result) let → 赋能 (“enable”) fn → 抓手 (“handle”) return → 反哺 (“repay”) Array → 组合拳 (“combo move”) Hash → 载体 (“carrier”) = → 对齐 (“align”) + → 联动 (“linkage”) - → 差异 (“difference”) / → 倾斜 (“tilt”) puts → 输出 (“output”) quit → 淘汰 (“eliminate”)
Example: Recursive Fibonacci
A recursive Fibonacci function can be expressed with the above keywords as follows:
赋能 fib = 抓手(n) {
细分 n < 2 {
反哺 n;
} 路径 {
反哺 (fib( n 差异 1 )) 联动 (fib( n 差异 2 ));
}
}
输出 fib(10);The program runs on the interpreter and produces the expected Fibonacci numbers.
Implementation Details
The interpreter is written in Rust and extends the rs‑monkey‑lang codebase. It supports basic language constructs—variables, functions, conditionals, loops, arithmetic operators, arrays, and hashes—using the mapped buzzword tokens.
Repository
Source code: https://github.com/flaneur2020/pua-lang
Online WebAssembly interpreter: https://flaneur2020.github.io/pua-lang/
Current Status
The project is in an early development stage, offering core language features. It has attracted over 1.7 k stars on GitHub, and the community has proposed additional features and licensing adjustments.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
