"New Codable" prototype available for feedback

there is my jss library, which is built atop JavaScriptKit, and provides a serialization-free system for converting structures to and from JavaScript objects.

i am not sure i follow. if anything, the tradeoff is reversed, JSON is the format that requires eager parsing of the entire AST, native JavaScript objects on the other hand give you the opportunity to extract data by key without needing to inspect all other fields of an object.

1 Like

Oh I see. This is a scenario where we have already have an in-memory JavaScript object and we want to decode Swift objects from it. I was thinking along the lines of rewriting the parser to take an unparsed string, pass it to JSON.parse() and then decode from the resulting JavaScript objects. Unless there are JavaScript tricks that I'm not aware of (which could VERY easily be the case, considering my inexperience here), the latter has to fully parse AND allocate objects before the decode even starts.