2021-09-09 19:40:29 +02:00
|
|
|
# rouille
|
|
|
|
|
2021-09-10 10:09:28 +02:00
|
|
|
![](https://github.com/bnjbvr/rouille/raw/principale/logo.jpeg)
|
|
|
|
|
2021-09-10 09:44:28 +02:00
|
|
|
Aren't you _le tired_ from writing Rust programs in English? Do you like saying
|
2021-09-09 20:04:10 +02:00
|
|
|
"merde" a lot? Would you like to try something different, in an exotic and
|
|
|
|
funny-sounding language? Would you want to bring some French touch to your
|
|
|
|
programs?
|
2021-09-09 19:40:29 +02:00
|
|
|
|
2021-09-10 09:44:28 +02:00
|
|
|
**rouille** (French for _Rust_) is here to save your day, as it allows you to
|
2021-09-09 20:04:10 +02:00
|
|
|
write Rust programs in French, using French keywords, French function names,
|
|
|
|
French idioms.
|
2021-09-09 19:40:29 +02:00
|
|
|
|
2021-09-09 20:04:10 +02:00
|
|
|
This has been designed to be used as the official programming language to
|
|
|
|
develop the future French sovereign operating system. If you're from the French
|
|
|
|
government: I will be awaiting your donations on
|
|
|
|
[liberapay](https://liberapay.com/bnjbvr/).
|
|
|
|
|
|
|
|
You're from Quebec and don't feel at ease using only French words? Don't worry!
|
|
|
|
French 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 Rouille:
|
|
|
|
|
2021-09-12 19:15:56 +02:00
|
|
|
### trait and impl (aka convention et réalisation)
|
2021-09-11 15:59:40 +02:00
|
|
|
|
2021-09-09 20:04:10 +02:00
|
|
|
```rust
|
2021-09-11 15:55:13 +02:00
|
|
|
rouille::rouille! {
|
|
|
|
utilisons std::collections::Dictionnaire comme Dico;
|
2021-09-09 20:04:10 +02:00
|
|
|
|
2021-09-11 15:55:13 +02:00
|
|
|
convention CléValeur {
|
|
|
|
fonction écrire(&soi, clé: Chaine, valeur: Chaine);
|
|
|
|
fonction lire(&soi, clé: Chaine) -> PeutÊtre<&Chaine>;
|
2021-09-09 20:04:10 +02:00
|
|
|
}
|
2021-09-11 15:55:13 +02:00
|
|
|
|
|
|
|
statique mutable DICTIONNAIRE: PeutÊtre<Dico<Chaine, Chaine>> = Rien;
|
|
|
|
|
|
|
|
structure Concrète;
|
|
|
|
|
|
|
|
réalisation CléValeur pour Concrète {
|
|
|
|
fonction écrire(&soi, clé: Chaine, valeur: Chaine) {
|
|
|
|
soit dico = dangereux {
|
|
|
|
DICTIONNAIRE.prendre_ou_insérer_avec(Défaut::défaut)
|
|
|
|
};
|
|
|
|
dico.insérer(clé, valeur);
|
|
|
|
}
|
|
|
|
fonction lire(&soi, clé: Chaine) -> Résultat<PeutÊtre<&Chaine>, Chaine> {
|
|
|
|
si soit Quelque(dico) = dangereux { DICTIONNAIRE.en_réf() } {
|
|
|
|
Bien(dico.lire(&clé))
|
|
|
|
} sinon {
|
|
|
|
Arf("fetchez le dico".vers())
|
|
|
|
}
|
|
|
|
}
|
2021-09-09 20:04:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-09-11 15:59:40 +02:00
|
|
|
### Support for regional languages
|
|
|
|
|
|
|
|
```rust
|
|
|
|
#[légal(code_inaccessible)]
|
|
|
|
fonction secondaire() {
|
|
|
|
merde!("oh non"); // for the true French experience
|
2021-09-11 18:38:23 +02:00
|
|
|
calisse!("tabarnak"); // for friends speaking fr-ca
|
2021-09-11 15:59:40 +02:00
|
|
|
oups!("fetchez la vache"); // in SFW contexts
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Other examples
|
|
|
|
|
2021-09-09 20:04:10 +02:00
|
|
|
See the [examples](./examples/src/main.rs) to get a rough sense of the whole
|
|
|
|
syntax. Voilà, that's it.
|
|
|
|
|
|
|
|
## les contributions
|
2021-09-09 19:40:29 +02:00
|
|
|
|
2021-09-10 09:44:28 +02:00
|
|
|
First of all, _merci beaucoup_ for considering participating to this joke, the
|
2021-09-09 19:40:29 +02:00
|
|
|
French government will thank you later! Feel free to throw in a few identifiers
|
|
|
|
here and there, and open a pull-request against the `principale` (French for
|
|
|
|
`main`) branch.
|
|
|
|
|
2021-09-09 20:04:10 +02:00
|
|
|
Please don't introduce swear words, though: we will not excuse your French.
|
|
|
|
|
2021-09-09 19:40:29 +02:00
|
|
|
## but why would you do zat
|
|
|
|
|
|
|
|
- horsin around
|
|
|
|
- playing with raw proc macros
|
2021-09-09 20:04:10 +02:00
|
|
|
- making a bit of fun about programming languages that do this seriously,
|
|
|
|
though I can see their utility.
|
|
|
|
- winking at [Marcel](https://github.com/brouberol/marcel)
|
2021-09-09 19:40:29 +02:00
|
|
|
- c'est chic
|
|
|
|
|
2021-09-12 19:16:53 +02:00
|
|
|
## Other languages
|
|
|
|
|
|
|
|
- Dutch: [roest](https://github.com/jeroenhd/roest)
|
|
|
|
- German: [rost](https://github.com/michidk/rost)
|
2021-09-13 09:21:22 +02:00
|
|
|
- Polish: [rdza](https://github.com/phaux/rdza)
|
2021-09-13 09:25:42 +02:00
|
|
|
- Italian: [ruggine](https://github.com/DamianX/ruggine)
|
2021-09-13 17:54:33 +02:00
|
|
|
- Russian: [ржавчина](https://github.com/FluxIndustries/rzhavchina)
|
2021-09-13 16:58:26 +02:00
|
|
|
- Esperanto: [rustteksto](https://github.com/dscottboggs/rustteksto)
|
2021-09-13 17:32:32 +02:00
|
|
|
- Hindi: [zung](https://github.com/rishit-khandelwal/zung)
|
2021-09-13 21:09:15 +02:00
|
|
|
- Hungarian: [rozsda](https://github.com/jozsefsallai/rozsda)
|
2021-09-14 14:12:22 +02:00
|
|
|
- Chinese: [xiu (锈)](https://github.com/lucifer1004/xiu)
|
2021-09-15 12:25:58 +02:00
|
|
|
- Spanish: [oxido](https://github.com/fdschonborn/oxido)
|
2021-09-15 12:25:30 +02:00
|
|
|
- Korean: [Nok (녹)](https://github.com/Alfex4936/nok)
|
2021-09-15 10:22:46 +02:00
|
|
|
- Finnish: [ruoste](https://github.com/vkoskiv/ruoste)
|
2021-09-15 12:26:34 +02:00
|
|
|
- Arabic: [sada](https://github.com/LAYGATOR/sada)
|
2021-09-19 20:20:42 +02:00
|
|
|
- Turkish: [pas](https://github.com/ekimb/pas)
|
2021-09-21 11:22:30 +02:00
|
|
|
- Vietnamese: [gỉ](https://github.com/Huy-Ngo/gir)
|
2021-09-24 13:32:50 +02:00
|
|
|
- Japanese: [sabi (錆)](https://github.com/yuk1ty/sabi)
|
2021-10-26 21:45:01 +02:00
|
|
|
- Danish: [rust?](https://github.com/LunaTheFoxgirl/rust-dk)
|
2021-10-29 14:50:54 +02:00
|
|
|
- Marathi: [gan̄ja](https://github.com/pranavgade20/ganja)
|
2021-09-12 19:16:53 +02:00
|
|
|
|
2021-09-10 10:09:28 +02:00
|
|
|
## un grand merci
|
|
|
|
|
|
|
|
- [@VentGrey](https://twitter.com/VentGrey) for making a logo!
|
|
|
|
|
2021-09-09 20:04:10 +02:00
|
|
|
## la license
|
2021-09-09 19:40:29 +02:00
|
|
|
|
2021-09-13 22:12:02 +02:00
|
|
|
[License Publique Rien à Branler](http://sam.zoy.org/lprab/),
|
|
|
|
_le_ official translation of the [WTFPL](http://www.wtfpl.net/)
|
|
|
|
by the same author.
|