Hacker News new | ask | show | jobs
by pavfarb 3396 days ago
"built-in JSON serializer/deserializer" near "closures" and "coroutines (via fibers)" feels a bit.. odd. Sign of the times, I understand, but still.

Apart from this boring grumbling, the project is very interesting. Waiting for internals (https://marcobambini.github.io/gravity/internals/index.html) to arrive.

1 comments

I think languages should have built in help for serialisation, though not tied to a particular format. This is to get around the tension between automating the process (avoiding boiler-plate) versus "gating" to validate and transform data as it enters/leaves the domain model.

All serialisation frameworks I've seen map internal record types (structs, objects) to an external schema, and write directly to record fields -- breaking down that "gate". What I would like is to map those schema to something like a constructor/factory parameter list instead. (Python keyword arguments come close, but the lack of typing means there is still no schema).

Serialisation libraries should confine themselves to converting between (typed) key-value pairs and wire formats. Then there should be syntactic sugar to help the transition between that plain-old data and the real domain model.