adjivas / ml

A library to generating UML language from Rust's project into graphiz/dot file.
https://adjivas.github.io/ml/mml
Apache License 2.0
81 stars 15 forks source link

Project state #7

Open bitdivine opened 5 years ago

bitdivine commented 5 years ago

Hello,

This project looks interesting; may I ask about the current state of the project in terms of maintenance and so on? If there is interest in maintaining this as a tool for generating UML from Rust crates and the goals are reasonably close to my own I would be interested in contributing. If on the other hand you know that e.g. some of the dependencies are unmaintained and this would be a huge amount of work then a clean slate approach might be better.

Best wishes, Max

adjivas commented 5 years ago

Hello @bitdivine,

Only the dot dependency looks like unmaintained and limited. Is it a pure Rust solution than a FFI of graphviz but there miss the subgraphs keyword and without it my ml library can't groups the class into module. Unfortunately, I never had the resources of time for solve this problem.

If is it a important graphviz functionality to you and that you prefer the solution of a FFI, I recommend to you of write it from zero.

Any contribution are welcome and you also can become member of this repository.

@adjivas.

bitdivine commented 5 years ago

Hello @adjivas ,

Thank you for getting back to me. My goal is to be able to visualise almost any rust crate. I see two challenges:

If this sounds compatible with your vision I would be very happy to collaborate. Thank you for your kind invitation.

Best wishes, Max

bitdivine commented 5 years ago

I have started testing crates using the command line version of your tool, just on crates in my home dir. Works on most, on some I have "error: expected identifier, found keyword crate" for "use crate::....". I can assemble a set of crates, make sure that they are up to date and put them into some sort of test rig.

bitdivine commented 5 years ago

Update: If I replace every instance use crate:: with use something:: in every file then parsing works for the handful of top and most recent crates on crates.io that I picked. This is promising. I suspect that the preprocessor needs to be understood more thoroughly than I do at the moment; unfortunately understanding it well may be hard work.

Regarding the output, it would be interesting to me to make component diagrams as well as the current diagrams that show inclusion. For this traits would be interfaces and structs would either supply that interface or consume it. The interface ID would have to be the tuple of (struct,trait), as the same interface might be supplied by several structs.

adjivas commented 5 years ago
Scaling a project up so that it runs on all sorts of inputs usually turns up corner cases, so I expect some target crates to work fine out of the box, others to require development work. 

The dependency syntex_syntax is the parser of the Rust compiler soo the ml crate is a UML subview of syntex_syntax. But your test will be welcome because I have never checked the rebusted of this project.

For this reason I would want to add more output options or perhaps make a separate project that parses UML and displays it in a browser using Cytoscape, so that users can filter and adjust the graph. This might be a better approach as that way this project here can be fully focussed on UML and not worry about how it is displayed.

This project currently has a minimalist language of graph named DOT according to the recommendation of this paper. Do you think graphviz Dot display should be separed of ml crate? Maybe the Dot language is compilable into Cytoscape? This topic say a Dot language is compilable into a GRAPHML language who is importable by Cytoscape. So I imagine a IC script can solve this question without need to write a implemente of Cytoscape.

arnfaldur commented 3 years ago

It seems like the syntex_syntax crate is abandoned. This crate does not work for me either and I suspect that syntex is the cause.

adjivas commented 3 years ago

Thanks for reporting @arnfaldur ! It's really annoying because my time resources are really thin. I will consider the rustc-ap-syntax's crate or another.