ANNOUNCE: SourceGraph-0.1 and Graphalyze-0.3

I've now uploaded my SourceGraph program to Hackage [1]. It's rather simple at the moment, but if you pass in the .cabal file as a parameter (e.g. run it as "SourceGraph Foo.cabal"), it will create in the same directory as the .cabal file a Directory called "SourceGraph" that contains an html report of some basic graph-theoretic analysis of your code. The output format isn't ideal, but it should serve it's purpose for now (I'll fix it up and actually make it usable once my Thesis has been handed in). What I'd appreciate if people could try it out and tell me if there's any code, etc. that it can't parse. At the moment, it ignores all Data-based functions (e.g. class and instance declarations as well as record functions) and only looks at "stand-alone" functions (i.e. normal functions). SourceGraph requires version 0.3 of my Graphalyze library (version 0.2 added the reports in, but had some bugs that 0.3 fixes). [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/SourceGraph -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On 2008.10.06 02:53:43 +1000, Ivan Miljenovic
I've now uploaded my SourceGraph program to Hackage [1]. It's rather simple at the moment, but if you pass in the .cabal file as a parameter (e.g. run it as "SourceGraph Foo.cabal"), it will create in the same directory as the .cabal file a Directory called "SourceGraph" that contains an html report of some basic graph-theoretic analysis of your code.
The output format isn't ideal, but it should serve it's purpose for now (I'll fix it up and actually make it usable once my Thesis has been handed in). What I'd appreciate if people could try it out and tell me if there's any code, etc. that it can't parse. At the moment, it ignores all Data-based functions (e.g. class and instance declarations as well as record functions) and only looks at "stand-alone" functions (i.e. normal functions).
SourceGraph requires version 0.3 of my Graphalyze library (version 0.2 added the reports in, but had some bugs that 0.3 fixes).
[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/SourceGraph
-- Ivan Lazar Miljenovic
SourceGraph looks pretty interesting. I don't think the output is that bad, though. (If anyone is curious, attached is a tarball of what SourceGraph generates for XMonad.) But I do have one or two problems: 1) Didn't mention that it uses some executable 'dot', which Graphviz provides. 2) Fails on XMonadContrib? While SourceGraph on XMonad finished in 1 or 2 seconds, SourceGraph xmonad-contrib.cabal has been running at 99% CPU (only one CPU - I wonder if it could be parallelized) now for something over 3 hours. I know XMC is a bigger codebase than XM, but it's not thousands of times bigger! :) -- gwern Chicago ICE NSWG DSD 5926 RSA Chicago UFO MITM Lindows

Ivan,
I tried building your tool today and found a few packaging related things:
* the dependency on haskell-src-exts says any version should do, but
the one shipped in Debian Sid
(http://packages.debian.org/sid/libghc6-src-exts-dev) doesn't do, so
some extra versioning info seems to be required
* I had to add an import of Distribution.Configuration to Main.hs to
get it to compile (it failed on the use of condTreeData).
/M
2008/10/5 Gwern Branwen
On 2008.10.06 02:53:43 +1000, Ivan Miljenovic
scribbled 1.1K characters: I've now uploaded my SourceGraph program to Hackage [1]. It's rather simple at the moment, but if you pass in the .cabal file as a parameter (e.g. run it as "SourceGraph Foo.cabal"), it will create in the same directory as the .cabal file a Directory called "SourceGraph" that contains an html report of some basic graph-theoretic analysis of your code.
The output format isn't ideal, but it should serve it's purpose for now (I'll fix it up and actually make it usable once my Thesis has been handed in). What I'd appreciate if people could try it out and tell me if there's any code, etc. that it can't parse. At the moment, it ignores all Data-based functions (e.g. class and instance declarations as well as record functions) and only looks at "stand-alone" functions (i.e. normal functions).
SourceGraph requires version 0.3 of my Graphalyze library (version 0.2 added the reports in, but had some bugs that 0.3 fixes).
[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/SourceGraph
-- Ivan Lazar Miljenovic
SourceGraph looks pretty interesting. I don't think the output is that bad, though. (If anyone is curious, attached is a tarball of what SourceGraph generates for XMonad.)
But I do have one or two problems: 1) Didn't mention that it uses some executable 'dot', which Graphviz provides. 2) Fails on XMonadContrib? While SourceGraph on XMonad finished in 1 or 2 seconds, SourceGraph xmonad-contrib.cabal has been running at 99% CPU (only one CPU - I wonder if it could be parallelized) now for something over 3 hours. I know XMC is a bigger codebase than XM, but it's not thousands of times bigger! :)
-- gwern Chicago ICE NSWG DSD 5926 RSA Chicago UFO MITM Lindows
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux)
iEYEAREKAAYFAkjpI5AACgkQvpDo5Pfl1oKt9ACdEpMMFe7tooMFQXZMNoXrHY8P +kIAn1ctKk5aj9T8ThQwHIpHTQWiallf =CNNW -----END PGP SIGNATURE-----
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

* the dependency on haskell-src-exts says any version should do, but the one shipped in Debian Sid (http://packages.debian.org/sid/libghc6-src-exts-dev) doesn't do, so some extra versioning info seems to be required
Ouch, that one's pretty old. Don't the wheels of debian packaging spin faster than that? But yeah, it should be haskell-src-exts (>= 0.3), to avoid trying to dig up that should-be-long-dead-and-buried 0.2.1 version... Cheers, /Niklas

2008/10/6 Niklas Broberg
* the dependency on haskell-src-exts says any version should do, but the one shipped in Debian Sid (http://packages.debian.org/sid/libghc6-src-exts-dev) doesn't do, so some extra versioning info seems to be required
Ouch, that one's pretty old. Don't the wheels of debian packaging spin faster than that? But yeah, it should be haskell-src-exts (>= 0.3), to avoid trying to dig up that should-be-long-dead-and-buried 0.2.1 version...
Cheers,
/Niklas
OK, I'll try and fix those dependency issues in the next couple of days. I didn't specify a version of haskell-src-exts, as I couldn't find any way of telling which versions were compatible (then again, I was only able to work out how to use it and what everything meant by reading the source directly...). Gwern: I think I've found why it never ends on xmonad-contrib (it happens for me here on the Grahpalyze library as well): when doing clique/cycle detection, if a function recurses on itself more than once (e.g. multiple pattern matches, each of which recurses) then the clique detection at the very least goes nuts and tries creating an infinite one-function clique. This probably happens for cycles when there's multiple edges between two functions. I think the way to fix this is to have a function that turns a graph into a simple graph (i.e. no multiple edges or loops; well, maybe _one_ loop) and get the clique detection, etc. routines use the output of that for processing.
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

I had this problem: lane@biped:~/src/roguestar/rsagl (master)$ SourceGraph rsagl.cabal dot: width (40671 >= 32768) is too large. dot: width (43275 >= 32768) is too large. dot: width (43720 >= 32768) is too large. dot: width (40525 >= 32768) is too large. Unable to generate report lane@biped:~/src/roguestar/rsagl (master)$ dot -V dot - Graphviz version 2.20.2 (Sat Aug 16 05:41:32 UTC 2008) --Lane

On 2008.10.06 22:40:21 +1000, Ivan Miljenovic
Gwern: I think I've found why it never ends on xmonad-contrib (it happens for me here on the Grahpalyze library as well): when doing clique/cycle detection, if a function recurses on itself more than once (e.g. multiple pattern matches, each of which recurses) then the clique detection at the very least goes nuts and tries creating an infinite one-function clique. This probably happens for cycles when there's multiple edges between two functions. I think the way to fix this is to have a function that turns a graph into a simple graph (i.e. no multiple edges or loops; well, maybe _one_ loop) and get the clique detection, etc. routines use the output of that for processing.
-- Ivan Lazar Miljenovic
So it'll be fixed for the next release? Cool then; I look forward to seeing my XMC modules' analysis. -- gwern DES DDR

2008/10/8 Gwern Branwen
So it'll be fixed for the next release? Cool then; I look forward to seeing my XMC modules' analysis.
Yeah, I was planning on making a new release some time this week... and then I somehow accidentally uninstalled just about everything on my system, and have to do a reinstall :s -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On Mon, Oct 6, 2008 at 1:19 PM, Niklas Broberg
* the dependency on haskell-src-exts says any version should do, but the one shipped in Debian Sid (http://packages.debian.org/sid/libghc6-src-exts-dev) doesn't do, so some extra versioning info seems to be required
Ouch, that one's pretty old. Don't the wheels of debian packaging spin faster than that? But yeah, it should be haskell-src-exts (>= 0.3), to avoid trying to dig up that should-be-long-dead-and-buried 0.2.1 version...
Yeah, I know. I reported a bug against it and if I find the time tonight I'll try to build an updated debian package. Not sure what the policy is ATM for NMUs though. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

Hi all,
(this message is an ad:-)
For people interested in visualizing dependencies between the modules
in their project: on Hackage there is another simple tool called
"graphmod" that can generate a dot graph from your Haskell source
code.
-Iavor
2008/10/6 Magnus Therning
On Mon, Oct 6, 2008 at 1:19 PM, Niklas Broberg
wrote: * the dependency on haskell-src-exts says any version should do, but the one shipped in Debian Sid (http://packages.debian.org/sid/libghc6-src-exts-dev) doesn't do, so some extra versioning info seems to be required
Ouch, that one's pretty old. Don't the wheels of debian packaging spin faster than that? But yeah, it should be haskell-src-exts (>= 0.3), to avoid trying to dig up that should-be-long-dead-and-buried 0.2.1 version...
Yeah, I know. I reported a bug against it and if I find the time tonight I'll try to build an updated debian package. Not sure what the policy is ATM for NMUs though.
/M
-- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (6)
-
Christopher Lane Hinson
-
Gwern Branwen
-
Iavor Diatchki
-
Ivan Miljenovic
-
Magnus Therning
-
Niklas Broberg