Showing posts with label dumping. Show all posts
Showing posts with label dumping. Show all posts

Friday, April 16, 2010

Bugfix for S-expression dumping


I've pushed a new version of the code. The code to dump s-expressions did not handle references correctly, but it should now.

Maybe next time, I should prove the correctness using Coq. But then I would not be writing new code, would I?

Ah, what a dilemma between theoretical exactness and practical application. I wonder if Haskell will bridge that gap elegantly. We never really had the time to get aquainted.

Thursday, April 15, 2010

I'm on Github now


It is done. I now have an account on Github and my first open source repository has just been pushed. Feel free to take it for a spin. And don't forget to tell me what you think of it.

Anyway, after downloading and unpacking the library, just follow the installation instructions in the README file. If you have findlib installed, using the library is as simple as typing

> #use "topfind";;
> #require "inspect";;

into your OCaml prompt. I suggest you open the Inspect module as well.

> open Inspect;;

For starters, both the Dot and the Sexpr library provide a test_data function to generate some interesting data to dump.

> Sexpr.dump (Sexpr.test_data ());;
> Dot.dump (Dot.test_data ());;

It is naturally also possible to let the dump functions inspect themselves:

> Sexpr.dump Sexpr.dump;;
> Dot.dump Dot.dump;;

If you are on a Mac, the Inspect.Dot.dump_osx function should be of interest. It writes the DOT output to a temporary file, uses Graphviz to generate the graph, and displays the results using the open command.

> Dot.dump_osx Dot.dump_osx;;

It goes without saying that you should have Graphviz installed for this last part to work.

Have fun!