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

> tl;dr: runtime.Object is a type used for serializing messages in RPC calls. Deserializing the type requires a type lookup through a registry. Generics would not solve this issue, so the OP's entire point really doesn't make sense.

And generics would allow compile-time safe checks for serialization. Easy rebutal to merovius post. I don't see how more type safety is a bad thing.




It wouldn't though. If you've designed something like this before, you'd know a type assertion is required no matter what just because of how serialization works.

If you have some example code that can convince it would be useful though, I'll happily agree, but the only place I see where it can be useful (perhaps a callback?) can already be solved by "reflect".

So I don't see any benefit whatsoever.




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

Search: