Skip to content

fix(checker): preserve Ard ownership in Go interfaces - #341

Merged
akonwi merged 2 commits into
mainfrom
fix/338-go-interface-conversion
Jul 25, 2026
Merged

fix(checker): preserve Ard ownership in Go interfaces#341
akonwi merged 2 commits into
mainfrom
fix/338-go-interface-conversion

Conversation

@akonwi

@akonwi akonwi commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • define Go interface conversion semantics in proposed ADR 0056 and a durable Go interface reference
  • accept Ard-owned values and mutable references consistently in Ard and direct Go call paths
  • box W values into interface-owned storage when Go requires *W, while preserving identity for mut W
  • carry explicit value, owned-pointer, and existing-reference modes through checker, AIR, and Go lowering
  • preserve mutable-reference provenance independently from binding-slot reassignability

Semantics

Ard source Go interface payload Mutation target
W owned value or compiler-owned *W box interface-owned copy
reassignable slot containing W same as W interface-owned copy
mut W existing *W reference original referent
explicit mut <place> existing *W reference original place

The dynamic Go type remains observable: value-receiver implementations use dynamic W for value sources and *W for reference sources; pointer-required implementations use *W.

Validation

Ard compiler

  • go test ./... -count=1
  • gopls check on changed Go files (only pre-existing redundant break diagnostics)
  • two-pass code review with no remaining correctness or security findings

Downstream Ard projects

  • Dram: check, 32 Ard tests, API visibility, HTTP/SSE smoke, Hello build, AI Chat build and Go tests
  • Decode: format check and 9 Ard tests
  • SQL: 6 Ard tests and Go tests
  • Tinear: check, 36 Ard tests, and standalone build
  • Maestro server: check, 46 Ard tests, Go tests, server build, and 35 Bun API integration tests

Formatting checks identified pre-existing differences in dram.ard, sql.ard, and Maestro server Ard files; no downstream files were modified.

Fixes #338

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ard-lang-dev Building Building Preview Jul 25, 2026 3:21am

@akonwi
akonwi merged commit aae30ac into main Jul 25, 2026
6 checks passed
@akonwi
akonwi deleted the fix/338-go-interface-conversion branch July 25, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Direct Go calls reject mutable Ard implementations of Go interfaces

1 participant