How modern languages still fail to recognize the importance of reflection is beyond me. I'm looking at you, @rustlang.
-
-
-
Replying to @rustlang @ArvidGerstmann
(That is, we have and use a lot of compile-time reflection, and think it’s quite valuable! Runtime reflection imposes runtime costs that aren’t acceptable in our domain, so we don’t have it, but not because we don’t think it has worth!)
1 reply 0 retweets 8 likes -
Replying to @rustlang
As far as I can see, serde is using macros to generate the code for every struct, right? The thing is, that may actually have a *higher* cost than achieving the same using runtime reflection. And saying compile-time reflection has no overhead, compared to runtime is plain wrong.
4 replies 0 retweets 0 likes -
Replying to @ArvidGerstmann @rustlang
Imagine the case where I'm writing a large program, like a game engine, and I want to make sure I can serialize my game objects for replication. A compile-time reflection system would generate a serialize, deserialize and maybe a couple other functions for each type.
1 reply 0 retweets 0 likes -
Replying to @ArvidGerstmann @rustlang
That will likely result in several megabytes of generated code, while a runtime reflection would have a couple kilobytes for the functions, and a couple dozen bytes per structure of metadata (depending on what you actually need).
2 replies 0 retweets 0 likes -
Replying to @ArvidGerstmann
Yeah, we cannot afford a couple dozen bytes of overhead on every struct. It *could* be a thing you could feasibly build, though.
2 replies 0 retweets 0 likes -
Replying to @rustlang @ArvidGerstmann
Anyway, the point is it’s certainly not that we don’t think reflection is important! There’s tradeoffs in implementations and we tend to favor specific ones. Nice thing about being so low level is you *can* do other stuff too if you really want!
1 reply 0 retweets 1 like -
Replying to @rustlang
Glad to hear that. Looking forward how Rust will develop further. It's looking really promising so far, great work!
1 reply 0 retweets 1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

