durbat
Durbat is a Rust procedural macro that enables writing Rust using Black Speech keywords, identifiers, and module paths. It maps Black Speech constructs to their Rust equivalents while remaining fully interoperable with standard Rust.
Forged to bind syntax and meaning, it offers a spare, unlit aesthetic without compromising correctness or tooling.
Etymology
The name durbat derives from the Ring inscription "Ash nazg durbatulûk" — "to bind them" — reflecting the macro's role in binding Black Speech syntax to Rust.
Features
- Black Speech keywords: e.g., gimb (fn), krimp (let), ishi (if)
- ASCII and diacritic forms supported: krîmp/krimp, dûrbat/durbat
- Translated module paths: std::collections → Zud::Gakh
- Interoperable with standard Rust; mix as needed
- Self-hosted implementation (the macro uses its own surface)
Examples
goth and krimpash (trait and impl)
durbat!
Control flow
durbat!
Panic macros
gimb thrakulat
Keyword Mapping Table
Core Keywords
| Black Speech (both forms work) | Rust |
|---|---|
| gimb | fn |
| krîmp / krimp | let |
| ishi | if |
| dush | else |
| durb | match |
| nazg | loop |
| thrak | return |
| rakh | break |
| snaga | mut |
| agh | for |
| dûr / dur | while |
| goth | trait |
| krimpash | impl |
| burzum | mod |
| gûb / gub | pub |
| ghâsh / ghash | unsafe |
| dûshat / dushat | async |
| dûshatishi / dushatishi | await |
| mok | move |
| ish | in |
| azh | as |
| kûrz / kurz | const |
| dûl / dul | dyn |
| khor | where |
| stûk / stuk | static |
| kruk | struct |
| zhûm / zhum | enum |
| ruk | ref |
| lat | self |
| aghul | use |
| uzg | extern |
| cagdûl / cagdul | crate |
Types and Constructors
| Black Speech | Rust |
|---|---|
| Ash | Ok |
| Bûrz / Burz | Err |
| Gimbat | Option |
| Gimb | Some |
| Nar | None |
| Krîmpat / Krimpat | Result |
| Lat | Self |
| Ghâsh / Ghash | String |
| Lugbúrz / Lugburz | HashMap |
| Urûk / Uruk | Vec |
| Durbat | Default |
| Nazgûl / Nazgul | Error |
Module Paths
| Black Speech | Rust | Mnemonic |
|---|---|---|
| Zûd / Zud | std | standard |
| Zôg / Zog | core | core (guttural) |
| Gâkh / Gakh | collections | gather |
| esh | io | (lowercase special) |
| Ûrz / Urz | time | hours |
| Grûb / Grub | fs | grub/dig (files) |
| Zâg / Zag | path | zig-zag |
| Lôk / Lok | sync | lock |
| Râg / Rag | thread | rag/woven |
| Shâg / Shag | mem | memory |
| Pîk / Pik | ptr | pike/pointer |
| Skâk / Skak | slice | slash/cut |
| Zûl / Zul | str | string slice |
| Dûm / Dum | process | doom |
| Môrg / Morg | env | dark/ambient |
| Snâr / Snar | net | snare/network |
Examples:
aghul Zud::Gakh::Lugburz;→use std::collections::HashMap;aghul Zud::Gakh::Lugburz azh Lugdic;→use std::collections::HashMap as Lugdic;aghul Zud::esh;→use std::io;aghul Zud::Urz::Instant;→use std::time::Instant;aghul Zud::Grub::File;→use std::fs::File;aghul Zud::Lok::Mutex;→use std::sync::Mutex;aghul Zog::Pik;→use core::ptr;
Note: Lugburz (Lugbúrz) is used here as the Black Speech translation of HashMap.
Pure Black Speech Methods
| Black Speech | Rust | Meaning/Mnemonic |
|---|---|---|
| shakh | main | "chief/head" |
| nûk / nuk | new | crisp, orcish "new" |
| mokh | from | kin to "mok" |
| zug | into | terse, forceful |
| gruk | get | "grab/gruk" |
| nakh | insert | "thrust/place" |
| iskh | as_ref | ties to "ish" |
| zagh | as_str | sharp sound |
| grîsh / grish | to_string | nod to Grishnákh |
| ûzbag / uzbag | unwrap | "unbag" value |
| ûrg / urg | expect | stern |
| mazg | get_or_insert_with | compact |
| akh | true | affirmative |
| mâz / maz | false | negative |
| ugl | default | terse |
Macros
| Black Speech | Rust |
|---|---|
| krimpat! | println! |
| ghâzh! / ghazh! | panic! |
| pushdug! / pushduk! | panic! (aliases) |
Attributes
| Black Speech | Rust |
|---|---|
| lûg / lug | allow |
| caldûsh / caldush | unreachable_code |
Proc Macro Internals (for advanced users)
| Black Speech | Rust |
|---|---|
| Gurûp / Gurup | Group |
| Nazgid | Ident |
| Ishiflûx / Ishiflux | TokenStream |
| Ishidûrb / Ishidurb | TokenTree |
| Pûnk / Punk | Punct |
| Litrâl / Litral | Literal |
| makro | proc_macro |
| portul | span |
| flûx / flux | stream |
| thruk | push |
| zand | extend |
| delîm / delim | delimiter |
ASCII vs Diacritics
You can use either style or mix them freely:
// With diacritics
dûrbat!
// ASCII-only (for compatibility)
durbat!
Both work identically.
Installation
Add durbat to your Cargo.toml:
[]
= "1.0.0"
Or for development from source:
[]
= { = "https://github.com/itsfoxstudio/durbat" }
Usage
Wrap your code in the durbat! macro:
durbat!
Design Philosophy
Unlike hybrids that graft foreign prefixes onto English identifiers, durbat uses pure Black Speech throughout.
Preferred:
nakh(insert)Zud::Gakh(std::collections)
Avoid:
snagainsert(hybrid)std::collections(when Black Speech is intended)
Every keyword is a standalone, pronounceable Black Speech word with guttural consonants (gh, sh, kh, z, r, k) that feel authentically orcish.
Inspiration
- J.R.R. Tolkien's The Lord of the Rings and the Black Speech language
- unirust - Rust in multiple languages
License
MIT License
Copyright (c) 2025 Fox Studio (Oskar Cieslik)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Legal Notice
This project is a playful homage to J.R.R. Tolkien's legendarium. It is not affiliated with or endorsed by the Tolkien Estate. All Black Speech terms are used nominatively.
Contributing
Contributions are welcome. Propose additional Black Speech translations or improvements that preserve the guiding principle: pure, pronounceable Black Speech terms mapped consistently to Rust semantics.