-
Notifications
You must be signed in to change notification settings - Fork 118
experiment: simple stable functions (merged) #5476
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
Draft
crusso
wants to merge
46
commits into
master
Choose a base branch
from
claudio/simple-stable-functions-merged
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
…:dfinity/motoko into claudio/simple-stable-functions-dynamics
… used by deserialization
…g stable_funcs and allocating proxy
… for other flavours)
…#5470) * copy stable_variant.rs to stable_closure.rs * WIP * implemenet graph stabilization for stable closures
…ic test to be implemented)
…generic stable functions and graph copy (#5498) * WIP * one bug * fix bug (inconsistent encodings) * test for contravariant method update * now I geddit * remove todo * add support for scope_binds * fix * add missing test results * update test output * refactor deserialization to check actual label * fix eop compilation * fix subtle type comparison bug (stable sorts need to compare the labels) * fix broken test * Updating `test/bench` numbers * adjust comment * fix broken, negated assert --------- Co-authored-by: Cycle and memory benchmark updater <41898282+github-actions[bot]@users.noreply.github.com>
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.
Simpler stable functions
Advantages:
Disadvantages (over original stable functions)
C <: Cmp<T>
) below, requiring explicit instantiation, e.g.Set.empty<Int, Cmp>(cmp)
vsSet.empty(cmp)
.Abbreviations can help, but better would be some mechanism like
^cmp
(type_of)Set.empty<Int, ^cmp>(cmp)
vsSet.empty<Int, shared cmp (T,T) -> Order>(cmp)
.Simplest might be the implicit definition of type
type cmp = shared cmp (T, T) -> Order
fromstable func cmp
.Similar to what we do for classes, that define both a type and a value.
Dynamics:
Local
functionsTODO:
Our indirect function calls are now more expensive.
compare
as typecompare
(=stable compare (Nat, Nat) -> Order.Order
) (but beware of existing class punning, sigh)4
) should also include name hash for safe comparison (and generics)