Skip to content

Compilers

Compilers are xtyle’s integration surface. Where xript has runtimes that execute scripts, xtyle has compilers that translate definitions into consumer-specific output.

A compiler reads a resolved xtyle definition (inheritance already applied) and produces output for a specific consumer.

The spec defines:

  1. The input contract — what a resolved definition looks like
  2. The compiler interface — how a compiler declares what it consumes and produces
  3. Nothing about the output format — that’s the compiler’s business
CompilerConsumesProduces
CSSVisualCustom properties
TailwindVisualtailwind.config preset
WordPressVisual + Verbaltheme.json + template strings
LLM PromptVerbal + VoiceSystem prompt / voice instruction
Brand PDFAll threeFormatted brand guidelines
interface XtyleCompiler {
name: string;
consumes: ("visual" | "verbal" | "voice")[];
produces: string;
compile(definition: ResolvedXtyleDefinition): CompilerOutput;
}

The xtyle project ships a small set of reference compilers:

  • CSS — visual tokens to CSS custom properties (available now)
  • Tailwind — visual tokens to Tailwind preset (planned)
  • LLM Prompt — verbal + voice to system prompt (planned)

Everything else is community territory.