Skip to content

selfhost(cgen): port closure environment records to Flow (#680) - #887

Merged
godofecht merged 1 commit into
mainfrom
harvest/680-closure-env
Sep 12, 2026
Merged

godofecht merged 1 commit into
mainfrom
harvest/680-closure-env

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Closes #680. Ports closure environment records to the self-hosted C generator (compiler/src/cgen.flow): env-struct compound literals for capturing lambdas, captured-variable access via the _env pointer, and env-as-leading-argument on closure calls. Bootstrap regenerated; the fixed-point check and bootstrap_from_c.sh --verify both pass (compiler is self-reproducing).

Implement closure environment records in the self-hosted C generator:
emit env-struct compound literals for lambdas with captures, access
captured variables through the _env pointer, and pass the environment as
the leading argument on closure calls. Bootstrap regenerated; fixed-point
check and bootstrap_from_c --verify both pass (self-reproducing).

Co-Authored-By: Claude <[email protected]>
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.

[Self-Hosting Phase 1] Port Closure Environment Records and Uniform Calling Convention

1 participant