Previous week   Up   Next week
Hello,

Here is the latest Caml Weekly News, week 04 to 11 February, 2003.

1) Future of Camlp4
2) Support for Unicode
3) ocamlnet-0.95 released
4) Optimizing false polymorphic local functions
5) First release of Cstr

======================================================================
1) Future of Camlp4
----------------------------------------------------------------------
Xavier Leroy announced:

As release manager of the OCaml distribution, the time has come to
make a clear statement on this Camlp4 issue.

In 2001, both Daniel de Rauglaudre (the designer and implementor of
Camlp4) and the rest of the OCaml development team agreed to integrate
the distribution of Camlp4 within the OCaml distribution.  The primary
goal was to enhance the users' experience by making it much easier to
install Camlp4.  Other goals included giving greater visibility to
Daniel's excellent, high-quality work on Camlp4.  I believe these
goals were met beyond original expectations, and the merge was
beneficial to all parties involved.

Later, Daniel proposed that Camlp4 should be removed from the OCaml
distribution, and again be distributed separately.  The other OCaml
developers, as well as those users that voiced their opinions on this
mailing list, were not favorable to this split, as it appeared (to
them) to be a step backwards.

Merging Camlp4 and OCaml was a collective decision.  Undoing this
merge would have to be a collective decision also, and no such
decision has been taken.  Daniel disagrees with this, and threatens
to stop working on Camlp4 as a consequence.  That is his right, but
this threat isn't going to change the decision.

Camlp4 remains part of the OCaml distribution, and will be maintained
like everything else.  Yes, it will probably not evolve as quickly as
if Daniel was still working on it.  and Daniel's programming talents
will be missed.  However, all the features of the current Camlp4 (that
from release 3.06 of OCaml) will still be available and properly
maintained in the future releases of OCaml.

Hope this clears up the uncertainty and doubts.

======================================================================
2) Support for Unicode
----------------------------------------------------------------------
Rui Dias Jorge asked and Jérôme Marant answered:

> Hello.
> 
> I´m using Ocaml to implement a XML parser and I need to consider
> documents with character encodings such as UTF-8 and UTF-16.  Does
> OCaml support in some easy way character encodings different from
> US-ASCII? If no, how can I implement Unicode?  Could someone give me
> some help?

Camomile is what you want.

http://sf.net/projects/camomile

======================================================================
3) ocamlnet-0.95 released
----------------------------------------------------------------------
Gerd Stolpmann announced:

I have recently released the newest versionn of ocamlnet.
This release only addresses issues with the jserv support.

----------------------------------------------------------------------------
What is ocamlnet?
----------------------------------------------------------------------------

A collection of modules for the Objective Caml language which focus on
application-level Internet protocols and conventions.

The current distribution contains:

- a mature implementation of the CGI protocol

- an implementation of the JSERV protocol (AJP-1.2), can be used with
  mod_jserv (Apache JServ) and mod_jk (Jakarta connector) to connect
  application servers written in O'Caml with web servers

- an experimental POP3 client

- a library of string processing functions related to Internet
  protocols (formerly known as "netstring" and distributed separately):
  MIME encoding/decoding, Date/time parsing, Character encoding
  conversion, HTML parsing and printing, URL parsing and printing,
  OO-representation of channels, and a lot more.

Ocamlnet is developed as a SourceForge project:

  http://sourceforge.net/projects/ocamlnet

Developers and code contributions are welcome.

Ocamlnet is licensed under the zlib/libpng license.

----------------------------------------------------------------------------
Where can I download the sources?
----------------------------------------------------------------------------

http://prdownloads.sourceforge.net/ocamlnet/ocamlnet-0.95.tar.gz
http://www.ocaml-programming.de/packages/ocamlnet-0.95.tar.gz

You NEED the PCRE library as prerequisite, and findlib is recommended
(but not required).

----------------------------------------------------------------------------
Where can I read more?
----------------------------------------------------------------------------

http://ocamlnet.sourceforge.net. There is also an online version of the
manual.

----------------------------------------------------------------------
Changes in 0.95:
----------------------------------------------------------------------

Several bugfixes in the jserv modules. There is now a jserv
property "ocamlnet.https" to set that the server assumes
the HTTPS protocol. New jserv config options js_idle_worker
and js_idle_master to perform idle callbacks when nothing is to
do.

======================================================================
4) Optimizing false polymorphic local functions
----------------------------------------------------------------------
Pascal Zimmer described:

The other day, I ran into a significant speedup improvement.
Here is a simpler (and artificial) version:

let min_list l =
 let rec loop mini = function
    [] -> mini
  | (x::r) -> loop (if x <= mini then x else mini) r
 in loop max_int l;;

This function computes the minimal element of an int list. Note however
that the inner local function "loop" is polymorphic.

Now consider the slightly different version where "loop" is forced into
a monomorphic function:

let min_list l =
 let rec loop (mini:int) = function
    [] -> mini
  | (x::r) -> loop (if x <= mini then x else mini) r
 in loop max_int l;;

On my computer in native code, the speedup is really significant: more
than 6 times faster (OK this example was built on purpose...). The
reason is that in the first case, the operator <= is replaced by a call
to the internal polymorphic compare_val function, whereas is the second
case a direct comparison between integers is performed.
Note also that if you replace the "if" statement by "min x mini", you
don't get any speedup because the polymorphic function "min" is called
in any case.

I suspect there are other cases in which the compiler can produce a  
better code when it knows more precisely the types involved. So my   
question is: would it be possible to help him in this way by enforcing
the type checker to infer a monomorphic type in such situations ? By
"such situations", I mean: local polymorphic functions that are used in
exactly one monomorphic setting afterwards. Of course, this is not
desirable for global functions, since it may break the calculus; but for
local functions, it should be of no harm since we know all the places
where they are used, and it would not change the type of the wrapper,
thus being transparent for the user...

Any comment ?

======================================================================
5) First release of Cstr
----------------------------------------------------------------------
Bruno Verlyck announced:

Somewhere deep in the Cash (http://pauillac.inria.fr/cash/) documentation,
there's an
   Oops: the SRFI-13 librar[y is] not implemented for now
This line is (nearly) obsolete.  As this library is of general interest, I
distribute it separately.  So:

I'm pleased to announce the first release of Cstr (numbered 0.80), a
full-featured string and charset library.  It is a Caml implementation of
SRFIs 13 and 14 (http://srfi.schemers.org).

Short description:
 This library contains procedures that create, fold, iterate over, search,
 compare, assemble, cut, hash, case-map, and otherwise manipulate
 strings.  They are provided by the String13 module.
 It also provides a set-of-characters abstraction, which is frequently
 useful when searching, parsing, filtering or otherwise operating on strings
 and character data.  This is provided by the Charset14 module.

The documentation is incomplete; only the String13 module has documentation.
While waiting for some time to do it, I put an srfi-14.txt file in the
sources, containing the starting spec of Charset14 (srfi-13.txt is there
too).

For more information, see:
 http://pauillac.inria.fr/cash/cstr
Download the most recently distributed source:
 ftp://ftp.inria.fr/INRIA/Projects/cristal/cash/cstr/cstr.tar.gz
Latest development / bug fixes (CVS archive):
 http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/cash/cstr/
Documentation:
 http://pauillac.inria.fr/cash/cstr/latest/doc/doc.dvi
 http://pauillac.inria.fr/cash/cstr/latest/doc/doc.ps
 http://pauillac.inria.fr/cash/cstr/latest/doc/index.html

Bug reports, comments, doc typos, and contributions are very welcome:
drop me a mail at Bruno.Verlyck@inria.fr.

I hope this will answer to some recurring requests to have more features in
the standard String module (on which Cstr doesn't depend).

======================================================================
Old cwn
----------------------------------------------------------------------

If you happen to miss a cwn, you can send me a message
(alan.schmitt@inria.fr) and I'll mail it to you, or go take a look at
the archive (http://pauillac.inria.fr/~aschmitt/cwn/). If you also wish
to receive it every week by mail, just tell me so.

======================================================================

Alan Schmitt