Hacker News new | past | comments | ask | show | jobs | submit login

No runtime necessary, if I understand the problem.

Input is bytes. Bytes will never carry their type information (and if they did, you couldn't trust them). So the type information needs to be used in the Deserialiser, not its input.

To get typed deserialisation of Foo, the compiler needs to generate a FooDeserialiser automatically for you. The compiler can't depend directly on Foo (Foo is written after the compiler), but if Foo could somehow emit its type information during compilation, then the compiler could depend on that.




Then I'm all in. I thought something done at runtime dynamically, instead of statically genereting type information at compile time.

It'd be lovely the way you described.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: