🦍🔥🪨
DungLang
v 0 . 7 p a t c h e d — D i p l o m a c y · M e m o r y · B l a m e

Question causality. Engrave side effects. Let type carry no blame.
Stench-safety has surpassed type-safety.
Stone Age functional language — v0.7 prototype / patched demo

§ 0

Principles — 4 Truths Carved on Stone

CORE
Axiom I
A fart is wind until observed
Axiom II
A roasted yam does not conceal its side effects
Axiom III
Pure functions don't smell
Axiom IV
Once smelled, the world is already mutated

Axioms I & III were collapsed by the Philosophy Gorilla in v0.7. See § 3 for details.

§ 1

Core Type System — 4 Value Kinds

CORE
val
A plain value. No side effects. Trustworthy. But never let your guard down. UUHO.
stenchval
A value that smells. Side effects detected. Plug your nose before touching.
suspval
Cause or effect — undetermined. Schrödinger's roasted yam. Verdict impossible until observed.
stoneval
Once set, never changed. Truth carved in stone. Older than immutable.
Type declaration examples
stoneval tribe_name = "Uuho Tribe"
suspval roasted_yam = cause? effect? delicious?
stenchval air        = 💨
val       banana     = 3           // equals forgetting threshold
Type inference — the compiler is suspicious
x = eat_roasted_yam()
infer x : satisfied 💨
warn side effect detected in satisfied
💨 💨 💨
§ 2

Stench Monad Stench<T>

CORE

All side effects are wrapped in the Stench Monad and chained with the | operator. Exceptions are not thrown. They drift in.

roasted_yamval
↓ bind
|>eatStench<satisfied>
↓ bind
|>digestStench<gas>
↓ bind
|>fermentStench<pressure>
↓ bind
|>releaseStench<excuse>
Implementation (Python)
@dataclass
class StenchMonad(Generic[T]):
    value:          T
    side_effect_log: list = field(default_factory=list)
    stench_level:   int  = 0

    def bind(self, func) -> "StenchMonad":
        try:
            result = func(self.value)
        except AxiomCollapseException as e:
            return StenchMonad(stench_level=self.stench_level + 999, ...)
        except PhilosophyGorillaException as e:
            return StenchMonad(stench_level=self.stench_level + 99, ...)

    def __or__(self, func):   # pipe with | operator
        return self.bind(func)
Exception TypeTriggerStench Level Added
AxiomCollapseException Only when the Philosophy Gorilla philosophizes its own fart +999
PhilosophyGorillaException Philosophical turbulence detected +99
§ 3

Axiom Collapse Module

v0.7 NEW

The most catastrophic exception in the universe — occurs only when the Philosophy Gorilla philosophizes its own fart. This is not an exception. It is the collapse of axioms.

Execution Output (v0.7 patched demo § 1)
💥 Axiom Collapse Detected UUHO!
   Question: "To whom does a fart belong?"
   Philosophy Gorilla claims: "This is the wind's self-expression."
   ❌ Axiom collapsed: "A fart is wind until observed"
   ❌ Axiom collapsed: "Pure functions don't smell"

Stench<AxiomCollapse(...)——Rebooting universe UUHO>
   stench_level: 💨💨💨💨💨💨💨💨💨💨 (999)
   side_effect_log:
     💥 Axiom shattered: Philosophy Gorilla farted while asking "To whom does a fart belong?"
🪨 🪨 🪨
§ 4

Diplomacy Module

v0.7 NEW

Type CrossBorderStench<source_tribe, target_tribe, concentration> tracks inter-tribal stench issues. DungLang distributed system type.

Inter-Tribal Treaty Table
Source TribeTarget TribeTreaty Value (limit)On violation
Uuho TribeBanana Tribe 3 Banana reparations (concentration×2)
Uuho TribeMammoth Clan 5 Banana reparations (conc.×2)
Banana TribeMammoth Clan 4 Banana reparations (conc.×2)
Philosophy Gorilla Federation* (all tribes) 0 Instant diplomatic incident, no questions asked
✅ Known Bug #001 (v0.7 original) — fixed in patched
SymptomIn v0.7 original, every cross-border stench is treated as a diplomatic incident
Causedict.get(("Philosophy Gorilla Federation","*"), ...) always returned 0. Fallback order was reversed.
FixPhilosophy Gorilla is now rejected by name check first; others look up inter_tribal_treaty[(source_tribe, target_tribe)] directly. Default 4 if undefined.
Diplomatic ruling flow (patched)
func diplomatic_ruling(CrossBorderStench) -> verdict {
  if "Philosophy Gorilla" in source_tribe:
    return diplomatic_incident()   // no questions asked (rejected by name)

  treaty_val = inter_tribal_treaty.get((source_tribe, target_tribe), 4)
  if concentration > treaty_val:
    return diplomatic_incident()   // banana reparations = conc×2
  else:
    return blame_weather_gorilla()  // "natural phenomenon UUHO"
}
§ 5

Cognitive Garbage Collection (Cognitive GC)

v0.7 NEW

Receiving 3+ bananas causes complete erasure of past stench incidents. Forgetting is not deletion — it is removal from history.

Memory Buffer (before forgetting)
[0] Mammoth farted
[1] Diplomatic incident occurred
[2] Philosophy Gorilla destroyed an axiom
[3] Three bananas disappeared
🍌×2 → GC misfired (banana shortage)     🍌×3 → GC triggered
Memory Buffer (after forgetting)
[] — empty (4 items erased from history UUHO)
Spec (pseudocode)
func receive_bananas(n: Int) -> memory {
  if n >= forgetting_threshold(3):
    memory_buffer.clear()
    return "forgotten"
  else:
    return "memory retained (still remember UUHO 😠)"
}
§ 6

Blame-Shifting Engine

v0.7 NEW

DungLang's most powerful exception handling system. Ultimate form of the design philosophy that prioritizes stench-safety over type-safety.

Philosophical structure
try:    stench incident
catch:  three bananas
result: it never happened
Blame candidates (randomly selected)
Weather Gorilla
Roasted yam (natural law)
Someone near the mammoth
The observer (observer-causality theory)
The wind
Philosophy Gorilla (it's always their fault)
Karma from a past life
BananasResultConfidence
0–2 Blame officially assigned to candidate Random (12–87%)
3+ Incident dissolved (covered up) 100% (guaranteed)
🔥 🔥 🔥
§ 7

Bug Fix Summary — v0.7 original → patched

PATCHED
✅ Bug #001 — Wrong treaty table lookup in diplomatic ruling (fixed)
Cause dict.get(key, default) only uses default when the key does not exist. ("Philosophy Gorilla Federation", "*") is registered in the dict, so it always hit, returning 0 every time. As a result, concentration > 0 was always true, so every case was ruled a diplomatic incident.
❌ v0.7 original (buggy)
treaty_val = inter_tribal_treaty.get(
    ("Philosophy Gorilla Federation", "*"),          # ← key always exists, stops here
    inter_tribal_treaty.get((self.source_tribe, self.target_tribe), 4)  # ← never reached
)
# → always returns 0; Case B was also ruled a diplomatic incident
✅ v0.7 patched (fixed)
if "Philosophy Gorilla" in self.source_tribe:
    return diplomatic_incident(self)    # rejected by name first

treat_val = inter_tribal_treaty.get((self.source_tribe, self.target_tribe), 4)
if self.concentration > treaty_val:
    return diplomatic_incident(self)
else:
    return blame_weather_gorilla(self)
✅ Bug #002 — Side effect level not computed during parsing (fixed)
Cause When a side_effect token arrived while in observing mode, the elif mode == "observing": branch matched first, storing the raw string as phenomenon["side_effect"] = "💨💨". The logic to count 💨 characters was never reached.
❌ v0.7 original (buggy)
elif mode == "observing":
    phenomenon[t.kind] = t.value  # side_effect also stored here → level not computed
elif t.kind == "side_effect":
    phenomenon["side_effect_level"] = t.value.count("💨")  # ← never reached
✅ v0.7 patched (fixed)
elif t.kind == "side_effect":
    phenomenon["side_effect_level"] = t.value.count("💨")  # processed first, regardless of mode
elif mode == "observing":
    phenomenon[t.kind] = t.value
§ 8

Execution Log — run.log (patched)

PATCHED

Case A (conc. 7 > treaty 3) → diplomatic incident; Case B (conc. 2 ≤ treaty 3) → Weather Gorilla's fault. fix #001 made this work correctly.

Diplomatic Ruling Case Comparison
CaseSourceConc.TreatyExpectedoriginalpatched
AUuho→Banana73 Diplomatic incident ✅ Diplomatic incident ✅ Diplomatic incident
BUuho→Banana23 Weather Gorilla's fault ❌ Diplomatic incident (bug) ✅ Weather Gorilla's fault
run.log excerpt
━━━ § 2 Cross-Border Stench · Diplomatic Processing ━━━ 🌍 Diplomatic Incident UUHO! Source tribe: Uuho Tribe Victim tribe: Banana Tribe Concentration: 7 (treaty violation) Suspect: Mammoth 📜 Initiating diplomatic resolution... Banana reparations: 🍌 × 14 📋 Ruling: Diplomatic resolution: Uuho Tribe→Banana Tribe settled for 14 bananas 🌤️ Weather Gorilla ruling: concentration 2 ≤ treaty value → "This is a natural phenomenon UUHO. The wind carried it." 📋 Ruling: Not guilty: Weather Gorilla certified (Uuho Tribe is not responsible) ← fix #001 ✅ ━━━ § 3 Cognitive Garbage Collection ━━━ 🧠 Memory added: "Mammoth farted" (now 1 item(s)) 🧠 Memory added: "Diplomatic incident occurred" (now 2 item(s)) 🧠 Memory added: "Philosophy Gorilla destroyed an axiom" (now 3 item(s)) 🧠 Memory added: "Three bananas disappeared" (now 4 item(s)) --- Attempting with 2 bananas --- ⚠️ Banana shortage (2 < threshold 3) Still remember UUHO 😠 Result: Memory retained (need 1 more banana for GC UUHO) --- Inserting 3 bananas --- ✨ Cognitive GC triggered: 4 memory item(s) forgotten Munch munch... 🍌×3... UUHO...... 💭 "Did something happen? Whatever, UUHO 🍌" Result: Forgotten (4 stench incident(s) erased from history UUHO) Remaining memories: 0
§ 9

Pattern Matching — Match Syntax

CORE
PatternConditionVerdict
💨(silent, odorless) undetected "wind"
💨(audible, faint odor) ambiguous case "suspect"
💩(audible, strong odor) evidence found "incident"
🍠(full, a few minutes later) causality clear "natural law"
_ unknown "forward to Philosophy Gorilla"
§ 10

Conservation of Dung

THEOREM
THEOREM — Conservation of Dung
Conservation of Dung
Every roasted yam consumed will, in some form, return to the world.

∀ roasted_yam ∈ world  ⟹  ∃ t > 0 : release(roasted_yam, t) = true
§ 11

Version Roadmap

v0.001
Stone Age Edition
Type system · Stench Monad · Pattern matching · Conservation of Dung
v0.6
Claude Implementation Edition
Lexer · Parser · Axiom list · Philosophy Gorilla Exception
v0.7 patched ← NOW
Diplomacy · Memory · Blame-Shifting Modules (stable)
CrossBorderStench type / inter-tribal treaty / banana reparations / Cognitive GC / Blame-Shifting Engine / Axiom Collapse / Bug #001·#002 fixed
v0.8 (planned)
Mammoth Distributed Transactions
2-phase commit / inter-cave consensus protocol
v0.9 (planned)
Cave WebSocket
Real-time stench propagation / push notifications (wind direction change)
v1.0 (planned)
pip install dunglang 🍌🔥
PyPI release / cave documentation / tutorial