Ferrugem is Rust but in Portuguese-BR

Overview

ferrugem

ferrugem

Aren't you pistola from writing Rust programs in English? Do you like saying "caralho" a lot? Would you like to try something different, in an exotic and beautiful language? Would you want to bring some HUE HUE BR BR touch to your programs?

ferrugem (PT-BR for Rust) is here to save your day, as it allows you to write Rust programs in Brazilian Portuguese, using BR keywords, BR function names, and BR idioms.

You don't feel at ease using only PT-BR words? Don't worry! Ferrugem is fully compatible with English-Rust, so you can mix both at your convenience.

Here's couple examples of what can be achieved with Ferrugem:

Olá, Mundo!

ferrugem::ferrugem! {
    função principal() {
        printarln!("Olá, Mundo!");
    }
}

struct and impl (aka estrutura e implementar)

ferrugem::ferrugem! {
    usar pdr::coleções::Dicionário como Dicio;

    atributo Eae {
        função escrever(&eu, chave: Texto, valor: Texto);
        função obter(&eu, chave: Texto) -> Resultado<Opção<&Texto>, Texto>;
    }

    estático mutável DICIONARIO: Opção<Dicio<Texto, Texto>> = Nenhum;

    estrutura Concreto;

    implementar Eae para Concreto {
        função escrever(&eu, chave: Texto, valor: Texto) {
            eis dicio = inseguro {
                DICIONARIO.obter_ou_inserir_com(Padrão::padrão)
            };
            dicio.inserir(chave, valor);
        }

        função obter(&eu, chave: Texto) -> Resultado<Opção<&Texto>, Texto> {
            se eis Algum(dicio) = inseguro { DICIONARIO.como_ref() } {
                TaMec(dicio.obter(&chave))
            } senão {
                Erro("Deu ruim, rapaziada ".para_texto())
            }
        }
    }

    público(cesta) função talvez(i: u32) -> Opção<Resultado<u32, Texto>> {
        se i % 2 == 1 {
            se i == 42 {
                Algum(Erro(Texto::de("Cacete!")))
            } senão {
                Algum(TaOk(33))
            }
        } senão {
            Nenhum
        }
    }

    asinc função exemplo() {}

    asinc função exemplo2() {
        exemplo().aguardar;
    }

    função principal() {
        eis mutável x = 31;

        corresponder x {
            42 => {
                printarln!("cacete")
            }
            _ => printarln!("Deu bom!"),
        }

        para i em 0..10 {
            eis val = laço {
                interromper i;
            };

            enquanto nada x < val {
                x += 1;
            };

            x = se eis Algum(resultado) = talvez(i) {
                resultado.desempacotar()
            } senão {
                12
            };
        }

        #[permitir(código_sem_uso)]
        função secundária() {
            deu_ruim!("Deu ruim");
            caralho!("Carai, menor, já era");
            pqp!("Perdeu, cumpadi");
            fudeu!("Já era, menor");
            eita!("Mineirês");
        }
    }
}

Other examples

See the examples to get a rough sense of the whole syntax.

pra que fazer isso?

  • There are French, Dutch, and German versions of Rust, we must bring the BR spirit to the fight as well!
  • Nóis é BR memo caraio
  • Pq eu quis!

Agradecimentos

  • German: I saw this first and decided to do a BR version as well. No one has done it so far, so I took my chance.

Licença

WTFPL.

You might also like...
Rust edit distance routines accelerated using SIMD. Supports fast Hamming, Levenshtein, restricted Damerau-Levenshtein, etc. distance calculations and string search.

triple_accel Rust edit distance routines accelerated using SIMD. Supports fast Hamming, Levenshtein, restricted Damerau-Levenshtein, etc. distance cal

Rust native ready-to-use NLP pipelines and transformer-based models (BERT, DistilBERT, GPT2,...)

rust-bert Rust native Transformer-based models implementation. Port of Hugging Face's Transformers library, using the tch-rs crate and pre-processing

👄 The most accurate natural language detection library in the Rust ecosystem, suitable for long and short text alike
👄 The most accurate natural language detection library in the Rust ecosystem, suitable for long and short text alike

Table of Contents What does this library do? Why does this library exist? Which languages are supported? How good is it? Why is it better than other l

Snips NLU rust implementation

Snips NLU Rust Installation Add it to your Cargo.toml: [dependencies] snips-nlu-lib = { git = "https://github.com/snipsco/snips-nlu-rs", branch = "mas

A fast, low-resource Natural Language Processing and Text Correction library written in Rust.

nlprule A fast, low-resource Natural Language Processing and Error Correction library written in Rust. nlprule implements a rule- and lookup-based app

A fast implementation of Aho-Corasick in Rust.

aho-corasick A library for finding occurrences of many patterns at once with SIMD acceleration in some cases. This library provides multiple pattern s

Natural Language Processing for Rust

rs-natural Natural language processing library written in Rust. Still very much a work in progress. Basically an experiment, but hey maybe something c

finalfusion embeddings in Rust

Introduction finalfusion is a crate for reading, writing, and using embeddings in Rust. finalfusion primarily works with its own format which supports

Rust-tokenizer offers high-performance tokenizers for modern language models, including WordPiece, Byte-Pair Encoding (BPE) and Unigram (SentencePiece) models

rust-tokenizers Rust-tokenizer offers high-performance tokenizers for modern language models, including WordPiece, Byte-Pair Encoding (BPE) and Unigra

Owner
Sturdy Robot
27 year old computer scientist. Pythonista.
Sturdy Robot
Rust-nlp is a library to use Natural Language Processing algorithm with RUST

nlp Rust-nlp Implemented algorithm Distance Levenshtein (Explanation) Jaro / Jaro-Winkler (Explanation) Phonetics Soundex (Explanation) Metaphone (Exp

Simon Paitrault 34 Dec 20, 2022
Fast suffix arrays for Rust (with Unicode support).

suffix Fast linear time & space suffix arrays for Rust. Supports Unicode! Dual-licensed under MIT or the UNLICENSE. Documentation https://docs.rs/suff

Andrew Gallant 207 Dec 26, 2022
Elastic tabstops for Rust.

tabwriter is a crate that implements elastic tabstops. It provides both a library for wrapping Rust Writers and a small program that exposes the same

Andrew Gallant 212 Dec 16, 2022
An efficient and powerful Rust library for word wrapping text.

Textwrap Textwrap is a library for wrapping and indenting text. It is most often used by command-line programs to format dynamic output nicely so it l

Martin Geisler 322 Dec 26, 2022
⏮ ⏯ ⏭ A Rust library to easily read forwards, backwards or randomly through the lines of huge files.

EasyReader The main goal of this library is to allow long navigations through the lines of large files, freely moving forwards and backwards or gettin

Michele Federici 81 Dec 6, 2022
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

regex A Rust library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a f

The Rust Programming Language 2.6k Jan 8, 2023
Natural language detection library for Rust. Try demo online: https://www.greyblake.com/whatlang/

Whatlang Natural language detection for Rust with focus on simplicity and performance. Content Features Get started Documentation Supported languages

Sergey Potapov 805 Dec 28, 2022
Multilingual implementation of RAKE algorithm for Rust

RAKE.rs The library provides a multilingual implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Rust. How to Use Append rake to

Navid 26 Dec 16, 2022
A Rust library for generically joining iterables with a separator

joinery A Rust library for generically joining iterables with a separator. Provides the tragically missing string join functionality to rust. extern c

Nathan West 72 Dec 16, 2022