this post was submitted on 08 Feb 2024
1 points (100.0% liked)

Rust

7733 readers
15 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] bwrsandman@lemmy.ca 0 points 2 years ago (1 children)

So rust finally gets reflection? In stable no less!

[–] snaggen@programming.dev 1 points 2 years ago (1 children)

Well, if the only thing you need from reflection is the name of a type, so then yes. But I wouldn't really call this reflection since it is very limited.

[–] Ephera@lemmy.ml 0 points 2 years ago (1 children)

Yeah, Rust can't have proper reflection, since there's no external runtime environment that keeps track of your state. Any such smartness either has to be compiled-in (which is how std::any and macros work) or you can implement something to keep track of this state at runtime, as if you were partially building a runtime environment.

[–] BatmanAoD@programming.dev 1 points 2 years ago

Minor point of clarification: it can't have runtime reflection, but in principle it could have compile time reflection.