Solid reflection in rust

As a piece of anecdotal evidence: Spring XML is floating our boat in an "enterprise" environment right now. It's a ridiculous bit of technology but it works. Extremely well. I love it. I would feel short-handed without it. Should it perhaps be viewed as sloppy duck typing on top of rigorously typed Java? Or as a means of configuration?

Update: one way to view Spring XML is perhaps as a DSL for linking loosely coupled software components. DSL-s are handy once in a while. The fact it survived for so long means it's filling a real need.

I suppose a solution similar to Spring XML could be made to work "statically" (at compile time) in today's Rust.

It can probably be a useful mental exercise to try and figure out what language features missing today would enable a similar experience "dynamically" (without re-compilation, like in Java). First thing that comes to my mind is that not all traits are object-safe. "Dynamic" Java-style Spring XML would however pretty much require that the loosely-coupled components that it links together invoke each other via trait objects and trait objects only.

1 Like