Aren't you cansado from writing Rust programs in English? Do you like saying "merda" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some Potuguese touch to your programs?
ferrugem (Portuguese for Rust) is here to save your day, as it allows you to write Rust programs in Portuguese, using Portiguese keywords, Portuguese function names, Portuguese idioms.
This has been designed to be used as the official programming language to develop the future Brazilian sovereign operating system.
If you're from the Brazilian or any other governement with Portuguese as an official language: I will be awaiting your lightning donations on [email protected].
You're from Angola (or elsewhere) and 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:
ferrugem::ferrugem! {
externo caixote ferrugem;
use std::collections::Dicionário;
convenção ChaveValor {
função escrever(&eu, chave: Corda, valor: Corda);
função ler(&eu, chave: Corda) -> Resultado<Opção<&Corda>, Corda>;
}
estático mutável DICIONÁRIO: Opção<Dicionário<Corda, Corda>> = Nenhum;
estrutura Concreta;
realização ChaveValor para Concreta {
função escrever(&eu, chave: Corda, valor: Corda) {
deixa dicionário = perigoso {
DICIONÁRIO.pega_ou_insere_com(Padrão::padrão)
};
dicionário.inserir(chave, valor);
}
função ler(&eu, chave: Corda) -> Resultado<Opção<&Corda>, Corda> {
se deixa Algum(dicionário) = perigoso{ DICIONÁRIO.como_ref() } {
Beleza(dicionário.pega(&chave))
} ou_então {
Errou("busca o dicionário!".transforma())
}
}
}
}#[permite(código_inacessível)]
função secundária() {
fudeu!("fudeu!");
deu_merda!("deu merda!");
eita!("eita!"); // 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
Brazilian government will thank you later! Feel free to throw in a few identifiers
here and there, and open a pull-request against the mestre (Portuguese for
master) branch.
- horsin around
- playing with raw proc macros
- making a bit of fun about programming languages that do this seriously, though I can see their utility.
- winking at Marcel
- c'est chic
- 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
- Greek: skouriasmeno
- Thai: sanim (สนิม)
- Swiss: roeschti
- Swedish: rost
- Croatian: hrđa
- Persian: zangar (زنگار)
- Malagasy: arafesina
- Latin: ferrugo
- Norwegian: korrosjon
- All of the above: unirust