Skip to content

Conversation

@dvdvgt
Copy link
Collaborator

@dvdvgt dvdvgt commented Oct 23, 2025

Feel free to also add other grievances you have with the language tour. Then we can just bundle them all in one PR.

@dvdvgt
Copy link
Collaborator Author

dvdvgt commented Oct 23, 2025

We might need to update the parts that mention unboxing, since there is no syntax anymore


Functions are second-class in Effekt, but for a good reason. Functions closing over capabilities must not be returned, otherwise it can not be guaranteed that these capabilities are still in scope.
Thus, we have to keep track of these captures and ensure they are in scope upon invoking.
[Computations](/tour/computation), such as functions and objects, are second-class _by default_ in Effekt, but for a good reason.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the "but for a good reason" add anything? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine, since it leads over to the next sentence.

@jiribenes jiribenes added the documentation Improvements or additions to documentation label Oct 29, 2025
@kyay10
Copy link

kyay10 commented Nov 4, 2025

We might need to update the parts that mention unboxing, since there is no syntax anymore

Note that #1172 added back the explicit syntax.

[Computations](/tour/computation), such as functions and objects, are second-class _by default_ in Effekt, but for a good reason.
Since computations can capture capabilities, they can only be used where those capabilities remain in scope.
For statically preventing capabilities from escaping their valid scope, Effekt tracks captured capabilities on the type level and verifies they're still in scope upon usage.
We call this mechanism _boxing_ and will discuss in greater details in the next [section](/tour/captures#boxing).
Copy link
Collaborator

@b-studios b-studios Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit misleading IMO. I would rather say something like

Suggested change
We call this mechanism _boxing_ and will discuss in greater details in the next [section](/tour/captures#boxing).
Functions and capabilities can still be treated as first-class values by means of _boxing_, which we discuss in greater details in the next [section](/tour/captures#boxing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants