-
Notifications
You must be signed in to change notification settings - Fork 50
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
have the spec and implementations agree on how tuple reprs support optional fields #369
Comments
The alternative is to keep the current spec and remove support for trailing optionals in both codegen and bindnode. I don't have a strong opinion there, but if they are already implemented, it's not hard to keep them. And one can argue that users may already be relying on them. Also: the schema package ought to enforce whatever rule we end up with, be it "optionals only as trailing fields" or "no optionals". |
Repeating what I added to #368:
Its this ambiguity problem I'm most keenly interested in as I think about it more, that kind of ambiguity doesn't exist with maps when matching data forms to schemas. The rules are clear, but it's kind of mushy when eyeballing data. 🤷 . I'd be willing to bet nobody is actively using this anywhere yet and the pain of removing it would be minimal. However, it might buy us use within the Filecoin chain as it goes modifying all its tuples over time. |
Retitled to clarify that this issue is about making all the bits agree, whatever the solution we agree to. |
The brunt of the reasoning I'd use here is evolvability vs unevolvability. Tuple reprs shouldn't induce that degree of unevolvability. One could argue for more features than that -- say, non-greedy matching, even if only back-to-front order or such, or etc -- but I'll note immediately that the arguments for that would become significantly weaker:
|
The implementation at
go-ipld-prime/schema/gen/go/genStructReprTuple.go
Line 13 in e39d20b
However, the current spec at https://ipld.io/docs/schemas/features/representation-strategies/#struct-tuple-representation says:
For now, bindnode follows codegen; see #368.
We should probably adjust the docs to agree with the codegen. cc @warpfork @rvagg
The text was updated successfully, but these errors were encountered: