Skip to main content

First emitters

Phase C of the roadmap delivered the first official emitters (transpilers) for AI Parlance. They live in the monorepo as Preview targets — not npm-published packages yet, but real AST → artifact pipelines you can run with aip emit. Phase D deepens TypeScript, OpenAPI, and PostgreSQL toward a runnable happy path (see ROADMAP).

What “first transpiler” means here

Historically, the marketing site only had an illustrative playground. The language was specification-only. With Phase C M3–M6 and the matrix follow-up, the project ships ten Preview emitters from one validated AST: PostgreSQL was the first emitter because the docs treat it as the primary SQL target. OpenAPI, TypeScript, and Go completed the first multi-target wave; MySQL and the remaining matrix targets followed as Preview MVPs. Together with aip parse and aip validate (Core + Infra + Security + Behavior), this is the reference toolchain.

Pipeline

One validated spec feeds all Preview emitters. Naming (snake_case, FK *_id, plural tables) stays aligned across SQL targets, OpenAPI, and Go json tags.

What each emitter produces

PostgreSQL (aip emit sql)

  • CREATE EXTENSION IF NOT EXISTS pgcrypto
  • CREATE TABLE per entity (implicit id, timestamps; deleted_at when soft_delete)
  • Types, UNIQUE / NOT NULL, enum CHECKs, belongs_to foreign keys
  • CREATE INDEX from index blocks; INSERT from seed blocks
Golden: transpilers/sql/fixtures/minimal.sql

OpenAPI 3 (aip emit openapi)

  • Schemas Entity / EntityCreate / EntityUpdate
  • CRUD paths when crud Entity is declared (honors api.prefix)
  • Optional securitySchemes from app.auth
Golden: transpilers/openapi/fixtures/minimal.openapi.json

TypeScript (aip emit typescript)

  • Interfaces Entity / EntityCreate / EntityUpdate
  • Runtime type guards (isEntity, isEntityCreate) — zero runtime deps
  • Thin entityPaths helpers when CRUD is present

Go (aip emit go)

  • Structs with json tags; thin net/http CRUD stubs; AuthMiddleware from app.auth

MySQL (aip emit mysql)

  • MySQL DDL for specs with database mysql (see examples/mysql-minimal.aip)

Workers / Python / PHP / Docs / Tests

MVP stubs from jobs/queues, dataclasses, classes, Markdown API refs, and CRUD fixtures — all Preview depth. See the transpiler matrix.

Try it in one minute

Full install and a complete CRUD story: Get started here · CRUD walkthrough.

Honest limits (v0.1 Preview)

  • Language remains draft; emitter depth varies by target (MVP stubs vs richer SQL/OpenAPI).
  • Full-tier examples parse and validate; not every Behavior/Security detail is reflected in every emitter yet (Phase D deepens TS / OpenAPI / SQL).
  • No Nest/Express/Chi lock-in — TypeScript and Go emits stay thin (stdlib / interfaces).
  • Site playground is still illustrative and must not be confused with these packages.
Matrix status: Specification § Transpiler matrix. Per-emitter scores: Emitters. Roadmap: Phase D.