Rdza: Rewriting Rust in Polish with a Macro-Driven Cultural Twist
Share this article
When Poland's government announced plans for a national sovereign operating system, few expected a programming language twist. Enter Rdza (Polish for "rust"), a provocative macro that rewrites Rust's syntax into Polish—blurring lines between technical satire and cultural commentary.
Developed by GitHub user phaux, Rdza replaces Rust's English keywords with Polish equivalents:
fnbecomesfunkcja(function)letbecomesniech(let)traitbecomescecha(trait)panic!becomeskurwa!(a Polish expletive)
rdza::rdza! {
cecha WartościPoKluczu {
funkcja zapisz(&się, klucz: Ciąg, wartość: Ciąg);
funkcja wczytaj(&się, klucz: Ciąg) -> Wynik<Opcja<&Ciąg>, Ciąg>;
}
}
Example: Defining a trait (cecha) in Rdza. Ciąg = String, Wynik = Result, Opcja = Option.
The project explicitly jokes about being "the official language for Poland's sovereign OS," but its technical execution is serious. Rdza leverages Rust's declarative macro system to token-map keywords before compilation, maintaining full interoperability with English Rust. This means Polish and English code coexist in the same project—a deliberate design choice emphasizing practicality beneath the humor.
Rdza's logo playfully incorporates Poland's national colors.
Regional dialects aren't ignored. The macro supports localized exclamations like jerōnie! (Silesian dialect) alongside the default kurwa!, acknowledging Poland's linguistic diversity. For workplace-friendly environments, panikuj! ("panic!") offers a SFW alternative.
Why This Matters Beyond Memes
- Macro Power: Demonstrates Rust's metaprogramming flexibility for syntax experimentation
- Localization Debate: Challenges English's dominance in tech while revealing complexities of keyword translation
- Sovereign Tech Satire: Parodies nationalist tech initiatives through executable code
Rdza joins similar projects like French rouille and German rost, forming a tongue-in-cheek movement questioning programming's linguistic assumptions. Licensed under the WTFPL, it invites contributions to expand its "Polish experience."
While unlikely to replace Rust in production, Rdza forces reflection: Could localized programming languages ease entry barriers? Or would fragmented syntax harm collaboration? As one contributor notes: "This is a joke... but the Polish government did announce an OS."