ANNOUNCE: SourceGraph-0.5.0.0

SourceGraph [1] is a tool to statically analyse your Haskell code by applying graph-theoretic techniques on the call graph. It utilised the Graphalyze [2] library to do so, both of which were originally written as part of my Honours thesis last year [3]. [1] http://hackage.haskell.org/package/SourceGraph [2] http://hackage.haskell.org/package/Graphalyze [3] http://ivanmiljenovic.wordpress.com/2008/11/03/graph-theoretic-analysis-of-r... I have been meaning to update SourceGraph since last year, but was waiting for improvements to the graphviz [4] library first. Now that these are done and I have fewer excuses, I've started to improve upon it. [4] http://hackage.haskell.org/package/graphviz When I first released SourceGraph last year, several people (e.g. Gwern) wanted support for CPP and command-line options. Unfortunately, I haven't yet gotten around to that; what I have done is added support for type classes and data structures, something I originally said I wasn't going to do. This support isn't perfect, especially when dealing with type classes from outside the scope of the code base, but in most cases works (except that the virtual instance functions don't always get positioned in the correct spots for some reason). The produced graphs are now also much prettier, with various colours and shapes being used. The useful features that SourceGraph offers include: * Visualisation of each module, the relations between modules and the entire code base. * Finds functions that are exported from a module that isn't in exposed in the .cabal file. * Alternate module splits. Please note that SourceGraph is _not_ a refactoring tool: it is designed to give you the programmer more information about what is in your code. I'd appreciate it if people could give SourceGraph a whirl and at least check how well the conversion from Haskell code to the graph is, as I'm not that sure how well I've converted haskel-src-ext's [5] internal state to SourceGraph's state. Please note that there are already various aspects that I know don't work properly; these can be found in the ParsingProblems.txt file (KnownProblems.txt contains other non-parsing problems that I'm aware of). In particular, TH, etc. aren't supported. [5] http://hackage.haskell.org/package/haskell-src-exts-1.1.4 To use SourceGraph after it's been installed, at a prompt do the following:
SourceGraph path/to/project.cabal
The resulting report will then be found in a directory called "SourceGraph" in the same directory as the cabal file. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

"Ivan" == Ivan Lazar Miljenovic
writes:
Ivan> I'd appreciate it if people could give SourceGraph a whirl Fails to install (Linux x86_64): Data/Graph/Analysis/Utils.hs:207:43: Ambiguous occurrence `dotizeGraph' It could refer to either `Data.Graph.Analysis.Utils.dotizeGraph', defined at Data/Graph/Analysis/Utils.hs:199:0 or `Data.GraphViz.dotizeGraph', imported from Data.GraphViz at Data/Graph/Analysis/Utils.hs:81:0-19 Data/Graph/Analysis/Utils.hs:220:18: Not in scope: data constructor `PointList' cabal: Error: some packages failed to install: Graphalyze-0.5 failed during the building phase. The exception was: exit: ExitFailure 1 SourceGraph-0.3 depends on Graphalyze-0.5 which failed to install. -- Colin Adams Preston Lancashire

Colin Paul Adams
"Ivan" == Ivan Lazar Miljenovic
writes: Ivan> I'd appreciate it if people could give SourceGraph a whirl
Fails to install (Linux x86_64):
Data/Graph/Analysis/Utils.hs:207:43: Ambiguous occurrence `dotizeGraph' It could refer to either `Data.Graph.Analysis.Utils.dotizeGraph', defined at Data/Graph/Analysis/Utils.hs:199:0 or `Data.GraphViz.dotizeGraph', imported from Data.GraphViz at Data/Graph/Analysis/Utils.hs:81:0-19
Data/Graph/Analysis/Utils.hs:220:18: Not in scope: data constructor `PointList' cabal: Error: some packages failed to install: Graphalyze-0.5 failed during the building phase. The exception was: exit: ExitFailure 1 SourceGraph-0.3 depends on Graphalyze-0.5 which failed to install.
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

Looks very nice! One thing I noticed are a bunch of escaped newlines somehow ending up in the report: Class: Num\nData: Bit, Class: Num They appear each time a class is displayed.
participants (3)
-
Colin Paul Adams
-
Ivan Lazar Miljenovic
-
Roel van Dijk