Skip to content

Expose a deterministic typed HIR dump for compiler diagnostics #772

Description

@LunaStev

Motivation

Available debug outputs expose tokens, syntax AST and backend IR but not a deterministic view of TypedProgram facts. Conversion order, computation types and source spans are difficult to inspect independently of LLVM.

Starting points: front/parser/src/hir.rs, src/runner.rs, src/flags.rs.

Scope

Expose a diagnostic typed-HIR dump containing stable expression IDs, resolved/context/result types, ordered conversions and spans. Exclude process pointer addresses and unstable map iteration. This is not the compiled-library format in #165.

Difficulty: medium.

Completion criteria

  • Provide deterministic output for repeated identical input.
  • Cover ordered conversions, grouped expressions, variants and source spans with snapshots.
  • Allow inspection before backend lowering and report invalid HIR clearly.

Design decision needed: Agree on a development-only textual format versus versioned JSON and its compatibility expectations.

Please mention @LunaStev to discuss the design before starting implementation.

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

    discussionIssues that require a technical or community discussion.enhancementA request for a new feature or improvement.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions