English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[ANN] OCamlSpotter: OCaml compiler extension for source browsing, version 1.0
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-12-26 (22:51)
From: David Allsopp <dra-news@m...>
Subject: RE: [Caml-list] [ANN] OCamlSpotter: OCaml compiler extension for source browsing, version 1.0
Jun Furuse wrote:
> <snip>
> Sorry, but I do not think so:
>   include List
>   let g = length
> ocamlc 3.11.0 with -annot never informs about length, included from
> List. This is why a compiler patch is required at least for version
> 3.11.0.

This is a bug and should be reported in Mantis - [length] comes from an
external file so there should be an ext_ref annotation in the .annot file.

> > Besides this version specific reason, annot is a text and therefore it
> > must be pretty-printed at creation and parsed back at the use. It is
> > costly and sometimes files become very huge (few MBs sometimes). In
> > addition, some very important properties for browsing such as the
> > identifier stamp integers are simply lost at pretty printing and never
> > be recovered at parsing. From these difficulties, rather than pretty
> > printed, I think those information should be simply marshaled.
> > Marshaled spot files are always smaller than annots, and loading is
> > straightforward and pretty fast.

Define costly! I've never noticed Vim's interpreted, probably non-optimised
internal script language taking a significant amount of time to process the
.annot files (many of which are several megabytes) for all of my sources
every time I open the corresponding .ml file.

> > It is a very interesting approach but I did not take it, firstly
> > because this only works with compiled/compilable modules: it is often
> > very handy to browse sources with errors, even they are just partially
> > browsable. Secondly because I was (and am still) not very confident
> > whether cm* files contain all the information I need for spotter.

How much have you changed in the compiler? While compiling foo.ml, all
external references are already compiled (or you'll get an error that the
.cmi file for an interface is missing). The compiler also gives as much info
in the .annot file for sources which contain errors already. Surely the .cmi
file must contain enough information virtually by definition - it's all the
compiler had to go on in the first place!

> > OCamlFind is a great tool, but there are many people who are happy
> > without it.

My impression reading this list is that the majority of the community would
like it included in the main OCaml distribution but let's not re-open that
thread of discussion again ;o) If someone's willing to install a tool like
ocamlspot involving, at present, a patched compiler then I'd imagine that
they'd not have too much issue installing findlib too...