Data::Dumper::GUI

Everyone knows all that command-line stuff is for weirdo geeks, right? ;-) So let's bring Data::Dumper kicking and screaming into the 21st century and give it a pretty GUI!

ddGUI.png

Introducing Data::Dumper::GUI; a GUI for Data::Dumper. It allows you to view your data structures as a tree with collapsible nodes. Data::Dumper::GUI is built using Prima (a rather nice GUI toolkit designed specifically for Perl, that supports Win32 and X11, with no dependencies and compiles pretty quickly... for a GUI toolkit) and Moo.

It has special support for Moose objects, using the metaobject protocol to introspect objects being dumped and provide additional information (superclasses, subclasses, roles, attributes, methods). It will do the same for Moo objects too (but only if Moose is loaded).

And it comes bundled with a plugin for Reply.

It's early days; the GUI ain't pretty enough yet. Take a peek though, and let me know if you have any ideas for improvements.

18 Comments

I lack the words.

This is so fucking cool.

Feature request: It would be really nifty if it included a REPL.

So fucking awesome

That's nice. But to be honest I'm more interested in Prima right now. I'd long ago given up the search for a good GUI toolkit for Perl.

There is a REPL built for Prima already: https://github.com/run4flat/App-Prima-REPL

It might not be too difficult to get them talking to each other.

Hey cool, another Prima app!!

David Mertens has done a lot of work using it for App::Prima::REPL (a GUI REPL for PDL) and other things. He is also a big proponent of its Object model for C level objects.

Great work! Keep it up!

@Joel: Any other Prima apps I can see the showcase of?

I just tried installing Data::Dumper::GUI. It doesn't showcase many of the Prima widgets available. And the fixed width font looks very very wide.

Toby rocks!

A few things:

  • Resizing window doesn't work yet for me.
  • The referenced value for \1 or \"foo" is not shown yet (it is shown by Data::Dumper).
  • Is there a reason why displayed array index starts from 1 instead of from 0?
  • The right pane looks suspiciously like HTML/POD. It'd be nice if it contains links to parent nodes, sibling (next/prev array element), etc.
  • A nicer way to display long strings? E.g. split to multiple lines? Also is it possible to also show its length (in bytes/chars). encoding, and whatnot?
  • Hash keys should be displayed encoded (e.g. "key\ncontaining\nnewlines" doesn't display properly yet). This includes left pane as well as right pane.
  • As I mentioned in another comment, the fixed width font looks too wide.
  • It'd be nice to show number of keys for array.
  • It'd be nice to optionally show memory size (using /Devel::Size(Me)?/, for instance).
  • Value for regexp not shown yet.
  • Are the tree nodes really collapsible? I haven't found a way to collapse them.
  • The ability to reverse sort by path/value is really cool!
  • (From the previous comment about POD/HTML in right pane). Perhaps a breadcrumb style navigation is a good idea? Doesn't always work though e.g. when there are circular dependencies.

There may be more from me later :)

In short, there are lots of ideas to improve this, to go beyond Data::Dumper. Nice work!

Yes, nodes can be expanded and collapsed. As far as I can tell, highlighting the node and hitting "Enter" is the only way to do it.

Hm, that doesn't do anything for me over here.

Weird. I tried this by dumping \%INC and this will make it segfault every time. Dumping \@INC works just fine.

Hi Toby, I think this is a very cool app! If you need help with base Prima api, TextView or whatever else please don't hesitate to ask, I'll be glad to help.

As for the fixed font problem, I'll see what I can do.

Yeah, that last bit is what i was talking about. :)

Toby, Steven: there is expanding with mouse, it seems that both of you have Prima compiled without GIF support somehow and that's why it's disable. If Prima has it, outline widget shows small extra [+] and [-] icons next to each item.

One thing we found really useful at blekko was a remote inspection tool -- we have a lot of long lived daemons, and they talk to each other with messages. We added messages that let you inspect specially-registered variables from the command line, list hash keys and counts, descend into complicated objects, etc.

If you had a long-lived perl process on a server that implements a webserver, for example, you could see how this feature might be useful!

does it run under mac (because Prima doenst configure right now)?
Thanks

Thank you very much. This makes finding the part I am looking for in a complex structure I've been passed so much easier.

This is so awesome! Thanks! :D

Leave a comment

About Toby Inkster

user-pic I'm tobyink on CPAN, IRC and PerlMonks.