Solid reflection in rust

This whole thread could stand to be a lot kinder.

It's true that a lot of Rust developers and fans have pat answers for talking points like reflection. A lot of this stuff has already been heavily discussed, gone through proposals like the one in 2019, and been ultimately rejected or at least delayed. Just asking for reflection isn't going to cut it. If you want it to happen, you need to resolve the blockers that prevented the linked proposal from moving on in the first place,

But while this does explain the behavior of everyone who replied, it doesn't excuse it. Runtime introspection and reflection are not false desires; the fact that you can get by without them doesn't make them useless or inferior. The implication that @publicocean0 somehow doesn't know what they want is insulting. There are a broad class of features enabled by runtime bytecode generation and reflection that Rust can't do as well as Java can. There are ways around it, but there's still a reason why projects like Piston prefer to extend their Rust codebase using a language other than Rust.

This isn't a Q&A forum. We don't have to answer all of the OP's questions right away. Exploring reflection and code generation without knowing everything up-front is fine, as long as the proposer understands that it won't be implemented right away unless good use cases are found (and it doesn't break any promises, like memory safety, or zero-overhead).

12 Likes