roest/README.md

72 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2021-09-11 16:08:47 +02:00
# Roest
2021-09-09 19:40:29 +02:00
2021-09-11 16:15:30 +02:00
![](https://raw.githubusercontent.com/jeroenhd/roest/hoofd/logo.png)
2021-09-11 16:08:47 +02:00
Aren't you _het spuugzat_ from writing Rust programs in English? Do you like saying
"kut" a lot? Would you like to try something different, in an exotic and
2021-09-09 20:04:10 +02:00
funny-sounding language? Would you want to bring some French touch to your
programs?
2021-09-09 19:40:29 +02:00
2021-09-11 16:08:47 +02:00
**roest** (Dutch for _Rust_) is here to save your day, as it allows you to
write Rust programs in Dutch, using Dutch keywords, Dutch function names,
Dutch idioms, based on [rouille](https://github.com/bnjbvr/rouille).
2021-09-09 19:40:29 +02:00
2021-09-11 16:08:47 +02:00
Any government officials wanting to use this language should donate to rouille
using [liberapay](https://liberapay.com/bnjbvr/).
2021-09-09 20:04:10 +02:00
2021-09-11 16:08:47 +02:00
You're from Flanders and don't feel at ease using only Dutch words? Don't worry!
2021-09-09 20:04:10 +02:00
French Rust is fully compatible with English-Rust, so you can mix both at your
2021-09-11 16:08:47 +02:00
convenience. Support for French Rust is not yet available.
2021-09-09 20:04:10 +02:00
2021-09-11 16:08:47 +02:00
Here's an example of what can be achieved with Roest:
2021-09-09 20:04:10 +02:00
```rust
2021-09-11 16:08:47 +02:00
gebruik std::collections::Woordenboek zoals Wbk;
2021-09-09 20:04:10 +02:00
2021-09-11 16:08:47 +02:00
karaktereigenschap SleutelWaarde {
functie schrijf(&zelf, sleutel: Keten, waarde: Keten);
functie lees(&zelf, sleutel: Keten) -> Mogelijkheid<&Keten>;
2021-09-09 20:04:10 +02:00
}
2021-09-11 16:08:47 +02:00
vast veranderlijk WOORDENBOEK: Mogelijkheid<Wbk<Keten, Keten>> = Geen;
structuur Concreet;
uitwerking SleutelWaarde voor Concreet {
functie schrijf(&zelf, sleutel: Keten, waarde: Keten) {
laat wk = gevaarlijk {
WOORDENBOEK.verkrijg_of_voeg_toe_met(Standaard::standaard)
};
wk.voeg_in(sleutel, waarde);
}
functie lees(&zelf, sleutel: Keten) -> Mogelijkheid<&Keten> {
laat wk = gevaarlijk {
WOORDENBOEK.verkrijg_of_voeg_toe_met(Standaard::standaard)
};
wk.verkrijg(&sleutel)
}
2021-09-09 20:04:10 +02:00
}
```
See the [examples](./examples/src/main.rs) to get a rough sense of the whole
2021-09-11 16:08:47 +02:00
syntax. Ziezo, that's it.
2021-09-09 20:04:10 +02:00
2021-09-11 16:08:47 +02:00
## contributies
2021-09-09 19:40:29 +02:00
2021-09-11 16:08:47 +02:00
First of all, _dankjewel_ 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
2021-09-11 16:08:47 +02:00
here and there, and open a pull-request against the `hoofd` (Dutch for
2021-09-09 19:40:29 +02:00
`main`) branch.
2021-09-11 16:08:47 +02:00
## but why would you do dat
2021-09-09 19:40:29 +02:00
2021-09-11 16:08:47 +02:00
- if the French can do it, so can we
2021-09-09 19:40:29 +02:00
2021-09-11 16:08:47 +02:00
## met dank aan
- [Benjamin Bouvier] (https://github.com/bnjbvr/), Eric BREHAULT and Anisse Astier for their work on [rouille](https://github.com/bnjbvr/rouille)
2021-09-11 16:08:47 +02:00
## licentie
2021-09-09 19:40:29 +02:00
[WTFPL](http://www.wtfpl.net/).