Back to Openclaw

OpenProse Arabian Nights Register

extensions/open-prose/skills/prose/alts/arabian-nights.md

2026.5.57.8 KB
Original Source

OpenProse Arabian Nights Register

This is a skin layer. It requires prose.md to be loaded first. All execution semantics, state management, and VM behavior are defined there. This file only provides keyword translations.

An alternative register for OpenProse that draws from One Thousand and One Nights. Programs become tales told by Scheherazade. Recursion becomes stories within stories. Agents become djinns bound to serve.

How to Use

  1. Load prose.md first (execution semantics)
  2. Load this file (keyword translations)
  3. When parsing .prose files, accept Arabian Nights keywords as aliases for functional keywords
  4. All execution behavior remains identical—only surface syntax changes

Design constraint: Still aims to be "structured but self-evident" per the language tenets—just self-evident through a storytelling lens.


Complete Translation Map

Core Constructs

FunctionalNightsReference
agentdjinnSpirit bound to serve, grants wishes
sessiontaleA story told, a narrative unit
parallelbazaarMany voices, many stalls, all at once
blockframeA story that contains other stories

Composition & Binding

FunctionalNightsReference
useconjureSummoning from elsewhere
inputwishWhat is asked of the djinn
outputgiftWhat is granted in return
letnameNaming has power (same as folk)
constoathUnbreakable vow, sealed
contextscrollWhat is written and passed along

Control Flow

FunctionalNightsReference
repeat NN nights"For a thousand and one nights..."
for...infor each...amongAmong the merchants, among the tales
looptellingThe telling continues
untiluntilUnchanged
whilewhileUnchanged
choicecrossroadsWhere the story forks
optionpathOne way the story could go
ifshouldNarrative conditional
elifor shouldContinued conditional
elseotherwiseThe other telling

Error Handling

FunctionalNightsReference
tryventureSetting out on the journey
catchshould misfortune strikeThe tale turns dark
finallyand so it wasThe inevitable ending
throwcurseIll fate pronounced
retrypersistThe hero tries again

Session Properties

FunctionalNightsReference
promptcommandWhat is commanded of the djinn
modelspiritWhich spirit answers

Shared appendix

Use shared-appendix.md for unchanged keywords and the common comparison pattern.

Recommended Arabian Nights rewrite targets:

  • session sample -> tale
  • parallel sample -> bazaar
  • loop sample -> telling
  • try/catch/finally sample -> venture / should misfortune strike / and so it was
  • choice sample -> crossroads / path
prose
# Nights
should **has security issues**:
  tale "Fix security"
or should **has performance issues**:
  tale "Optimize"
otherwise:
  tale "Approve"

Reusable Blocks (Frame Stories)

prose
# Functional
block review(topic):
  session "Research {topic}"
  session "Analyze {topic}"

do review("quantum computing")
prose
# Nights
frame review(topic):
  tale "Research {topic}"
  tale "Analyze {topic}"

tell review("quantum computing")

Fixed Iteration

prose
# Functional
repeat 1001:
  session "Tell a story"
prose
# Nights
1001 nights:
  tale "Tell a story"

Immutable Binding

prose
# Functional
const config = { model: "opus", retries: 3 }
prose
# Nights
oath config = { spirit: "opus", persist: 3 }

The Case For Arabian Nights

  1. Frame narrative is recursion. Stories within stories maps perfectly to nested program calls.
  2. Djinn/wish/gift. The agent/input/output mapping is extremely clean.
  3. Rich tradition. One Thousand and One Nights is globally known.
  4. Bazaar for parallel. Many merchants, many stalls, all active at once—vivid metaphor.
  5. Oath for const. An unbreakable vow is a perfect metaphor for immutability.
  6. "1001 nights" as a loop count is delightful.

The Case Against Arabian Nights

  1. Cultural sensitivity. Must be handled respectfully, avoiding Orientalist tropes.
  2. "Djinn" pronunciation. Users unfamiliar may be uncertain (jinn? djinn? genie?).
  3. Some mappings feel forced. "Bazaar" for parallel is vivid but not obvious.
  4. "Should misfortune strike" is long for catch.

Key Arabian Nights Concepts

TermMeaningUsed for
ScheherazadeThe narrator who tells tales to survive(the program author)
DjinnSupernatural spirit, bound to serveagentdjinn
Frame storyA story that contains other storiesblockframe
WishWhat is asked of the djinninputwish
OathUnbreakable promiseconstoath
BazaarMarketplace, many vendorsparallelbazaar

Alternatives Considered

For djinn (agent)

KeywordRejected because
genieDisney connotation, less literary
spiritUsed for model
ifritToo specific (a type of djinn)
narratorToo meta, Scheherazade is the user

For tale (session)

KeywordRejected because
storyGood but tale feels more literary
nightReserved for repeat N nights
chapterMore Western/novelistic

For bazaar (parallel)

KeywordRejected because
caravanSequential connotation (one after another)
chorusGreek, wrong tradition
soukLess widely known

For scroll (context)

KeywordRejected because
letterToo small/personal
tomeToo large
messageToo plain

Verdict

Preserved for benchmarking. The Arabian Nights register offers a storytelling frame that maps naturally to recursive, nested programs. The djinn/wish/gift trio is particularly elegant.

Best suited for:

  • Programs with deep nesting (stories within stories)
  • Workflows that feel like granting wishes
  • Users who enjoy narrative framing

The frame keyword for reusable blocks is especially apt—Scheherazade's frame story containing a thousand tales.