Skip to content

compilers/compile: own the identifier grammar shared by every compiler #162

Description

@OmarAlJarrah

Every compiler derives IR identifiers, and all three currently do it independently: ids.go exists
in compilers/openapi, in the GraphQL draft (#20), and in the Protobuf draft (#21). What they must
agree on is the grammar — the t/..., op/..., p/... prefixes, and the rule that a minted node
occupies a namespace no source pointer can produce (invariant 3's corollary).

What they must not share is the derivation: a JSON Pointer, a GraphQL path and a protobuf
fully-qualified name are different things and stay in their own compilers.

What to do

Move the grammar and the namespace rule into compilers/compile. Leave OpenAPI pointer arithmetic
and the pointer-to-ID derivation in compilers/openapi.

Acceptance

compilers/openapi derives no identifier except through the framework, and golden output is
byte-identical — this is a move, not a behaviour change.

Part of docs/micro-compiler-design.md §3, and half of #73.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew capability or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions