Uml diagram representation in rust-lang for software engineering

how to visualize the design of a system for rust language based software and how to show or represent modules , struct , impl , traits , generic type,variables etc .. in a digram

1 Like

I don't think there is a standard way to apply UML diagrams to Rust. I think there isn't a need for it in Rust, because Rust's type-system is more general than UML, and can more precisely describe how things are related.

1 Like

While I agree with you in the day to day, and I'm far from a UML enthusiast, I have to admit it would be nice to be able to automatically get a high level visual overview of an existing library or binary crate.

The other way around (generating code from a diagram) is I think pretty much doomed from the start, because of how generated code needs to interact with hand-written code, and especially how such tools are incapable of reapplying the core custom logic to a regenerated UML diagram (which can contain arbitrary changes from the previous version, up to and including a full rewrite).

2 Likes

While it is in no sense an implementation of this, generating diagrams from Rust code has been done before by generating railroad syntax diagrams from macro_rules. It's probably the right approach to generating a different kind of diagram from the data type descriptions.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.