From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 839C5BB84 for ; Thu, 25 Dec 2008 14:47:07 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApgCAKMdU0nRVdoUimdsb2JhbACDHJARPgEBAQoJDAcPBaoLWINTgQSLNQEDAQOGQQ X-IronPort-AV: E=Sophos;i="4.36,281,1228086000"; d="scan'208";a="21728947" Received: from mail-bw0-f20.google.com ([209.85.218.20]) by mail1-smtp-roc.national.inria.fr with ESMTP; 25 Dec 2008 14:47:07 +0100 Received: by bwz13 with SMTP id 13so10347909bwz.3 for ; Thu, 25 Dec 2008 05:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=wOsOWEAfbPt7QQ/yMgCMAOsFE+4qKKlFAaQfhjdhlCs=; b=Rv0jbt7DkCaz1aipyo+okTRWtDw3DKutwRZcswWSJc1cDykEixuRtfWeQ7OdZmRGrL T9P5Txpucx26BA0Z+CNNd72EUUZtrsJL7JklkBRhmQLSrWZIyhNgnOYf4tdR8q1T9vjG P2gpghzZvSb2YDBHE2WI+4xbp72UE+6dJ8dvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=w8YC964wg7iVoQRAPGQPcE/JaDI7hN7TxIPStBqKQsjfskeCskQAnh7d9MzafKqeWf hoDZ8N5zBBVXEQ2DdND9RPgZ5pOIRBCS5uNWu7iqmRRrjfG7226hn/Zeo0VIv/VT65uo unN/ayOeuygWlCkKNHyGxP5i6FjiczjT9jEik= Received: by 10.181.226.2 with SMTP id d2mr2596859bkr.15.1230212826119; Thu, 25 Dec 2008 05:47:06 -0800 (PST) Received: by 10.181.25.5 with HTTP; Thu, 25 Dec 2008 05:47:06 -0800 (PST) Message-ID: <5160b4200812250547l35a1536fuf687d9e277999bd0@mail.gmail.com> Date: Thu, 25 Dec 2008 22:47:06 +0900 From: "Jun Furuse" To: caml-list@yquem.inria.fr Subject: [ANN] OCamlSpotter: OCaml compiler extension for source browsing, version 1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam: no; 0.00; furuse:01 furuse:01 ocaml:01 compiler:01 ocaml:01 python's:01 functor:01 ocamlc:01 ocamlopt:01 mli:01 emacs:01 1.0:98 hacks:01 grep:01 short:01 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 .spot files (.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