Previous week Up Next week


Here is the latest Caml Weekly News, for the week of 07 to 14 September, 2004.

  1. FaCiLe 1.1
  2. ocamlnet 0.98
  3. PXP 1.1.95
  4. Camomile 0.6.0
  5. Ocaml-Lua interface

FaCiLe 1.1


Nicolas Barnier announced:
Better late than never... it is our pleasure to announce the
release 1.1 of FaCiLe, a Functional Constraint Library over
integer and integer set finite domain written with OCaml.
This library is "Open Source" and licensed under the GNU
Lesser General Public License (LGPL).

Beside the overall gain in performance and bug fixes, FaCiLe
release 1.1 features:

 - Set variables and constraints
 - Limited Discrepancy Search
 - Backtrackable Invariant References
 - Automatic sharing of arithmetic subexpressions
 - A complete scheduling example with edge-finding

FaCiLe distribution includes sources, examples and a generic Makefile,
as well as the documentation, available at:

Comments, questions and bug reports are welcome and should be sent

-- Pascal Brisset & Nicolas Barnier

ocamlnet 0.98


Gerd Stolpmann announced:
The OcamlNet project announces version 0.98 of this library collection.
This version includes a lot of smaller updates (listed below), and one
major API change that might break applications using OcamlNet.

Remember there was a discussion on caml-list about a standard for
object-based I/O. There was an agreement about the class type interface: . This version of
OcamlNet implements this convention, and unfortunately, the "input"
method now raises End_of_file instead of returning 0 when the end is
reached. Of course, programs relying on the value 0 no longer work. When
programs stop with "Uncaught exception: End_of_file" this might be an
indicator for this incompatibility. Sorry for the inconvenience, but
standardization has its price.

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 implementation of the FastCGI protocol

- 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:

Developers and code contributions are welcome.

Ocamlnet is licensed under the zlib/libpng license.

List of further changes:

The legacy Cgi module is no longer built by default. One can still
create it by -enable-compatcgi.

Bugfixes in Netconversion's cursor implementation. It is now better
specified, and the corner cases are handled in a better way.

Bugfix in Mimestring.write_value: Folding of long encoded words is
now correct.

Bugfix in Netencoding.QuotedPrintable: Soft line breaks are added
when lines would become too long otherwise. Uses CRLF as line
separator in output now.

Bugfix in Nethtml: In some rare cases, end tags were handled

Addition: In Netchannels, there are now delegation classes. Useful
if one wants only to redefine individual methods, and not whole

Addition: Netchannels.lift_in and lift_out is a simplified interface
to lift a class from raw_in/out_channel to in/out_obj_channel.

Improvement: Netmime.basic_mime_header avoids unnecessary modifications
of the order of existing header fields. It is also faster.

Additions: Mimestring.split_mime_type, split_uri.
Netbuffer.add_char, insert_string, insert_sub_string, insert_char.

Addition: Netulex is a support module for ulex

Improvement: For bytecode, ocamlnet includes now "accelerators",
i.e. C implementations of some time-intensive auxiliary functions.
Currently, the character set conversions from ISO-8859-1 and from
UTF-8 are accelerated.

Enhanced Netsendmail module: It is now possible to create much
more complicated mails, e.g. multipart/related mails.

Improvements in Neturl: New function parse_url automatically selects
the URL syntax. Support for a lot of new URL schemes. Enhanced
URL syntax: Support for userparam, and the prevention of relative

Added charset CP-1047 (= Latin1 as EBCDIC).

Added ocamldoc to module interfaces, including a lot of tutorials.

PXP 1.1.95


Gerd Stolpmann announced:
There is a new development version of PXP, the advanced XML parser for
O'Caml. The development version includes new APIs which are not yet
fully stable (i.e. might still change); in general this version is
useable, however.

There are four major changes in this release (besides bug fixes):

- This version includes a ulex-based lexical analyzer for XML. "ulex"
  is Alain Frisch's new lexer generator for Unicode. ulex is thought
  as replacement for wlex, Alain's previous generator.
  The resulting analyzer is a bit slower than the wlex-based, but
  it is much simpler to build it (it is not distributed as patch).
  In the long term, support for wlex will be removed in favor of ulex.

  Note that there is still an ocamllex-based analyzer for Unicode,
  which is very fast, but also has a big memory footprint.

- The namespace concept has been revised. In addition to namespace
  prefix normalization, the structure of the namespace declarations
  is now stored in namespace_scope objects. This makes it possible
  to remember the mapping of the original prefixes to URIs, which
  is useful when the prefixes also occur as XML data (e.g. in

  The namespace concept is now 100 percent compatible with the
  W3C requirements.
- The infrastructure for event-based parsing has been extended.
  Streams of events can now be transformed to trees and vice versa.
  The type of events had to be changed to allow this (so events and
  tree nodes contain the same information).

- Finally, there is a preprocessor! This allows you to create XML
  trees or event streams in source code, e.g.

  let tree = <:pxp_tree< <root>[ <child1/> <child2/> ] >>

  creates a node with two children. Of course, it is possible to
  set the properties of the created nodes/events dynamically.

  The syntax is not exactly XML, and parts of it have been borrowed
  from cduce. The preprocessor bases on camlp4.

This version of PXP requires OcamlNet 0.98 (just released).

This version does not include a manual (it is really out of date). Look
into the commented interface files instead.

Download link:

More information:

Camomile 0.6.0


Yamagata Yoriyuki announced:
Camomile 0.6.0 is released.


Changes are

* Support Common I/O classes
( except
non-blocking I/O, which is not supported.
* Remove all C binding and related functions.
* Remove stdlib replacement introduced in 0.5.*
* UPervasives
  - utf8_*_channel are removed.
  - normalization mode are removed.
* UChar
  - UChar.is_printable is removed.
  - unsafe operations are removed.
  - UChar.int_of_uchar is renamed to UChar.int_of
  - UChar.uchar_of_int is renamed to UChar.of_int
* Locale
  - Locale.current_locale, Locale.set_locale are removed.
* CharEndocing
  - CharEncoding.enc_name is removed.
  - new classes:
        class CharEncoding.convert_uchar_input
        class CharEncoding.convert_uchar_output
        class CharEncoding.convert_input
        class CharEncoding.convert_output

Ocaml-Lua interface


Simon Heath announced:
Well, I wanted to use Lua from Ocaml, so I wrote an interface to do so.
It's somewhat incomplete and probably slightly buggy at the moment, and
the error-handling isn't great, but it works.  Comments and advice are
welcome; this is my first attempt to do anything big/serious with Ocaml's
FFI.  I've only tried this on Linux, but it should work fine under MinGW
or Cygwin.

You can get it at:
Christian Lindig said:
> I wanted to use Lua from Ocaml, so I wrote an interface to do so.

We have an implementation of Lua 2.5 in OCaml; since it is written in
OCaml, no C files are necessary.

The API makes it especially easy to extend the interpreter; there is a
paper about it:

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}$'?'&lt;1':1

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