bearcove / merde

Data (de)serialization via declarative macros
Apache License 2.0
90 stars 4 forks source link

Avoid recursive interfaces #64

Open fasterthanlime opened 2 weeks ago

fasterthanlime commented 2 weeks ago

To be able to deserialize deeply nested records, and also to have "filter" functionality: digging deep into a document, only deserializing what you need from it, not the whole thing, something serde doesn't really let you do.

fasterthanlime commented 1 week ago

So I haven't fully realized the idea yet, but as of #75 the actual deserialize methods are asynchronous, which means we could return Poll::Pending in the middle of everything to avoid overflowing the stack, stash that future somewhere, continue with another future (for deeper deserialization), and resume the other one when we're done.

I think. I need to think more about, uh, how the whole thing would be implemented, because the future that yields would need to give information to the waker on: what type to deserialize, where to deserialize it.

Worth experimenting with further later.