Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of January 12 to 19, 2016.

  1. otags reloaded 4.02.1 for OCaml 4.02
  2. release of OCPWin, and wxOCaml
  3. - HTML5 and XML parsers with error recovery
  4. 1st MirageOS hackathon - 11th-16th March
  5. Ocaml Github Pull Requests
  6. Other OCaml News

otags reloaded 4.02.1 for OCaml 4.02


Hendrik Tews announced:
I updated otags to OCaml 4.02. You can find it at the usual place under the usual license GPL v3.

Otags reloaded generates tags tables for emacs and vi/vim. 

The problem with open! is now fixed and otags processes files
with module aliases, exception patterns and extensible variants.
However, camlp4 and therefore also otags have only very limited
support for attributes and extension nodes.

release of OCPWin, and wxOCaml


Fabrice Le Fessant announced:
I would like to announce a new release of OCPWin, the OCamlPro binary
distribution of OCaml for Windows. To test it, follow the links on the page:

OCPWin is a full OCaml binary distribution for Windows, available for both
4.02.1 and 4.01.0 in 32 and 64 bits. It is distributed as either a Graphical
Installer or Zip archives. OCPWin does not rely on Cygwin, and can be used
directly from a Windows terminal, or better a Git Bash terminal. OCPWin allows
multiple installs on the same computer, each distribution being managed
similarly to a switch in opam, using a tool called "ocpwin.exe" (`ocpwin -list
`, `ocpwin -install SWITCH`).

It is packaged in 3 different flavors:
- msvc : a distribution of OCaml relying on the MSVC compilers (Microsoft
Visual Studio). All the versions of MSVC since 9.0 to 14.0 are supported, and
automatically detected (they can be selected using an env variable called
- mingw: it is a self-contained OCaml+MinGW distribution, where MinGW (a gcc
for Windows) has been minimized to only contain the strictly needed files for
- full-mingw: it is a self-contained OCaml+MinGW distribution, with a full
MinGW distribution;

Note that even MinGW flavors can be configured after installation to use MSVC
instead of MinGW.

The changes also include using "ocpwin.exe" to register OCPWin in the user
PATH variable, instead of NSIS, to avoid the PATH-corrupting bug that previous
versions have suffered from. Both graphical installers and zip archives use
this new capability.

Support of MSVC has been tested by successfully compiling the last master
branch of wxOCaml ( ) for all
binary versions of wxWidgets, version 3.02 ( , VC 9.0, 10.0,
11.0 and 12.0). See the README.ocpwin file of wxOCaml. - HTML5 and XML parsers with error recovery


Anton Bachin announced:
I would like to announce the release of, a pair of streaming,
error-recovering parsers for HTML and XML. Usage is simple, like this:

  (* Pretty-print HTML, with error correction. *)

  open Markup

  channel stdin
  |> parse_html
  |> signals
  |> pretty_print
  |> write_html
  |> to_channel stdout


  (* Show up to 10 XML errors to the user and abort early. *)

  let report =
    let count = ref 0 in
    fun location error ->
      error |> Error.to_string ~location |> prerr_endline;
      count := !count + 1;
      if !count >= 10 then raise_notrace Exit

  string "some xml" |> parse_xml ~report |> signals |> drain

While still providing an easy basic interface, the parsers are
non-blocking and can be readily used with threading libraries such as
Lwt. For example, if "s" is a char Lwt_stream.t:

  (* Assemble HTML into a tree asynchronously. *)

  type html = Text of string | Element of string * html list

  Markup_lwt.lwt_stream s
  |> parse_html
  |> signals
  |> Markup_lwt.tree
    ~text:(fun ss -> Text (String.concat "" ss))
    ~element:(fun (_, name) _ children -> Element (name, children))
  >>= (fun tree -> ...)

The parsers detect input encodings automatically. Everything is
converted to UTF-8. aims at standard conformance. See the conformance status [1].
Modulo any bugs, should already be highly conformant, the
only significant missing pieces being the two error recovery algorithms
listed for HTML ( already performs the rest of HTML error

The library can be found here:

To install:

  opam install markup

Documentation is at:

Apart from ordinary improvements to the library, there are several
possible avenues of future work:

- An HTML5/XHTML polyglot serializer.
- Parsing of XML doctype declarations for a validation library built on
  top of
- An Async interface (mainly just applying a functor, but I am not
  experienced with Async at the moment).
- Factoring out the stream and I/O portions of into their own
  library or libraries.

Bug reports and contributions are greatly appreciated.

This work was prompted by Lambda Soup. That library could use a good,
modern HTML parser, and several people also commented on the need. depends on the excellent Uutf by Daniel Buenzli. I'd also
like to thank Daniel for giving useful early feedback on the library
in the last couple of days.



1st MirageOS hackathon - 11th-16th March


Hannes Mehnert announced:
the first MirageOS hackathon will be held in Marrakech, Morocco.
11th-16th March 2016, more information at

Everybody who wants to help improving MirageOS (a library operating
system written in OCaml) is welcome.  We have reserved accommodation
with full board, Internet is available, ...

If you like to attend, please register by sending a mail to

Ocaml Github Pull Requests

Gabriel Scherer compiled this list:
Here is a sneak peek at some potential future features of the Ocaml
compiler, discussed by their implementers in these Github Pull Requests.

Fixes bugs in stack unwinding metadata

Make Obj.is_block an inline OCaml function instead of a C primitive

OCAMLPARAM option passed using a configuration file

Other OCaml News

From the ocamlcore planet blog:
Thanks to Alp Mestan, we now include in the OCaml Weekly News the links to the
recent posts from the ocamlcore planet blog at

Psellos: OCaml for iOS 9.2

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