Google Groups

Re: type_conv/ocaml4 release

Anil Madhavapeddy Sep 7, 2012 6:57 PM
Posted in group: ocaml-core
Stream of notes here:

- Compiles on the Mac, hurrah!  Compiling my little HTTP library against it, and I notice:

(** [write_when_ready writer ~f] waits until there is space available in the pipe, and
    then calls [f write], where [write] can be used by [f] to write a single value into
    the pipe at a time.  [with_write] guarantees that the pipe is open when it calls [f],
    and hence that the writes will succeed, unless [f] itself closes the pipe. *)

- Pipe.with_writer is now gone, but there is still a reference to it in the ocamldoc above in the renamed function.

- Similarly, Deferred.whenever is now gone, but there is a reference that should be renamed to Deferred.dont_wait_for:
  async_core/async_stream.mli:(** [iter t ~f] = [whenever (iter' t ~f:(fun a -> f a; Deferred.unit))] *)

- The new name Deferred.don't_wait_for seems really awkward with the apostrophe in it.  Why not just call it 'do_not_wait_for' or 'dont_wait_for' ?  Its quite rare to have function names with special characters, and the apostrophe is easy to mistake for a type variable when scanning through code.  It may be too much hassle to change it now though...

- The unconditional use of GADTs in async_extra answers my earlier question about ocaml-4 being a requirement. I'll add a constraint to the OPAM packages.

- I like the new TCP.Where_to_listen use of GADTs. It's a much more self-documenting interface than before!

Cohttp only requires a small diff to compile with the new version. I'll test it over the weekend as I write tutorial notes.


On 7 Sep 2012, at 17:43, Anil Madhavapeddy <> wrote:

Trying it now. I've pushed updates to the avsm/opam-core-pre0 and am compiling them now.

Is there a hard requirement on ocaml-4.00.0 now? bin_prot's myocamlbuild:

+ + /usr/bin/ocamlopt.opt -I /usr/lib/ocaml/ocamlbuild unix.cmxa /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
+ File "", line 506, characters 24-50:
+ Error: Unbound value Filename.get_temp_dir_name

...which only appeared in ocaml-4.00.0, so 3.12.1 compilation fails (Debian/wheezy).


On 7 Sep 2012, at 17:13, Yury Sulsky <> wrote:

Hi Anil,

I've just uploaded new packages to I've moved the async hack down into base/async/, so it should work when building async individually.

Could you take a look and see if they work for you?


On Thu, Sep 6, 2012 at 7:12 PM, Anil Madhavapeddy <> wrote:
Spot on... looks like OPAM might be leaking an environment variable that is pointing to the wrong DLL stubs directory after a compiler switch.  Should be easy to fix.

Sorry about that; I'll clean up the 25 different OCaml installations I have and do a more fresh build as soon as I get a chance!


On 6 Sep 2012, at 16:09, Yury Sulsky <> wrote:

Ah, okay. Anil, it looks like there might be some mixup in your install. The string "caml_hash_mix_double" only appears ocaml-4.00, but nowhere in ocaml-3.12.
Also, I was confused. It turned out I was testing with 3.12.1 on Mac OS after all, which is why I didn't catch that unused value warning. I'll install and test with 4.00 on a Mac tomorrow.

On Thu, Sep 6, 2012 at 6:55 PM, Yury Sulsky <> wrote:
Hi Markus,

A few of your sexplib changes didn't make it into this release, and I'll take a look at your patch queue to see what else we're missing. But I've been building and testing on Mac OS X. I'll see if I can recreate Anil's missing symbol problem (I haven't been testing with 3.12.1)

On Thu, Sep 6, 2012 at 6:42 PM, Markus Mottl <> wrote:
On Thursday, September 6, 2012, Anil Madhavapeddy wrote:
The warnings are due to unused variables,

You might also want to apply my Bitbucket patch queue for ocaml-core.  The resulting tree should build fine on Mac OS X, fixes a couple of bugs, and adds some useful features.


Markus Mottl