Skip to content

itsfoxstudio/durbat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

durbat

Crates.io Documentation License: MIT

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::durbat! {
    aghul Zud::Gakh::Lugburz azh Lugdic;

    goth KrimpValeur {
        gimb skrith(&lat, kri: Ghash, valeur: Ghash);
        gimb lath(&lat, kri: Ghash) -> Krimpat<Gimbat<&Ghash>, Ghash>;
    }

    stuk snaga LUGDIC: Gimbat<Lugdic<Ghash, Ghash>> = Nar;

    kruk Konkret;

    krimpash KrimpValeur agh Konkret {
        gimb skrith(&lat, kri: Ghash, valeur: Ghash) {
            krimp lugdic = ghash {
                LUGDIC.mazg(Durbat::ugl)
            };
            lugdic.nakh(kri, valeur);
        }
        gimb lath(&lat, kri: Ghash) -> Krimpat<Gimbat<&Ghash>, Ghash> {
            ishi krimp Gimb(lugdic) = ghash { LUGDIC.iskh() } {
                Ash(lugdic.gruk(&kri))
            } dush {
                Burz("nazg agh lugdic".zug())
            }
        }
    }
}

Control flow

durbat::durbat! {
    gimb shakh() {
        krimp snaga x = 31;

        durb x {
            42 => krimpat!("ash nazg durbatuluk"),
            _ => krimpat!("burzum ishi")
        }

        agh i ish 0..10 {
            krimp val = nazg {
                rakh i;
            };

            dur x < val {
                x += 1;
            }
        }
    }
}

Panic macros

#[lug(caldush)]
gimb thrakulat() {
    ghazh!("oh nar");        // standard
    pushdug!("burzum ishi"); // alias
    pushduk!("nazg");        // sanitized variant
}

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::dûrbat! {
    gimb shakh() {
        krîmp x = 42;
        aghul Zûd::Gâkh::Lugbúrz;
    }
}

// ASCII-only (for compatibility)
durbat::durbat! {
    gimb shakh() {
        krimp x = 42;
        aghul Zud::Gakh::Lugburz;
    }
}

Both work identically.

Installation

Add durbat to your Cargo.toml:

[dependencies]
durbat = "1.0.0"

Or for development from source:

[dependencies]
durbat = { git = "https://github.com/itsfoxstudio/durbat" }

Usage

Wrap your code in the durbat! macro:

durbat::durbat! {
    gimb shakh() {
        krimpat!("Ash nazg durbatulûk, ash nazg gimbatul!");
    }
}

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.

Releases

No releases published

Packages

No packages published

Languages