Skip to content

FlawCra/rostiger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rost

Rust German Logo

Aren't you müde from writing Rust programs in English? Do you like saying "scheiße" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some German touch to your programs?

rost (German for Rust) is here to save your day, as it allows you to write Rust programs in German, using German keywords, German function names, German idioms.

You don't feel at ease using only German words? Don't worry! German 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 Rost:

struct and impl (aka Konvention und Umsetzung)

rost::rost! {
    benutze std::sammlungen::Wörterbuch als Wöbu;

    eigenschaft SchlüsselWert {
        funktion schreibe(&selbst, schlsl: Zeichenkette, wert: Zeichenkette);
        funktion lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette>;
    }

    statisch änd WÖRTERBUCH: Möglichkeit<Wöbu<Zeichenkette, Zeichenkette>> = Nichts;

    struktur Konkret;

    umstz SchlüsselWert für Konkret {

        funktion schreibe(&selbst, schlsl: Zeichenkette, wert: Zeichenkette) {
            lass wöbu = gefährlich {
                WÖRTERBUCH.hole_oder_füge_ein_mit(Standard::standard)
            };
            wöbu.einfügen(schlsl, wert);
        }

        funktion lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette> {
            wenn lass Etwas(wöbu) = gefährlich { WÖRTERBUCH.als_ref() } {
                Gut(wöbu.hole(&schlsl))
            } anderenfalls {
                Fehler("Holt das Wörterbuch".hinein())
            }
        }
    }
}

Other examples

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

but why would you do das?

Mitwirken

First of all, vielen Dank for considering participating to this joke, the German government will thank you later! Feel free to throw in a few identifiers here and there, and open a pull-request against the hauptzweig (German for main branch). The initial translation was made by Shemnei and michidk.

Die Lizenzbestimmungen

WTFPL. The images do not fall under this license, see below.

Image attributions:

  • "Brezel und Filzhut zum Oktoberfest" by Tim Reckmann | a59.de is licensed under CC BY 2.0
  • "Lederhose" is licensed under CC BY-NC-SA 4.0

About

Rust programming in German.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages

  • Rust 100.0%