feat: capability system Layers 1-4 — effect signatures, fine-grained capabilities, affine types, effect handlers#130
Open
gke0op wants to merge 3 commits into
Open
Conversation
|
@gke0op is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Implements all 4 layers of the capability system design (issue vercel-labs#84): - Layer 1: Effect signatures (raises<io, fs, net>) - Layer 2: Fine-grained capabilities (world.fs(), world.net(), etc.) - Layer 3: Affine capabilities (no duplication, CAP001 diagnostic) - Layer 4: Effect handlers (effect decl + with handledBy expr) Plus declaration-based capabilities for extensibility. Rebased cleanly on v0.1.3 (origin/main).
f791a5d to
0dd7b13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements all 4 layers of the capability system design (issue #84), rebased cleanly on latest main (v0.1.3 + TypeScript migration).
Layer 1 — Effect Signatures:
raises<io, fs, net>syntax for static effect information.Layer 2 — Fine-Grained Capabilities:
world.fs(),world.net(), etc. derive capability types from World. Removed ambient authority (std.fs.host(),std.net.host()).Layer 3 — Affine Capabilities: Capability types are affine — no duplication, no global storage. CAP001 diagnostic.
Layer 4 — Effect Handlers:
effect Http { fun fetch(...) -> T }declarations andwith Http handledBy { ... }handler expressions. EFF001 diagnostic.Elegance Improvements:
capability Fs,capability Net, etc.)type_is_capability()z_free_program()Changes
40 files changed across compiler (zero.h, checker.c, ir.c, main.c, parser.c, lexer.c), conformance tests, examples, docs, and scripts.
Testing
world.fs()instead ofstd.fs.host()Replaces
This PR replaces the previous separate PRs (#86, #90, #94, #99, #117) which had merge conflicts.