aionescu / rugina

Rust programming, in Romanian.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rugină

Rugină Logo

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ă:

trăsătură și implementează (a.k.a. trait and impl)

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

Alternative syntax

#[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
}

Other examples

See the examples to get a rough sense of the whole syntax. It's that ușor.

Contribuții

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.

But why would you do așa ceva?

  • Playing around with proc macros
  • Îi fain

Other languages

Here's a non-exhaustive list of implementations for other languages:

You can find a more up-to-date list on @bnjbvr's rouille repo.

Mulțumiri

  • Thanks to @bnjbvr for the idea, as well as the base repo.

Licență (License)

WTFPL

About

Rust programming, in Romanian.

License:Do What The F*ck You Want To Public License


Languages

Language:Rust 100.0%