Skip to content

serde2 lightning round#659

Merged
lucix-aws merged 2 commits into
feat-serde2from
feat-serde2-lightninground
May 12, 2026
Merged

serde2 lightning round#659
lucix-aws merged 2 commits into
feat-serde2from
feat-serde2-lightninground

Conversation

@lucix-aws
Copy link
Copy Markdown
Contributor

  • normalize protocol interface
    • generate ServiceSchema like we do for operations, this allows us to get rid of a context lookup as well
    • all protocol constructors now take options, though they are unused atm
    • i've removed the "Codec" concept for now, I'm not sure what the story is on customers actually providing their own Codecs, since ours should be more or less the most performant possible in the context of generated code. They can still override the protocol if they wanted to. We can very easily expose Codec on protocol options in the future if we chose to.
  • do querycompatible in jsonrpc
  • trait and protocol IDs are now ShapeID
  • awsjson10 -> awsjson (since it exposes both 10 and 11)
  • dedupe the serde stack code that everything uses
  • some latent protocol test failures around httpbinding:
    • deserializers we re-implementing the read in ReadXPtr outside of bindings, it needs to delegate to the body codec
    • missed a payload case in reading strings

@lucix-aws lucix-aws requested review from a team as code owners May 11, 2026 22:16
@lucix-aws
Copy link
Copy Markdown
Contributor Author

relates #458

@Madrigal
Copy link
Copy Markdown
Contributor

I'm not sure what the story is on customers actually providing their own Codecs, since ours should be more or less the most performant possible in the context of generated code.

General comment, but I'm not sure if this is true. We use standard library decoding which has shown to not be the most performant. We now have a different story for it which may make it faster, but we're still using stdlib components. I agree that we may not want to expose this until we have a better story for it, but I'd phrase it more for "let's wait to see what people want" rather than saying "we will always have the most performant thing".


values url.Values
stack []serCtx
stack serde.Stack[serCtx]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

praise: I prefer this style

Comment thread internal/serde/stack.go
// Pop removes and returns the top value.
func (s *Stack[T]) Pop() T {
v := s.values[len(s.values)-1]
var zero T
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this to prevent memory leaks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, i only caught onto this recently, towards the top of https://go.dev/wiki/SliceTricks it talks about this. for scalars it doesn't matter but with generics that could be pointers it would.

@lucix-aws
Copy link
Copy Markdown
Contributor Author

I meant in the post-serde2 world, where our json and cbor are purpose-built for our implementations and should basically be as good as it gets. For XML technically we are handwaving that and just using the "less-performant" stdlib impl since AWS services are getting away from it. But someone might care.

I mostly am interested in not exposing codec config on the initial release just because I like being minimal with API surface changes, and someone technically can still override the serde if they just roll their own protocol impl but ofc they'd have to dupe some stuff.

@lucix-aws lucix-aws merged commit dcbbe19 into feat-serde2 May 12, 2026
1 check passed
@lucix-aws lucix-aws deleted the feat-serde2-lightninground branch May 12, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants