Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GraphViz2 rather than GraphViz Perl module? #24

Open
mohawk2 opened this issue Apr 20, 2024 · 2 comments
Open

Use GraphViz2 rather than GraphViz Perl module? #24

mohawk2 opened this issue Apr 20, 2024 · 2 comments

Comments

@mohawk2
Copy link

mohawk2 commented Apr 20, 2024

I just learned of this project today, and it's really cool!

Thought you'd be interested to know of the GraphViz2 module, which may make things easier/better in this script. Example usage:

From https://github.com/PDLPorters/pdl/blob/master/perldl#L335-L338:

  my $g = PDL::Core::pdumpgraph(PDL::Core::pdumphash($pdl));
  require GraphViz2;
  my $gv = GraphViz2->from_graph(PDL::Core::pdumpgraphvizify($g));
  $gv->run(format => $format, output_file => $file);

The general idiom is you make a Graph object, then annotate it (e.g. with a graphvizify procedure such as https://github.com/PDLPorters/pdl/blob/ac270e21cafeda8726dd64fa4b90e4a6e686c8c2/Basic/Core/Core.pm#L2394-L2439), then GraphViz2 can run with it.

@koknat
Copy link
Owner

koknat commented Apr 20, 2024

Hi @mohawk2
Thanks for the feedback!
I had considered moving from GraphViz to GraphViz2, but chose not to because of the additional Perl dependencies (Moo and 5.8.8 vs 5.6.0).
My assumption is that the more steps are needed to install 'callGraph', the fewer people will spend the effort to install it.
Installation of the Moo dependency is trivial for those of us experienced with Perl, but since callGraph supports many languages, most users may be completely new to Perl.
For the same reason, I designed the callGraph code as a monolith, as it's then easier for a user to copy between machines or give to a friend

@mohawk2
Copy link
Author

mohawk2 commented Jun 20, 2024

Zooming out a bit, I think you'll struggle to find any Perls installed anywhere that are <5.8.8 (released ~20 years ago). Even if you decide to stick with GraphViz, you could eliminate a step for users by using https://metacpan.org/dist/App-FatPacker to package everything into one file. That would then also work with GraphViz2, albeit the file would be bigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants