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 @rustlang
Although, I could probably achieve that using macros? Essentially building it myself.
1 reply 0 retweets 1 like
Macros are also compile-time
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.