You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4719 has introduced the (actor, method)-style endpoint references (to obtain the semantics which the compiler has pioneered). But we still have the possibility of non-public shared functions, which are just closures. So when comparing the mixed case can occur and currently this crashes the interpreters.
Two things come to my mind how to salvage this:
where we have an env we could change the pair representation to a raw continuation and pass that down to the comparison
put private dared methods in actor_env too (they cannot be used from extern anyway, as the type system will prevent it). Then we will never have raw continuations around for shared and comparison becomes trivial. Calling them would need the conversion to raw costs.
One thing worth to try out: see "crazy idea" in #4719 comments.
The text was updated successfully, but these errors were encountered:
ggreif
changed the title
interpreters have trouble comparing shared methods when mixd intern/extern
interpreters have trouble comparing shared methods when mixed intern/extern
Oct 14, 2024
…ialisers (#4719)
This PR accomplishes following improvements:
- allow `actor Self { ... Self ... }` in the actor initialiser (similarly for `actor class`)
- ditto for accessing all public methods `Self.method` from the actor initialiser
- accessing these from under lambdas without making the respective methods undefined when using them
The latter should allow setting up timers: `addTimer(b, period, Self.method)` from actor initialiser.
Also fixes the hole in definedness analysis (#4731).
-------------
_NOTES_:
- calling `Self.method` from actor initialiser is prohibited by the capability checker
- accessing `Self.method` from actor initialiser is currently allowed when `method` is not defined yet, and results in a descriptor (pair)
- comparison (in terms of `shared`) of the internal methods with external methods is trapping in the interpreter, but should work in the deployed actor.
There is an idea inside to fix these problems.
----
TODO:
- adapt `renaming.ml`? — nope, I don't have business in IR
- [x] test `actor class` too
- [x] test clashing `Self` — there is already `self-shadow.mo`
- [x] `test/run/issue1464ok.mo` fails — fixed snafu
- [x] deal with `FIXME`s
- [x] `shared` method equality in the interpreters
- [x] `shared` call viability checking (in interpreters)
- [x] fix#4731
- [x] write issue about the mixed (pair/closure) `shared func` comparison problem — here: #4732
- [x] resolve the `Promise.is_fulfilled` problem — #4735
- [x] check the "For actors, this may be too permissive" comment in the code — irrelevant, removed!
- [ ] try out the "crazy idea" mentioned in the feedback
#4719 has introduced the
(actor, method)
-style endpoint references (to obtain the semantics which the compiler has pioneered). But we still have the possibility of non-publicshared
functions, which are just closures. So when comparing the mixed case can occur and currently this crashes the interpreters.Two things come to my mind how to salvage this:
env
we could change the pair representation to a raw continuation and pass that down to the comparisondared
methods inactor_env
too (they cannot be used from extern anyway, as the type system will prevent it). Then we will never have raw continuations around forshared
and comparison becomes trivial. Calling them would need the conversion to raw costs.One thing worth to try out: see "crazy idea" in #4719 comments.
The text was updated successfully, but these errors were encountered: