Hacker News new | ask | show | jobs
by gizmo 976 days ago
> Whether you do Foo.Serialize() and it uses reflection to enumerate the properties, carries around tags permanently or it uses some compiletime generated function has nothing much to do with expressiveness.

Thinking those are the only options is exactly why the issue is expressiveness.

1 comments

Is this a reference to some specific, better, technique or an optimistic belief that such a thing could be built if only ..?
Code generators are used because run-time introspection tends to be slow(er) and because debugging code generated at runtime is harder and because IDEs don't know how to deal with code generated at runtime. But there no reason why this should be so. No good reason to have a hard boundary between compiletime and runtime either. These are just historical artifacts.