Christoph Höger | 31 Oct 15:42 2014

is it possible to embed an OCaml interpreter into an OCaml Module?

Dear all,

I already asked this on stackoverflow and was pointed to
compiler-libs.toplevel - indeed this API seems to be sufficient to run
an OCaml interpreter from inside an OCaml program (as that seems to be
what utop does).

But ist it also possible in some way to embed that interpreter safely
in an OCaml Module (so I can reuse it e.g. from within utop)?
Currently, it seems that there is exactly one dedicated toplevel for
every running bytecode interpreter and when running utop, it is
already in use.

So what I would need would be the ability to execute a phrase from
within a call of execute_phrase. I already clonded the toploop module
and for tehe time being I am fine with that. What I need is a way to

a) safe the already set ('outer') toplevel value bindings
b) restore the nested value bindings
c) execute the compiled bytecode
d) restore the 'outer' value bindings

is there someone who can point me to a solution?

Christoph Höger

Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen
(Continue reading)

Hannes Mehnert | 30 Oct 22:15 2014

[ANN]: tls-0.2, nocrypto-0.2, x509-0.2, asn1-combinators-0.1.1

Dear OCaml hackers,

More than 3 months ago we announced the 0.1 release of our TLS library
pack (BSD licensed). Since then we fixed bugs based on user feedback
and also implemented new features.

Now we prepared a pre-halloween special release :)

Highlights (more details are in of each repository):
nocrypto-0.2: uses ctypes, DSA, CCM, compiles on 4.02
tls-0.2: epoch exposes information about negotiated session, enum
cleanups (ciphersuites, protocol versions, hash algorithms)
asn1-0.1.1: stricter decoding of integers in tags and OIDs,
performance improvements
x509-0.2: information about used trust anchor, more utility
functions exported

Read our blog series about the initial release at
An https server in OCaml visualising the TLS handshake

The updated packages are already in opam, opam update && opam upgrade
(or opam install tls/nocrypto/x509/asn1-combinators) should be all you
need to do.

If you encounter any issues, please report these on GitHub in the appropriate project.

(Continue reading)

Philippe Veber | 30 Oct 15:51 2014

Typing of a parameterized class where the type parameter is the type of self.

Dear list,

I'm not sure why the following class definition is typed the way it is:

        OCaml version 4.02.1

# class type ['a] c = object ('a) method m : 'b end;;
class type ['a] c = object ('a) constraint 'a = < m : 'b. 'b; .. > method m : 'b end

In particular I don't understand why the method m gets a polymorphic type. This bites me when I try to specialize the type :

# type 'a t = (< m : int ; .. > as 'a) c;;
Error: This type < m : int; .. > should be an instance of type 'a c as 'a
Types for method m are incompatible

Instead of the type with polymorphic methods, I would have expected the following type:

# class type ['a] c = object ('a) constraint 'a = < m : 'b; .. > method m : 'b end;;
class type ['a] c = object ('a) constraint 'a = < m : 'b; .. > method m : 'b end

And then have no problems doing what I wanted:

# type 'a t = (< m : int ; .. > as 'a) c;;
type 'a t = 'a constraint 'a = < m : int >

What did I get wrong?


Jun Furuse | 30 Oct 13:53 2014

[ANN] OCamltter 3.0.0, a Twitter client and OAuth, Twitter and Flickr API library


We have released OCamltter 3.0.0, an OAuth framework in OCaml. It
includes OAuth and some APIs for Twitter and Flickr, and OCamltter CLI
Twitter client.

Version 3.0.0 generalized OCamltter 2.x's Twitter OAuth library so
that now it can also support Flickr API access. Still only handful
APIs are implemented but I use it to upload my family photos to Flickr
quite nicely.

OCamltter 3.0.0 is now available via OPAM.
Its source repo is at:



Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:

Ramu Iyer | 29 Oct 14:49 2014

Learning OCaml

We are currently implementing a business process management solution by customizing an ERP application. Natural language requirements are entered as development work items in TFS.  There is an opportunity to increase the rigor of the formal specification.  

*  Is there an approach to reverse engineer a system specification of a tool (such as Dynamics AX)?
*  Is there a formal process to discover the accumulated technical debt in a given implementation? 

These questions are somewhat high-level and I'd be glad to obtain any inputs that will help me incrementally advance to the next step (using OCaml as a formal method). 



Sébastien Hinderer | 29 Oct 13:27 2014

Archives of the list in mbox format?

Dear all,

(sorry for the noise)

Is there a way to download the archives of the list in mbox format on a
per-month basis or so?

More specifically, I'd be interested in re-reading two threads of this
month, one about get_temp_dir_name and the other about String.create.

I tried to read them through the web but only found sites using
Javascritp I can't use.



Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:

Jacques Garrigue | 29 Oct 11:10 2014

[Announce] LablGTK 2.18.3

Dear Camlers,

Due to a subtle incompatibility with ocaml 4.02, here is a new version of

LablGTK is an interface for the Gtk+ toolkit, version 2. It also
wraps many extensions, such as libglade, for rapid prototyping,
or gtksourceview2, for programming editors.

It should soon be available on opam.

Jacques Garrigue

LablGTK 2.18.3 changelog:

  * add Gdk.Window.create_foreign and set_transient_for functions (Tim Cuthbertson)
  * CAMLparam initializes with Val_unit rather than 0 since ocaml 4.02.
    Fix a related problem in ml_gobject.
    This caused random crashes with unison (Christopher Zimmermann, PR#1425) 
  * Also factorize some code to use Val_option_*
  * Replace XID by GdkNativeWindow where required.
    You may need to insert calls to Gdk.Window.native_of_xid in some places.


Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:
Maxence Guesdon | 28 Oct 17:41 2014

[ANN] Stog 0.14.0


Stog is a static web site compiler. It is able to handle blog posts as
well are regular pages. It can be seen as a kind of Jekyll developed in

Since release 0.12.0, Stog can be used to compile a single file to
admittedly publish HTML files where PDF was used (think about math
articles, for example).

Since release 0.13.0, a preview server can be used, watching changes and
updating the page in your browser when you save source files. 

Release 0.14.0 is now available, with some improvements.

See here for details:

I made a demo video here:

Maxence Guesdon


Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:

Sylvain Le Gall | 28 Oct 10:47 2014

Migration starting this evening, bzr disabled for now

Starting the migration, some services are down.

More information:
Francois Berenger | 28 Oct 10:27 2014

Is it possible to define a Printf.sprintf-like that is lazy?


I mean, the parameters are not formated unless the function is forced.



Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:

David Allsopp | 27 Oct 18:56 2014

Vagaries of Printf variants


let f fmt = Printf.printf fmt;;

[f] will have type ('a, out_channel, unit, unit) format4


let f fmt = Printf.ksprintf print_string fmt

[f] will have type ('a, unit, string, unit) format4

They do exactly the same thing (at least in terms of side effects) - what's
the fundamental reason for having to suffer their having incompatible format
types? It becomes excessively irritating when trying to switch between
different formatters (as a given format string cannot be used in a way in
which it appears to have more than one type, obviously), but I'm sure
there's a reason for its being that way!



Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports: