tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

compiler-protocol.ts (891B)


      1 // Private JS checkpoint protocol for conformance tests only.
      2 import type { RuntimeStats } from '../runtime-backends.js';
      3 import type { GraphCheckpoint, NodeId } from '../graph.js';
      4 import type { OutputType } from '../codecs.js';
      5 import type { RequestId, WorkerMessage } from '../protocol.js';
      6 export interface CompiledDraft { graph: GraphCheckpoint; exports: Array<[string, NodeId]>; }
      7 export type CompilerClient = { type: 'compile'; source: unknown; environment?: string }
      8   | { type: 'restore'; draft: CompiledDraft }
      9   | { type: 'run'; export: string; arguments: unknown; expression?: string; output: OutputType; mode: 'pure' | 'io'; step: boolean }
     10   | { type: 'resume'; id: RequestId; value?: string };
     11 export type CompilerMessage = Exclude<WorkerMessage, { type: 'loaded' }>
     12   | { type: 'compiled'; names: string[]; draft?: CompiledDraft; stats: RuntimeStats; milliseconds: number };