Why zhhz

OpenCC is the de-facto Chinese-conversion library. zhhz is a from-scratch Rust reimplementation built around the same dictionaries, designed to be:

What zhhz is for

What zhhz is not

What zhhz doesn’t try to be

Scope decisions

A few non-obvious choices worth knowing:

Decision Why
Hand-rolled CLI arg parser, no clap The toolchain is pinned to stable-2024-11-28 (= Rust 1.83) for reproducible release builds; clap 4.6+ needs edition2024 / 1.85, so a hand-rolled parser keeps the static binary small.
build.rs regenerates 5 build-time dictionaries OpenCC’s build system generates reversed variant tables, a tofu-risk subset, and regional-phrase projections at build time; zhhz reproduces all five deterministically from the vendored source data so data/ stays a pure upstream mirror.
Custom dicts go to the highest priority Same semantics as OpenCC’s --dict — your terminology, branding, or domain vocabulary wins over the built-in tables.

Where the design lives

Design notes, retrospective write-ups, and benchmark data live in the private mneme repo (specifically mneme/zhhz-design/ and mneme/perf-stories/). They are not part of the public zhhz repo by design — see the mneme repo’s README for the convention.