-
Notifications
You must be signed in to change notification settings - Fork 105
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
Candid subtyping meta-issue #1523
Comments
(Ideally, discuss the taxinomy here, but discuss the merits of the corresponding proposals there, else this discussion will grow out of proportion.) |
Thanks for this summary. Very helpful. As far as the relational comparison and analysis, I feel a cube-like picture coming on, reminiscent of the lambda cube. Hopefully things are not that complex, though. |
Moved the "evolution-based" idea from Oct to go with the Jan "stateful solutions", since I think it belongs with those other solutions, which subsume it (or at least, #1106 does). |
Here is what Cap'n Proto has to say about possible protocol evolution. They only consider compatibility of representation, and completely ignore the semantic ability to handle the changes. |
Addressed by dfinity/candid#110. |
We have had many attempts at solving the problem of “how to extend records in arguments of Candid functions”, but don’t have an overview (so every new attempts involes some serious github archeology). This issue tries to collect all the different variants we discussed, ideally with links such discussions (obviously tricky when discussion happend in Radiohead). I took the liberty of trying to put a little taxinomy on this.
These variants introduce new types or variants of types. These proposals don't change the basic machinery of subtyping (there is still just one relation), so these proposals all ended being sound but not permissive enough to tick all boxes.
upgraded t
type constructor, withany <: upgraded null
. (upgraded
type constructor for IDL? #364, May 2019)record in { … }
, with all absent fields considerd to have typenull
, andrecord out {…}
with all absent fields having typeany
(the latter is the “normal” case) (Elaboration and some other tweaks #438, first commit, May 2019; also discussed inupgraded
type constructor for IDL? #364)record { new? : text }
), so that records have some some fields with default typenull
and some fields with default typeany
(also discussed inupgraded
type constructor for IDL? #364)In these variants, the user still writes
record { … }
, but effectively this means one of the above based on where the type occurs.record {…}
isrecord in
orrecord out
, depending on position of the next enclosing function arrow (Candid record extension: The asymmetric solution #1509, May 2020, “assymmetric solutionc”)These proposals introduce multiple subtyping relations (e.g.
<:+
and<:-
). Expressive enough, but tend to have soundness issues.Soundness enforced by a dynamic check, very expressive, downside: Very high implementation complexity on all decoders.
opt
based on opportunistic decoding: ([spec] Reverse subtyping candid#110, Oct 2020)opt
: (Spec: Do a subtyping check when decoding candid#168, April 2021)opt
, with subtype check for references (Extensible variants candid#295 (comment), Nov 2021)Meta-theory:
The text was updated successfully, but these errors were encountered: