3 ms·
Many languages have some kind of macro or codegen system that allows serializing or deserializing based on type definitions. Eg (pseudocode): @deriving(jso
by yawaramin 2y ago
Many languages have some kind of macro or codegen system that allows serializing or deserializing based on type definitions. Eg (pseudocode):
@deriving(json)
class Person:
id: int
name: str
Would give you something like:
def parse(s: str): Person: ...
def print(p: Person): str: ...
- __MatrixMan__ 2y agoI see, thanks. I thought maybe we were talking about the choice of json vs something else being automatic and chosen at runtime.