Annotated source code

Martin von Gagern <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Hi!

This might be interesting to the SML community:
http://www.gagern.sytes.net/mldoc/

I modified the SML/NJ compiler so it generates some more information
while compiling a source (in this case the Isabelle theorem proover).

The project is still far from finished, and the webpage given above may
be slow (as it is on my personal machine connected by DSL), broken (as
this is my life test tree, bleeding edge with all its pros and cons) or
unavailable (if I have to switch my computer off or some such).
It's a demo.

What you can already see:
 * List of all compiled files to the left
 * Dependency between files to the top
 * Clicking on any file you get the entities defined therein
 * Along with each entities you get a list of references to this entity
 * Clicking on a entity or a reference you can see its source code
 * References in the source lead you to the corresponding definition
 * Symbol definitions are linked to the description in the upper frame

The intended audience is not the user of some API, but primarily the
developer of some larger piece of software. Those need to have access to
all the code, not only the exported signatures. It is especially
interesting to learn where a given function is called, without having to
use grep and friends.

In that sense it might well be a good counterpart to the official mldoc,
one for devs working on the inside, one for users of the API only.

Several things are still missing:
 * Linked references for entities from nested structures
 * Links for datatype constructors
 * Handling of functors
 * Other stuff I haven't identified the problem so far
 * Perhaps some nice magic with signatures
 * Integration with CM
 * Type information (one day in the far future)

>From the general user base I'd simply like to get some feedback on what
you think of this. First impressions, suggestions, etc.

For the SML/NJ devs I have some more details and some questions.

What I did is implement some generic message bus into the visible
compiler. Now many compiler steps generate a message telling what they
are doing, and my module registers a message receiver, parses the
messages and generates the files you can see from this.

So far I use the Access structure to identify things, although I found
that this won't work for datatype constructors. I guess I'll have to use
the type stamp along with the name in those cases.

Are you willing to help me with questions that might arise while I
continue filling in the holes? Is this mailing list a good place for
such questions? Is someone who knows how the compiler works reachable by
some form of instant messaging, so I can discuss questions easier?
I often thought it would be nice to have some mentor when looking at the
SML/NJ code and trying to puzzle out what some things are for.

I collected the changes I made to the compiler to this patch file:
http://www.gagern.sytes.net/mldoc/base.patch (about 550 new lines).
The names are not yet final, I guess I'll rename what is now "InfoHooks"
to "MessageBus" as this better describes what I'm doing.
Are you interested in including this into the official compiler one day?
The performance impact should be fairly low, especially if no listeners
are registered.

When my tool is ready to be published, I'd like to host it somewhere
else, move my SVN from my local machine to a reliable web server. Would
it be possible to host everything at smlnj-gforge.cs.uchicago.edu?

Is there anybody willing to join me in developing this?
Do you have any other comments, suggestions, ...?

Looking forward to your feedback,
 Martin von Gagern

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.