rusty-ferris-club / build-it-for-me-please

🙏 "Build it for me please" - suggest an OSS project in Rust 🦀, we build it or help you build it
20 stars 0 forks source link

[project-request]: Rust to UML #2

Open ohaddahan opened 2 years ago

ohaddahan commented 2 years ago

How can we contact you?

ohaddahan@gmail.com

Suggestion / Project Request

I'm been looking for Rust to UML (or similar diagram) conversion tools. Found 2 that seems unmaintained/incomplete.

https://github.com/selamaashalanore/rudg https://github.com/adjivas/ml

Main aim is to easily understand code flow, I think it can be a good tool for security analysis as a first sweep to detect potential weak spots in design.

jondot commented 2 years ago

Thanks Ohad! The projects you've linked, is any of them a good starting point? also -- what would be missing from that starting point?

ohaddahan commented 2 years ago

(BTW I want to build this, not dumping it on you guys, building it together will be awesome)

So https://github.com/adjivas/ml seems to be broken, depending on some other unmaintained crates. I tried https://github.com/selamaashalanore/rudg but it didn't do much (might be a corner case since I used on a project with HEAVY macro usage, might be out of it's capabilities) , also as far as I understand it supports only one file parsing.

I'm thinking maybe an easy way to get ROI is to just create a few macros that help create the UML.

Basically allowing at start to do some kind of manual annotation that later maybe can add some kind of verification on top. (it's still very raw, so just throwing out some ideas to possible ways to attack this problem)

jondot commented 2 years ago

Amazing, actually working together and trying to have a learning process in a group, was the original idea, so happy to have you :) I'll try out these tools to get the "feel" you're getting

@kaplanelad will also set up a Discord for us around Thursday so we could have an option of a more interactive space ;)

ohaddahan commented 2 years ago

BTW I think it can be very valuable to have some flow chat that's synced to the doc, drawing inspiration from Rust doc tests that help ensure your doc examples always work.

(Nothing more annoying than trying an example code that doesn't work anymore 🤣)

Can be very helpful when you want to keep non coders synced with changes (PM etc) without doing too much manual update to some flow charts etc.

Just me pitching the idea more 😁

jondot commented 2 years ago

So you mean -- something that runs over Issues (say on Github), looks for code samples, gets the language (say rust for starters), runs the sample (like a rustdoc), and adds in a comment / emoji to indicate if it failed or not.

If so I feel that it's a great idea 😀

ohaddahan commented 2 years ago

That can be a kick ass product but not the original intention here.

Basically as I see it, just like there are automatic/semi-automatic API client generation tools.

Something similar to code to flow chart, make sense (will probably have limitations in it since it's a gargantuan task)

Similar how automatically generating an ERD can help QA , product and other teams to understand changes to the code.

jondot commented 2 years ago

Got it! 😉