Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substructural typing for Phi stuff #1269

Open
andrew-johnson-4 opened this issue Feb 17, 2025 · 1 comment
Open

Substructural typing for Phi stuff #1269

andrew-johnson-4 opened this issue Feb 17, 2025 · 1 comment

Comments

@andrew-johnson-4
Copy link
Owner

andrew-johnson-4 commented Feb 17, 2025

type phi nodrop PointerLifetime = Live | Dead;

Here, for this Phi type, we specify with "nodrop" that the Phi type should not be removed by simply weakening a conjugate type during unification. This mostly affects library development, where accidentally dropping this type would cause a soundness hole.

@andrew-johnson-4
Copy link
Owner Author

type phi nodrop SafePointer = Live | Dead;

let unsafe-weaken(x: t[]+Phi<SafePointer::Weaken>): t[];

These objects are still "just pointers", but they now have ownership tracking thanks to the attached Phi type.

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

No branches or pull requests

1 participant