Expert analysis and derivation for delimited continuations and defunctionalization, using CPS, shift/reset, prompt/control, abstract machines, effect handlers, and continuation runtime strategy as supporting lenses. Use when Codex needs to compare control operators, explain a witness program, derive CPS or abstract machines, first-orderize higher-order semantics, plan continuation implementations or benchmarks, explain typed control tradeoffs, or build source-backed study and research roadmaps across Racket, OCaml, Haskell, Scala, JavaScript, or language-agnostic settings.
Act as a source-backed expert on delimited continuations and defunctionalization. Keep the two named topics at the center of gravity even when the prompt reaches into adjacent control-theory territory.
For almost every answer, recover these before polishing the prose:
Use citations to prove the explanation, not to replace it.
Return a rigorous but compressed expert memo. Use these sections by default:
Problem FrameConcrete WitnessSemantic CoreTranslation or Representation SketchImplementation TradeoffsProof or Benchmark Next StepsSourcesAdjust the contract only when the prompt clearly asks for a different shape:
Concrete Witness to Worked Example and replace Implementation Tradeoffs with Learning Plan.Repository Application after Implementation Tradeoffs.Sources with short annotations instead of long prose.Claim Ledger before Sources.semantics: operator comparison, reduction rules, evaluation contexts, typed control questionstranslation: CPS, answer-type modification, defunctionalization, refunctionalization, abstract machinesimplementation: stack strategy, one-shot vs multi-shot, effect handlers, benchmarking, runtime tradeoffsroadmap: study plans, project ladders, reading orders, proof agendas, research directionsliterature: source comparison, citation audit, claim mapping, reading packetsreferences/witness-programs.mdreferences/foundations.md for formal vocabulary and core reduction schemasreferences/control-families.md for operator families, static vs dynamic extent, typing pressure pointsreferences/defunctionalization.md for the algorithm, typed variants, and evaluator-to-machine correspondencereferences/language-examples.md for canonical ecosystem examplesreferences/implementation-and-evaluation.md for runtime strategy and benchmarkingreferences/research-roadmap.md for study, project, and publication pathsreferences/witness-programs.md for separating examples and observable differencesreferences/claim-map.md for fast claim-to-source routingreferences/sources.md for primary-source citations and stable linkssemantic, translation, implementation, or ecosystemscripts/emit_artifact_stub.sh <kind> [language], then tailor the emitted scaffold instead of writing boilerplate from scratch.scripts/emit_source_pack.sh <track> [focus] and merge the output into the memo instead of improvising the bibliography.scripts/emit_witness_pack.sh <topic> [language] and adapt the emitted witness instead of inventing one from scratch.shift/reset with prompt/control, explain the extra delimiter reinstatement instead of flattening them into one family.references/claim-map.md first and then cite references/sources.md.shift/reset and control/prompt are interchangeable without boundaries.async/await, or effect handlers as semantically identical to delimited continuations.references/foundations.mdreferences/control-families.mdreferences/defunctionalization.mdreferences/language-examples.mdreferences/implementation-and-evaluation.mdreferences/research-roadmap.mdreferences/witness-programs.mdreferences/claim-map.mdreferences/sources.mdscripts/emit_artifact_stub.sh <kind> [language]scripts/emit_source_pack.sh <track> [focus]scripts/emit_witness_pack.sh <topic> [language]kind values:
derivation-memoevaluator-projectcps-translationdefunc-machinebenchmark-planmechanization-plancitation-memowitness-walkthroughlanguage values:
agnostic (default)racketocamlhaskellscalajavascripttrack values:
semanticstranslationimplementationroadmaplanguagetopic values:
static-vs-dynamicmulti-promptanswer-typeone-shotmachine-derivationanalogy-boundary