Aren't you cansado from writing Rust programs in English? Do you like saying "caralho" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some Portugese touch to your programs?
ferrugem (Portugese for Rust) is here to save your day, as it allows you to write Rust programs in Portuguese, using Portuguese keywords, Portugese function names, Portuguese idioms.
You're from Brazil but don't feel at ease using only Portuguese words? Don't worry! Portuguese 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 Ferrugem:
rouille::rouille! {
utilisons std::collections::Dictionnaire comme Dico;
convention CléValeur {
fonction écrire(&soi, clé: Chaine, valeur: Chaine);
fonction lire(&soi, clé: Chaine) -> PeutÊtre<&Chaine>;
}
statique mutable DICTIONNAIRE: PeutÊtre<Dico<Chaine, Chaine>> = Rien;
structure Concrète;
réalisation CléValeur pour Concrète {
fonction écrire(&soi, clé: Chaine, valeur: Chaine) {
soit dico = dangereux {
DICTIONNAIRE.prendre_ou_insérer_avec(Défaut::défaut)
};
dico.insérer(clé, valeur);
}
fonction lire(&soi, clé: Chaine) -> Résultat<PeutÊtre<&Chaine>, Chaine> {
si soit Quelque(dico) = dangereux { DICTIONNAIRE.en_réf() } {
Bien(dico.lire(&clé))
} sinon {
Arf("fetchez le dico".vers())
}
}
}
}
#[légal(code_inaccessible)]
fonction secondaire() {
merde!("oh non"); // for the true French experience
calisse!("tabarnak"); // for friends speaking fr-ca
oups!("fetchez la vache"); // in SFW contexts
}
See the examples to get a rough sense of the whole syntax. Voilà, that's it.
First of all, muito obrigado for considering participating to this joke, the
Brazil government will thank you later! Feel free to throw in a few identifiers
here and there, and open a pull-request against the principal
(Portuguese for
main
) branch.
Please don't introduce swear words, though: we will not excuse your Portuguese.
- because brazil memes
- Dutch: roest
- German: rost
- Polish: rdza
- Italian: ruggine
- Russian: ржавчина
- Esperanto: rustteksto
- Hindi: zung
- Hungarian: rozsda
- Chinese: xiu (锈)
- Spanish: oxido
- Korean: Nok (녹)
- Finnish: ruoste
- Arabic: sada
- @bnjbvr for the original version (rouille)