Lookery Dev Blog RSS

"Stream of geeky consciousness..." @electromute


Authors
@ckelly@danmil
@dcancel@eliast

Friends


Archive

Dec
24th
Wed
permalink

Graphviz Considered the Absolute Frickin’ Bomb

Okay, so maybe all of you are on this tip already, but if not, I just have to briefly rave about graphviz, a project I adore.  What is this graphviz, I hear you say?  Well, it’s a library for creating graph images (graph visualizations == graphviz).  Why does Dan love it so?   Well, beyond the fact that its core functionality is way, way useful (pictures of graph data are something humans are pretty much built to parse), I love, love, love the interface.

What is this interface?  Some elegant object-oriented system with bindings in every modern language, surely?  Oh, no, it’s oh-so-much-lovelier than that.  Graphviz defines a declarative mini-language for creating graphs, reads that from stdin, and writes the resulting images to stdout.

What?  Like pic, tbl, eqn and all those ancient Unix tools?  Exactly. And it works incredibly well.  Easy to generate (if, say, you can create strings in your language of choice), easy to debug (write those strings to a temp file, read it with your text editor, muck with it until the resulting images look the way you want), easy to string together in pipelines, etc.

One of the central discoveries of my programming career has turned out to be: declarative mini-languages win (and when I say, discovery, I mean, not my discovery, but more my rediscovering what lots of people already knew).  Kernighan and Pike are a gerat source for this, in the marvelous Practice of Programming.

-Dan M

Comments (View)
blog comments powered by Disqus