Skip to content

vkoskiv/ruoste

 
 

Repository files navigation

ruoste

Aren't you väsynyt from writing Rust programs in English? Do you like saying "perkele" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some Finnish touch to your programs?

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

This has been designed to be used as the official programming language to develop the future Finnish sovereign operating system. If you're from the Finnish government: I will be awaiting your donations on liberapay

You're from Jyväskylä and don't feel at ease using only Finnish words? Don't worry! Finnish 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 ruoste:

trait and impl (aka piirre ja toteutus)

ruoste::ruoste! {
    käytä std::collections::RisuaitaKartta nimellä Käsky;

    piirre AvainArvo {
        toiminto kirjoita(&itse, avain: Ketju, arvo: Ketju);
        toiminto lue(&itse, avain: Ketju) -> Mahdollisuus<&Ketju>;
    }

    staattinen muuttuva HAKEMISTO: Mahdollisuus<Käsky<Ketju, Ketju>> = EiMikään;

    rakenne Betoni;

    toteutus AvainArvo kaikille Betoni {
        toiminto kirjoita(&itse, avain: Ketju, arvo: Ketju) {
            olkoon käsky = turvaton {
                HAKEMISTO.ota_tai_sijoita_käyttäen(Oletus::oletus)
            };
            käsky.sijoita(avain, arvo);
        }
        toiminto lue(&itse, avain: Ketju) -> Tulos<Mahdollisuus<&Ketju>, Ketju> {
            jos olkoon Jokin(käsky) = turvaton { HAKEMISTO.viittaukseksi() } {
                Onnistui(käsky.lue(&avain))
            } muuten {
                Virh("käskyn haku".osaksi())
            }
        }
    }
}

Support for regional languages

#[salli(saavuttamaton_koodi)]
toiminto toissijainen() {
    voi_perkele!("o-ou"); // for the true Finnish experience
    oho!("Aattakee!"); // for friends speaking Savo
    hups!("Haku epäonnistui"); // in SFW contexts
}

Other examples

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

Talkoot

First of all, kiitos for considering participating to this joke, the Finnish government will thank you later! Feel free to throw in a few identifiers here and there, and open a pull-request against the päälinja ((Sort of) Finnish for main) branch.

But whai would you do dät

  • 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
  • se on siistii

Other languages

Kiitokset

Thanks to Joel for the logo!

Lisenssi

Tee Mitä Vittua Haluat Julkinen Lisenssi, aka WTFPL

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%