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

Implement shearing of unrequested definitions #2128

Open
tstirrat15 opened this issue Nov 8, 2024 · 0 comments
Open

Implement shearing of unrequested definitions #2128

tstirrat15 opened this issue Nov 8, 2024 · 0 comments

Comments

@tstirrat15
Copy link
Contributor

Part of #2127
See a trial implementation in #2121.

There's still ongoing conversation about whether imports should be implicit or explicit. Basically, if you have a structure like:

// root.zed
from .group import group

definition resource {
  relation group: group
  permission view = group->member
}

// group.zed
definition user {}

definition group {
  relation user: user
  permission member = user
}

Should the user definition be brought in implicitly because it's referenced by group, or should it be excluded because it wasn't explicitly requested by the import?

We've mostly been having the discussion in terms of whether a definition is an implementation detail (as it would be in most programming languages) or a part of the externally-facing API (which would push towards being more explicit).

#2121 implements the explicit approach; the implicit approach would need to happen in a post-compilation optimization step that uses the reachability graph to understand which definitions are related to each other.

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