Skip to content

compilers/protobuf: revive the Protocol Buffers compiler from #21 against the current contract #469

Description

@fuad-daoud

What exists

A complete Protocol Buffers / gRPC compiler was drafted in #21 (branch feat/protobuf-compiler, head 2345b07, +10,170 lines across 67 files). It lowers proto2, proto3 and the 2023 edition through github.com/bufbuild/protocompile: messages and enums into the ID-keyed registry, field numbers onto Property.WireID, oneof as a WireTagged union behind a Flatten wrapper, repeated/map as hoisted containers, the well-known types, extensions and reserved ranges — with a conformance corpus under testdata/conformance/protobuf and goldens under testdata/golden/protobuf. The PR body is the design record; read it before starting over.

It was opened 2026-07-21, last pushed 2026-07-23, and has not been reviewed. README milestone 5 places the Protobuf compiler after AsyncAPI and GraphQL, so this is the tracking issue for that row, not a request to land the draft now.

Why the draft cannot land as it stands

Measured against main at e1e92a0 (166 commits ahead of the draft's base):

What reviving it needs

  1. Rebase is not the shape of the work — start a fresh branch from main and port the lowering, using the draft as the reference for the proto→IR mapping decisions.
  2. Implement Detect (a .proto source is recognisable from syntax = / edition = at the top; bounded sniff, same discipline as compilers/openapi/detect.go).
  3. Lay it out as compilers/protobuf + compilers/protobuf/internal/*, each internal package with its own archtest rules entry; use compilers/compile for naming and IDs rather than a local grammar.
  4. Regenerate the goldens at the current IRVersion and re-derive the conformance matrix witnesses (docs/ir-spec-matrix.md row keys) for the rows Protobuf can express.
  5. Run the full oracle sweep: go run ./cmd/morphic-harness testdata/conformance/protobuf.

Decision needed

Whether #21 stays open as a draft or is closed with this issue as its pointer. Either way the branch should not be deleted — the design work in it is the asset.

Refs #21.

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