Skip to content

vojd/rost

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rost

Aren't you uttråkad from writing Rust programs in English? Do you like saying "fan" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some Swedish touch to your programs?

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

This has been designed to be used as the official programming language to develop the future Swedish sovereign operating system.

If you're from Sweden's or any other government with Swedish as an official language: bnjbvr will be awaiting your donations on liberapay. (Vänligen notera att bnjbvr skrev den ursprungliga Franska versionen och förtjänar därför världens tack)

You're from Finland (or elsewhere) and don't feel at ease using only Swedish words?

Don't worry! Swedish 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:

trait and impl (aka konvention och implementera)

rost::rost! {
    extern låda rost;

    använd std::collections::Ordbok som Bok;

    konvention NyckelVärde {
        funktion skriv(&själv, nyckel: Sträng, värde: Sträng);
        funktion läs(&själv, nyckel: Sträng) -> Resultat<Kanske<&Sträng>, Sträng>;
    }

    statisk föränderlig ORDBOK: Kanske<Bok<Sträng, Sträng>> = Ingenting;

    struktur Konkret;

    implementera NyckelVärde för Konkret {
        funktion skriv(&själv, nyckel: Sträng, värde: Sträng) {
            låt bok = osäker {
                ORDBOK.ta_eller_för_in_med(Standard::standard)
            };
            bok.för_in(nyckel, värde);
        }
        funktion läs(&själv, nyckel: Sträng) -> Resultat<Kanske<&Sträng>, Sträng> {
            om låt Någon(bok) = osäker { ORDBOK.som_ref() } {
                Bra(bok.läs(&nyckel))
            } annars {
                Fel("hämta ord".till())
            }
        }
    }
}

Support for regional languages

#[tillåt(onåbar_kod)]
funktion sekundär() {
  fan!("skit också"); // for the true Swedish experience
  huvva!("men så obra!"); // for friends from up north
  oj!("de här sket sig"); // in SFW contexts
}

Other examples

See the examples to get a rough sense of the whole syntax. Sådär! Det var det.

Bidrag / contributions

First of all, tack så mycket for considering participating in this joke, the Swedish government will thank you later! Feel free to throw in a few identifiers here and there, and open a pull-request against the huvud (Swedish for main) branch.

Please don't introduce swear words, though: we will not excuse your Swedish.

But varför would you do that?

  • Det är ball
  • We must not let the Finns and Danes down
  • To tease the Norwegians who don't have a localized Rust (yet)
  • To learn more about proc_macros
  • Det är verkligen ball

Other languages

Ett stort tack till

  • bnjbvr for making the original French version on which this is based

Licensen

License Publique Rien à Branler, the official translation of the WTFPL by the same author.

(Ok, den är på Franska men det går ändå)

About

Rust programming, in Swedish.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%