caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jun Furuse" <jun.furuse@gmail.com>
To: caml-list@yquem.inria.fr
Subject: [ANN] OCamlSpotter: OCaml compiler extension for source browsing, version 1.0
Date: Thu, 25 Dec 2008 22:47:06 +0900	[thread overview]
Message-ID: <5160b4200812250547l35a1536fuf687d9e277999bd0@mail.gmail.com> (raw)

Hi, OCaml programmers,

Here is your free holiday gift, OCamlSpotter version 1.0, a small
patch for OCaml 3.11.0.

OCamlSpotter : OCaml source browsing
====================================

  Camel spotter: Oh, it was extremely interesting, very, very -
    quite... it was dull; dull, dull, dull, oh God it was dull.
    Sitting in the Waterloo waiting room. ...

                                     from You're No Fun Anymore,
                                    Monty Python's Flying Circus

OCaml module language is powerful. So extremely powerful that you can
be lost yourself easily inside a huge OCaml project with tons of modules.
Spotting the definition of a variable is sometimes "extremely interesting".
Let's see such an "exciting" example:

  include M
  open N
  open O
  let _ = f 1

Suppose you are not familiar with the function f and want to spot its
definition. Where to find it? Just from the code you are looking at,
it is not sure: if you are enough lucky it may be f in m.ml, n.ml or
o.ml. Otherwise, it may be O.f in n.ml. Or probably N.O.f in
m.ml. If you are unlucky and the project is so sophisticated, there could
be complex module operations in m.ml (i.e includes, functor applications)
and therefore the definition might be found somewhere completely unexpected.
Module packing, module load paths and library installation without .ml files
complicate the situation even worse.

You first days after joining a large OCaml project should be this kind
of manual value definition spotting with find + grep commands. Yes, actually
it is very educational: you can learn a lot about the project struggling
in the source tree (only if your collegues have organized things very
well :-P), but it is still a dull job...

To say short, OCamlSpotter is a tool which does this dull job automatically
for you and permits your energy for something more "interesting" like Yeti
spotting:

 - The -annot option of ocamlc and ocamlopt is extended and creates
   <module>.spot files (<module>.spit for .mli), which record the location
   information of the names defined and used in the module.

 - A small application ocamlspot provides automatic where-about spotting
   of the definition of the name you are interested in.

 - ocamlspot.el provides interactive ocaml-spotting of definition
   locations in emacs.

 - Interfaces for other editors such as vi can be built easily, if you want.

Donwload
=======
http://www.furuse.info/jun/hacks/ocamlspotter/ocamlspotter-1.0.tgz?attredirects=0

Have fun, and have a good new year.

Jun FURUSE


             reply	other threads:[~2008-12-25 13:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-25 13:47 Jun Furuse [this message]
2008-12-26 11:15 ` [Caml-list] " David Allsopp
2008-12-26 19:34   ` Jun Furuse
2008-12-26 22:51     ` David Allsopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5160b4200812250547l35a1536fuf687d9e277999bd0@mail.gmail.com \
    --to=jun.furuse@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).