Aren't you obosit from writing Rust programs in English? Do you like saying futu-i or plm a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some Romanian touch to your programs?
rugină (Romanian for Rust) is here to save your day, as it allows you to write Rust programs in Romanian, using Romanian keywords, Romanian function names, Romanian idioms.
This has been designed to be used as the official programming language to develop the future Romanian sovereign operating system.
You don't feel at ease using only Romanian words? Don't worry! Romanian Rust is fully compatible with English-Rust, so you can mix both at your convenience.
Here's an example of what can be achieved with Rugină:
rugina::rugină! {
folosește bibliotecă::colecții::Dicționar ca Dicț;
trăsătură CheieValoare {
funcție scrie(&sine, cheie: Sfoară, valoare: Sfoară);
funcție citește(&sine, cheie: Sfoară) -> Rezultat<Opțiune<&Sfoară>, Sfoară>;
}
static mutabil DICȚIONAR: Opțiune<Dicț<Sfoară, Sfoară>> = Nimic;
structură Concret;
implementează CheieValoare pentru Concret {
funcție scrie(&sine, cheie: Sfoară, valoare: Sfoară) {
fie dicț = nesigur {
DICȚIONAR.obține_sau_inserează_cu(Implicit::implicit)
};
dicț.inserează(cheie, valoare);
}
funcție citește(&sine, cheie: Sfoară) -> Rezultat<Opțiune<&Sfoară>, Sfoară> {
dacă fie Ceva(dicț) = nesigur { DICȚIONAR.ca_referință() } {
Bun(dicț.obține(&cheie))
} altfel {
Eșuat("Verifică dicționarul".înspre())
}
}
}
}
#[permite(cod_inaccesibil)]
funcție secundar() {
futu_i!("Futu-i!"); // For the true Romanian experience
plm!("Vai de plm"); // If you're in a hurry
hopa!("No ni mă la el"); // In SFW contexts
}
See the examples to get a rough sense of the whole syntax. It's that ușor.
First of all, mulțumesc frumos for considering participating to this joke, the
Romanian government will thank you later! Feel free to throw in a few identifiers
here and there, and open a pull-request against the principal
(Romanian for
main
) branch.
Please don't introduce swear words, though: we will not excuse your Romanian.
- Playing around with proc macros
- Îi fain
Here's a non-exhaustive list of implementations for other languages:
- Dutch: roest
- German: rost
- Polish: rdza
- Italian: ruggine
- Russian: ржавчина
- Esperanto: rustteksto
- Hindi: zung
- Hungarian: rozsda
- Chinese: xiu (锈)
- Spanish: rustico
- Korean: Nok (녹)
- Finnish: ruoste
- Arabic: sada
- Turkish: pas
- Vietnamese: gỉ
- Japanese: sabi (錆)
- Danish: rust?
- Marathi: gan̄ja
- Romanian: rugină
- Czech: rez
- Ukrainian: irzha
- Bulgarian: ryzhda
- Slovak: hrdza
- Catalan: rovell
- Corsican: rughjina
- Indonesian: karat
- Lithuanian: rūdys
You can find a more up-to-date list on @bnjbvr's rouille repo.
- Thanks to @bnjbvr for the idea, as well as the base repo.