Thanks to visit codestin.com
Credit goes to github.com

Skip to content

luisschwab/ferrugem

 
 

Repository files navigation

ferrugem

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:

trait and impl (aka convenção e realização)

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())
            }
        }
    }
}

Support for regional languages

#[permite(código_inacessível)]
função secundária() {
    fudeu!("fudeu!");
    deu_merda!("deu merda!");
    eita!("eita!"); // in SFW contexts
}

Other examples

See the examples to get a rough sense of the whole syntax. Voilà, that's it.

les contributions

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.

but why would you do zat

  • 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

Other languages

About

Rust programming, in Portuguese.

Resources

License

Stars

Watchers

Forks

Languages

  • Rust 100.0%