Previous week Up Next week

Hello

Here is the latest Caml Weekly News, for the week of 04 to 11 May, 2004.

  1. Qt bindings?
  2. New book about OCaml programming
  3. OCaml development site
  4. ocamldep
  5. OCaml and bignums
  6. ocamldap 1.4.6, rmwd 0.7, inifiles 1.0

Qt bindings?

John Goerzen asked and Yann Regis-Gianas answered:
> I have seen some noise on various lists about Qt bindings for OCaml.
> Have these ever materialized?
>
> FYI: the Sharp Zaurus PDA comes with Qt/Embedded.  The "default"
> language for development is C++, but if one installs a Python
> environment on the device, PyQt can be used (unmodified) to write
> handheld apps.  I'd like to be able to write these apps in OCaml, which,
> when compiled with ocamlopt, would have the distinct advantage of not
> requiring a big runtime environment to be installed.
>
> There are also versions of Linux for the iPAQ and other handhelds that
> also use Qt/Embedded as the native UI.
>
> So this is why I ask :-)

I am working with a friend on a binding. It is at an early stage of
development, but your are welcomed to help us:

        https://savannah.gnu.org/projects/kamel/
    

New book about OCaml programming

Valerie Menissier announced:
                                French version

Nous sommes heureuses de vous annoncer la parution de notre ouvrage:

    Apprentissage de la programmation avec OCaml
    Catherine Dubois & Valérie Ménissier-Morain
    Éditions Hermès Science Publication
    ISBN 2746208199

Cet ouvrage est destiné à des débutants en informatique, plus
précisément en programmation (étudiants de Deug Sciences par
exemple). Il est également un support pédagogique pour tout
programmeur désireux d'aborder le style fonctionnel ou disons le style ML.

Les développements les plus significatifs de l'ouvrage sont
disponibles l'adresse
    http://www-calfor.lip6.fr/~vmm/Livre_prog_CD_VMM

Ce livre n'est à l'heure actuelle disponible qu'en français. Toute
personne intéressée par la traduction de cet ouvrage en anglais peut
prendre contact avec nous.

--------------------------------------------------------------------------

                                English version

We are happy to announce the parution of the following book in french :

    Apprentissage de la programmation avec OCaml
    Catherine Dubois & Valérie Ménissier-Morain
    Editions Hermès Science Publication
    ISBN 2746208199

It is dedicated to students that want to learn programming. It is a
good pedagogical support to start with functional and imperative
styles, or more precisely with the ML style.

Pieces of OCaml code can be found at
    http://www-calfor.lip6.fr/~vmm/Livre_prog_CD_VMM

The book is written in french. Anybody interested in the translation
to english can contact us.
    

OCaml development site

Editor's note:
This following message started a pretty long thread. You can read the whole
thread here: http://caml.inria.fr/archives/200405/msg00134.html
    
Christophe Troestler said:
Richard Jones and myself are thinking about setting up a collaborative
development site for OCaml projects.  Not only this can show to the
world how active the OCaml community is [and to prevent code from
disappearing when the developer is not interested in maintaining it
anymore] but also serve as a base for a CPAN-like repository.

Before engaging into the work of setting it up, we would like to have
some feedback from you:

* If such a site existed, would you move your project(s) to it
  (tarballs, documentation, CVS,...)?

* Are you interested that such a site provides some documentation to
  help you package your software?  (To GODI and Debian maintainers:
  would you be willing to contribute to it?)

* Do you prefer a Savanah like interface (https://savannah.gnu.org/)
  or a GForge one (http://gforge.org/) or ...?

* Are the services provided by these tools enough for you?  If not,
  please be specific.

* Are some people interested in setting up a mirror?
    
Owen Gunden said:
> Richard Jones and myself are thinking about setting up a collaborative
> development site for OCaml projects.  Not only this can show to the
> world how active the OCaml community is [and to prevent code from
> disappearing when the developer is not interested in maintaining it
> anymore] but also serve as a base for a CPAN-like repository.

I'm not sure the CPAN-like repository is the right approach.
Introducing a second code distribution platform would create
competition, which in this case is most definitely /not/ healthy,
because there are so few people working on O'Caml packaging now.  A lot
of work has gone into and continues to go into GODI/GODIVA, and a lot of
overlapping work would have to go into this CPAN-like repository.

Will Lovas and I considered designing just such a system way back in
September, and we decided not to for similar reasons.  The reasons are
even more potent now, however, because of all the progress since then.

What has been outlined here and in other threads indicates that many
people do not understand exactly how GODI and GODIVA work.  For example,
it is not cathedral-type development--I know this for sure as I've
released packages through GODI without having to get them reviewed by
the Master.

It has also been suggested to work out a system that can incrementally
be improved.  GODI/GODIVA is such a system.  For example, I would like
to see the hairier parts of GODI (BSD make, pkgsrc) replaced by O'Caml
tools eventually (and I think there are even bugs for this).

My suggestion to anyone wanting to brighten package management and
distribution of O'Caml code is: join godi-list, get a svn account from
Gerd, try to package some things up with GODIVA, and then complain about
what you don't like (or even fix it!).  Help to morph GODI/GODIVA into
the right tool.  I think at this early stage, even seemingly large
design changes are possible, if it is deemed that they are necessary.

Finally, the idea of giving developers a place to host their websites,
cvs accounts, and mailing lists is probably an orthogonal problem to
GODI.  So sure, go ahead with that if you want to.  I warn you that it
seems on this list that O'Caml programmers are very particular about
what revision control system (and probably web tools, etc.) they use, so
may be hard to please a critical mass :).
    
Benjamin Geer answered Owen Gunden:
N. Owen Gunden wrote:
>a lot of
>overlapping work would have to go into this CPAN-like repository.

To me their proposal seems complementary to GODI.  GODI provides the
convenience of being able to get a lot of libraries in one place.
Richard and Christophe's proposed site could be a place where you could
find a lot of stuff *about* those libraries (mailing lists,
documentation, development versions) in one place, and with a consistent
user interface; I think it would be a great service to the community.
Maybe it could be designed so that it doesn't overlap with GODI, but
rather cooperates with it.

>I warn you that it
>seems on this list that O'Caml programmers are very particular about
>what revision control system (and probably web tools, etc.) they use, so
>may be hard to please a critical mass :).

Some do feel strongly about such things, but I don't.  Having a site
where everything worked in a consistent manner for every project would
be a big benefit for users; that would outweigh any small inconvenience
for me as a developer.

A Perl developer remarked to me recently that one of the main benefits
of CPAN is that it encourages Perl developers to look at, and reuse,
each other's code.
    
Christophe Troestler concurred:
> it doesn't overlap with GODI, but rather cooperates with it.

Let me emphasize: we do NOT want to compete with GODI, Debian
packaging,...  But with a critical mass of software gathered at one
place, LINKS to packaging systems (and how to use them) could benefit
users and developers alike IMHO.
    

ocamldep

Skaller asked and Nicolas Cannasse answered:
> Any chance of a -S option on ocamldep
> which generates a list topologically sorted
> files?
>
> Or a script (ocaml, perl, whatever) that takes
> ocamldep output and does so?
>
> I'm having trouble building a .cmxa library.
> I can't sort ocamldep output in my head.. :)

OCamake will do it for you !

http://tech.motion-twin.com

(it can also generate a proper standalone Makefile).
    
Skaller asked for precisions and Nicolas Cannasse said:
> Please clarify. I need this:
>
> make_order dirname >out
>
> where 'out' is a plain list of module names
>
> A
> B
> C
> D
>
> which allows me to compile
>
> A.mli
> B.mli
> C.mli
> D.mli
> A.ml
> B.ml
> C.ml
> D.ml
>
> and then put the *.cmx into an *.cmxa in that order.
>
> I'm not interested at the moment in using make
> to actually build anything, I just want
> an easy way to recompute a topological sort
> of the module dependencies.

There is such algorithm in OCamake, which is a basic topological sort with
additionnal tricks when cross dependencies are found (since ocamldep does
not report the difference between dependencies for using types and
dependencies for using functions, the later only need a linkage dependency).
From the OCamake sources :

" In order to link, we need to order the CMO files.
We currently have a ML/MLI dependency graph (in fact, tree) generated
by ocamldep.
To build the CMO list, we are reducing the dep-tree into one graph merging
corresponding ML & MLI nodes. ML-ML edges are keeped, ML-MLI edges
become ML-ML edges only if they do not create a cycle in the reduced
graph."

The other - best - way would be to have a tool that does that directly from
the depencies expressed in the CMO / CMX, so we don't care anymore about
types-only imports. Ocamldep is only working at a syntax level and is good
in order to compile, but does not provide enough informations for linking :
such an algorithm would be very useful directly in the linker !
    
Stefano Zacchiroli also answered the initial question:
> Or a script (ocaml, perl, whatever) that takes ocamldep output and
> does so?

ocamldsort

  http://dimitri.mutu.net/files/
    

OCaml and bignums

Roberto Bagnara asked and Michel Quercia answered:
> I have made a web search to understand which kind of
> support for bignums is available for OCaml.
> I must say that I am rather confused: it is not clear
> to me which packages are still maintained and which
> are dead, which ones are more widely used, and what
> are the relative merits of the various proposals.
> I would appreciate it very much if someone could
> put me on the right track.
> All the best,

To my knowledge, there are 3 bignum packages available for Ocaml :

1. The Bignum library shipped within the standard Ocaml distribution and maintained by the INRIA
team. It provides support for big integers and for rationnals.

2. MLGMP : bindings for the GNU Multiprecision library, maintained by David Monniaux
(http://www.di.ens.fr/~monniaux/download/mlgmp.tar.gz). It provides support for big integers, for
rationnals and for big precision floats.

3. Numerix : another multiprecision library maintained by me
(http://pauillac.inria.fr/~quercia/cdrom/bibs/numerix-0.19b.tar.gz). It provides support for big
integers only, on x86/Unix platforms.

I have no idea on how widely each package is used.

Relative merits :

-- Bignum is standard and portable. It should be the best choice for "small bigints" (up to a few
words long). The algorithms have a quadratic complexity, and are not suitable for hudge bigints.

-- MLGMP has the merits of GMP : portable and very fast (quadratic and subquadratic algorithms
depending on the sizes of the inputs). The only drawback is a possibility to exhaust memory in long
computations due to the use of two separate GC (the one of Ocaml and the one of GMP).

-- Numerix is my baby, so I'll let other users say if it has merits. Same scheme as GMP (choose a
suitable algorithm depending on the sizes of the inputs), without the double-GC problem. The
drawback is portability : works on x86/Linux.
    

ocamldap 1.4.6, rmwd 0.7, inifiles 1.0

Eric Stokes announced:
ocamldap 1.4.6
Ocamldap is a suite of libraries for accessing ldap directory services.
It includes low level functions such as bind, search, modify, etc, as well as 
high level OO libraries for representing objects, understanding and using the 
directory schema, and generating attribute values.

Changes
the 1.4 series brings schema parsing, and an "ldapaccount" object for 
high level management.
1.4.6 fixes many bugs in the ldif parser, and a few nasty ones in
ldapaccount.

Location
http://www.npc.de/ocaml/linkdb/

rmwd 0.7 (remote middleware daemon)
rmwd is a library for identity management built on top of Ocamldap, and
exposed as an rpc server. It implements high level abstractions, and fine
grained access control.
It also ties in (and comes with) to a remote event system designed for
identity management.
The event system allows any type of action (notably provisioning) to be
taken whenever an rmwd function is called.

Changes
- event system
- many many bug fixes
- a few new functions

Location
http://ncc.csun.edu/opensource/rmwd/rmwd-description.html

Inifiles
A tiny library for parsing and writing .ini files. First release.

Location
http://www.npc.de/ocaml/linkdb/
    

Using folding to read the cwn in vim 6+

Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).

:set foldmethod=expr
:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'<1':1
zM

If you know of a better way, please let me know.


Old cwn

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe online.


Alan Schmitt