[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-12-03 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of November 26 to December 
03, 2013.

1) pfff 0.25, tools and APIs for program analysis of PHP/Java/JS/C/ML/PHP/...
2) improved BER MetaOCaml N101, for OCaml 4.01
3) how to create (format) directives that do not take any arguments?
4) Confusing behaviour of type inference for polymorphic classes
5) Main program in C - a script
6) Js_of_ocaml 1.4
7) Other Caml News


1) pfff 0.25, tools and APIs for program analysis of PHP/Java/JS/C/ML/PHP/...
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00199.html

** Yoann Padioleau announced:

pfff is a set of tools and APIs to perform some static analysis,
dynamic analysis, code visualizations, code navigations, or
style-preserving source-to-source transformations such as refactorings
on source code. For now the effort has focused mainly on PHP but there
is also good support for C, C++, Java, HTML, JavaScript, and CSS.
There is also very good support for OCaml and noweb (literate
programming) so that pfff can be used on the code of pfff itself.

For more information see the pfff wiki at:
https://github.com/facebook/pfff/wiki/Main

The current release source code is accessible from:
https://github.com/facebook/pfff/releases/tag/v0.25.1

There is now also an OPAM package for pfff. It contains though just
the parsers, visitors, and AST dumpers (for C, Java, Javascript, PHP,
ML, HTML and CSS). To install it just do:

   $ opam install pfff

Once installed you should have access to the different libraries
in ~/.opam/.../lib/pfff-lang_yyy. 

The AST dumpers are useful to get familiar with the constructors.
Here is an example:

   $ cd pfff
   $ cat demos/foo.js
function foo() {
  return 1;
}
   $ ./pfff -dump_js demos/foo.js
[FunDecl(
   {f_tok=Some(()); f_name=Some((foo, ())); f_params=[]; 
f_return_type=None; 
f_body=[St(Return((), Some(L(Num((1, (), Some((]; });
FinalDef(())]

In the next few weeks I'll make OPAM packages for the other components
of pfff: sgrep, spatch, stags, codemap, codegraph, the treemap
library, etc.

Thanks to:
 - Eric Cooper for the initial version of the java parser
 - Patrick Doane and Gerd Stolpmann for their html parser
 - Dario Teixeira for his css parser
 - Facebook
  

2) improved BER MetaOCaml N101, for OCaml 4.01
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00200.html

** oleg announced:

BER MetaOCaml N101 is now available. It is a strict superset of OCaml
4.01, extending it with staging annotations to construct and run typed
code values. Besides being compatible with the current version of
OCaml, BER N101 has a number of improvements and significant changes
compared to BER N100. The new API for running code will hopefully
encourage the development of new ways to execute code values.

The new BER N101 is not only source-compatible with OCaml 4.01 -- it
is also binary compatible. Any 4.01-built OCaml library and plugin
(including findlib) can be used with BER N101 in their binary form as
they are.  The building of BER N101 no longer involves bootstrapping
and is hence much faster.


The staging annotations are: 
bracket: . e .  to delay computation (to the future stage)
escape:  .~ e to perform a computation e and splice-in the result
run: !. e to run a future-stage computation, or code, now

A special type constructor, called 'code' builds the type of
future-stage computations, or code expressions:
# . 2 + 4 .;;
- : int code = .2 + 4. 
The type constructor 'code' takes as its argument the type of the
future-stage expression. Future-stage expressions are executed later,
but are type-checked now. Therefore, the generated code is assuredly
well-typed. Code fragments can be spliced into larger code contexts by 
using the escape construct: 
# let x = . 2 + 4 . in . .~ x + .~ x . ;;
- : int code = .(2 + 4) + (2 + 4). 
The run construct takes a code value, executes it and returns its result. 
It is actually an ordinary function Runcode.run, which is also bound 
to the prefix operation (!.). These operations are in the module
Runcode (which is not opened by default). For example: 
# Runcode.run . 2 + 3 .;;
- : int = 5
# open Runcode;;
# !. .fun x y - x + y . 2 3;;
- : int = 5
The run construct only works on closed code values. Attempting to run
open code leads to an exception in the generator (which can be traced
as any other exception).


To the user, the two major differences of BER N101 from the previous
version are:

   -- the absence of environment classifiers (see below for more detail).

   -- The operation to run code is no longer a special form. It 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-11-26 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of November 19 to 26, 2013.

1) New OCaml.org design is now live!
2) extlib 1.6.0 released
3) Other Caml News


1) New OCaml.org design is now live!
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00162.html

** Amir Chaudhry announced:

As some of you may have noticed, the new OCaml.org site is now live!

The DNS may still be propagating so if http://ocaml.org hasn't updated for
you then try http://166.78.252.20. This post is in two parts: the first is
the announcement and the second is a call for content.


### New OCaml.org website design!

The new site represents a major milestone in the continuing growth of the
OCaml ecosystem. It's the culmination of a lot of volunteer work over the
last several months and I'd specifically like to thank Christophe, Ashish and
Philippe for their dedication (the commit logs speak volumes).

We began this journey just over 8 months ago with paper, pencils and a lot of
ideas. This led to a comprehensive set of wireframes and walk-throughs of the
site [1], which then developed into a collection of Photoshop mockups [2].
In turn, these formed the basis for the html templates and style sheets,
which we've adapted to fit our needs across the site.

Alongside the design process, we also considered the kind of structure and
workflow we aspired to, both as maintainers and contributors. This led us to
develop completely new tools for Markdown and templating in OCaml [3, 4, 5],
which are now available in OPAM for the benefit all. Working on all these
things in parallel definitely had it challenges (which I'll write about
separately) but the result has been worth the effort.

The journey is ongoing and we still have many more improvements we hope to
make. The site you see today primarily improves upon the design, structure
and workflows but in time, we also intend to incorporate more information on
packages and documentation. With the new tooling, moving the website forward
will become much easier and I hope that more members of the community become
involved in the generation and curation of content. This brings me to the
second part of this post.


### Call for content

We have lots of great content on the website but there are parts that could
do with refreshing and gaps that could be filled. As a community driven
site, we need ongoing contributions to ensure that the site best reflects its
members.

For example, if you do commercial work on OCaml then maybe you'd like to add
yourself to the support page [6]? Perhaps there are tutorials you can help to
complete, like 99 problems [7]? If you're not sure where to begin, there are
already a number of content issues you could contribute to [8].

Although we've gone through a bug-hunt already, feedback on the site is still
very welcome. You can either create an issue on the tracker (preferred), or
email the infrastructure list.

It's fantastic how far we've come and I look forward to the next phase!

Best wishes,
Amir

[1] http://amirchaudhry.com/wireframe-demos-for-ocamlorg/
[2] https://github.com/ocaml/ocaml.org/wiki/Site-Redesign
[3] http://lists.ocaml.org/pipermail/infrastructure/2013-July/000211.html
[4] http://pw374.github.io/posts/2013-09-05-22-31-26-about-omd.html
[5] 
http://pw374.github.io/posts/2013-10-03-20-35-12-using-mpp-two-different-ways.html
[6] http://ocaml.org/community/support.html
[7] http://ocaml.org/learn/tutorials/99problems.html
[8] https://github.com/ocaml/ocaml.org/issues?labels=content
  

2) extlib 1.6.0 released
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00172.html

** ygrek announced:

New release of extlib is out, featuring new functions, bugfixes and
new ocamlfind package extlib_min without potentially conflicting modules 
(notably
UChar UTF8 conflict with Camomile).

Get it as usual at http://code.google.com/p/ocaml-extlib or with `opam 
install extlib`.
Release notes for extlib-1.6.0 :
* Fix OCaml 4 Hashtbl compatibility
* Install additionally `extlib_min` with reduced set of modules (to mitigate 
linking conflicts)
* Build with debugging information by default
* Fix signature for `ExtList.iteri` and `OptParse.OptParser.error`
* Speed up `String.nsplit`
* New functions:
 * `String.find_from` (by Alexander Markov)
 * `IO.output_strings` (by Mehdi Dogguy)
 * `IO.read_float32` and `IO.write_float32` (by Philippe Strauss)
 * `IO.scanf` (by Warren Harris)
 * `UTF8.substring` (by Berke Durak)
 * `Enum.next`
  
** ygrek later added:

 * Install additionally `extlib_min` with reduced set of modules (to
   mitigate linking conflicts)

After some more thought I don't really like this approach. See the
reasoning in

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-11-19 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of November 12 to 19, 2013.

1) Software engineer position available at Cryptosense
2) Engineer and funded PhD position available, formal methods applied to 
filesystems
3) open-source software at OCamlPro and TypeRex-Pro
4) Other Caml News


1) Software engineer position available at Cryptosense
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00097.html

** Romain Bardou announced:

Cryptosense is a start-up company which develops formal tools for
finding and fixing security flaws in cryptographic systems. We use
model-checking and symbolic machine learning techniques, amongst other
technologies. Our tools are developed in OCaml.

Cryptosense is recruiting a junior and a senior software engineer.

Profile
===

You are an experienced programmer or recently qualified PhD. You
are proficient in at least one functional language. You want to
be part of a team of developers who follow agile programming
principles, and exchange and review each other's code. You like
to think outside the box to discover unexpected behavior that
might lead to security flaws. You are at ease holding technical
conversations in English.

Job description
===

You will be part of a small team during the exciting times of the
emergence of a new company.  Your work will have great impact on the
company's products, which are already being used to secure critical
infrastructure of organisations worldwide.

You will contribute to the design and code of robust software. Depending
on your skills and interests, you might work on one or several of the
following:
- automatic reverse engineering and learning of the behaviour of API
implementations;
- model-checking algorithms dedicated to finding cryptographic key
management vulnerabilities;
- domain-specific language to model cryptographic key management APIs,
similar to software verification;
- use of this DSL to model new APIs;
- robust monitoring and filtering tools;
- graphical user interfaces.

Expertise in system and server administration (Linux) is a plus. You
could be given responsibility for the stability of our server for our
clients.

Salary is negotiable and will depend on experience. Stock options are
a possibility. The positions will be available from December 2013.

Location


Our office is located in Paris, between Montparnasse and the Jardin du
Luxembourg.

Contact
===

Send your CV and cover letter to j...@cryptosense.com. Informal
enquiries are also welcome.

http://cryptosense.com/
  

2) Engineer and funded PhD position available, formal methods applied to 
filesystems
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00098.html

** Tom Ridge announced:

Project
===

The goal of the EPSRC-funded Future filesystems project is to apply
formal methods to the specification, validation, implementation and
verification of filesystems. The PI is Tom Ridge
(Leicester).

We have 2 positions available.

Position: engineer (6 months)
=

We seek a skilled programmer/developer/engineer to help with
validation of a specification of POSIX-like filesystems. The
specification is written in a pure subset of OCaml, and much of the
supporting infrastructure is also written in OCaml. Further details
are here:

http://www.jobs.ac.uk/job/AHM580/computer-science-engineer/

The closing date for applications is ***Wednesday, November 20th***
(i.e. very soon).


Position: PhD student
=

We may also have funds to support a PhD student. The student may work
on the project described above, or may choose to work on another topic
broadly in the area of formal methods and theorem proving. Please
contact Tom Ridge (tr61 at le.ac.uk) if you are interested (include a
CV and a statement describing your proposed research topic). A formal
advert may appear in the future, depending on availability of funds.
  

3) open-source software at OCamlPro and TypeRex-Pro
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-11/msg00131.html

** OCamlPro announced:

We have been contributing to the OCaml ecosystem for more than two
years now, with open-source tools (opam, ocp-indent, ocp-build, etc.),
open-source libraries (ocplib-endian, ocplib-wxOCaml), websites
(try.ocamlpro.com) and documentation (Cheat Sheets), all gathered
under the code name TypeRex (http://www.typerex.org/), and thanks to
our long term and close partnership with Jane Street who has helped
fund a large part of these projects.

Some of these projects, 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-11-06 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 22 to November 05, 
2013.

Sorry for the silence last week, I was on an island with tethering-only 
internet access.

1) Robust left to right flow for record disambiguation
2) random-generator 0.1
3) A useful Makefile collection for OCaml projects
4) ODT 3.0 released
5) LLVM OCaml bindings
6) Other Caml News


1) Robust left to right flow for record disambiguation
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00172.html

** Bob Zhang asked:

Record disambiguation is a practical feature, it helps a lot in
writing open-free code.
In practice, I found it is a bit limited, below is two scenarios
that the compiler can not infer in a correct way, will this be
improved in the future by any chance?
 From the user's point of view, annotating the toplevel is quite
acceptable, maybe the typechecker could take the type-annotation as a
higher priority.
---
   1.
let f (ls:t) =
   ls | List.map (fun x - x.loc) (* cannot inferred x.loc*)
   2.
type t = {loc:string}
type v = {loc:string; x:int}
type u = [`Key of t]
let f (u:t) =
  match u with
  | `Key {loc} - loc (* does not compile *)
  
** Jacques Garrigue replied:

Case 1 would require a new specification of how type propagation works.
In particular, propagating from an argument to another argument.
For this reason, the probability that it gets done is low.
(I know that F# handles this case in a special way, but do we want to introduce
a special case just for | ?)

Case 2 seems more reasonable (after replacing (u:t) by (u:u)).
In particular,
   let f (u:u) =
match u with `Key loc - loc.loc
already works, so it seems strange that the pattern-matching version doesn't.
  
** Alain Frisch then added:

 Case 1 would require a new specification of how type propagation works.
 In particular, propagating from an argument to another argument.
 For this reason, the probability that it gets done is low.
 (I know that F# handles this case in a special way, but do we want to 
 introduce
 a special case just for | ?)

The situation with List.map (or similar iterators) is quite common, and 
remains one of the only cases where local annotations are often required.

There is already a left-to-right propagation between arguments:

  type t = {a: int};;
  type s = {a: string};;
  List.map (fun ({a} : t) - a + 1) [{a=2}];;   (* accepted *)
  List.map (fun {a} - a + 1) [({a=2} : t)];;   (* rejected *)


With -principal, the first case is reported as non principal (warning 18).

Is there any practical or theoretical problem with specifying the 
information flow in order to make it principal?



For List.map and similar cases, one often prefers the type information 
to flow from the data stucture to the local abstraction.  One can define:

  let map l f = List.map f l

so that:

  map [{a=2}] (fun ({a} : t) - a + 1);;   (* rejected *)
  map [({a=2} : t)] (fun {a} - a + 1);;   (* accepted *)


One could imagine heuristics (based either on the function type, or on 
the argument shape) to pick a different ordering, but it seems much 
better to have a simple and predictable flow, and the left-to-right 
seems the most natural one between function arguments.  If we specify 
such information flow, it is then the responsibility of the library 
author to choose a good ordering.  I hoped that labeled arguments 
could let the client code choose a different one, but this doesn't work:

  let map ~f l = List.map f l

  map [{a=2}] ~f:(fun ({a} : t) - a + 1);;   (* accepted *)
  map ~f:(fun ({a} : t) - a + 1) [{a=2}];;   (* accepted *)

  map [({a=2} : t)] ~f:(fun {a} - a + 1);;   (* rejected *)
  map ~f:(fun {a} - a + 1) [({a=2} : t)];;   (* rejected *)


Does it seem reasonable to use the actual ordering between arguments on 
the call site rather than the one defined by the function type?
  
** Didier Remy then said and Alain Frisch replied:

 I don't think specifying the information flow between left and right
 (always-left-to-right, always-right-to-left, or depending-on-examples) is a
 good design. This leads to non predictable type inference and less robust
 programs  : refactoring a function by just changing the order of parameters
 (and consistently changing the order of arguments in all uses of the
 function) may break existing programs and also require new annotations.

This is already the case, except for people using -principal.  I know it 
is recommended to use this option (at least once in a while), but I 
doubt many users actually do it.  (And FWIW, -principal is so slow on 
our code base that we cannot actually use it in practice -- this is 
probably related to the way we use object types.)

As a user, I think I'm willing to pay the price of risking having to add 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-10-22 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 15 to 22, 2013.

1) phphard
2) IPv6 packet parsing
3) Marshalling: automatic discard of unmashalable data via ephemerons
4) Other Caml News


1) phphard
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00136.html

** Stanis?aw Findeisen announced:

I would like to draw your attention to phphard project, which is a PHP
source code static analyzer. Its aim is to strong type PHP programs and
detect as many bugs at compile time as possible.

The project is in its very early stage: most of PHP parsing is done
(using ocamllex + ocamlyacc), some pretty printing is done, no real
source code analysis is done. It is now hosted here:

https://forge.ocamlcore.org/projects/phphard/
https://github.com/sfindeisen/phphard (source code)

I will welcome your ideas, feedback and contributions to the project.
This is something I had been working on for some time, but have no
resources (time+money) to finish this alone.

I thinks it still makes sense to use PHP for web development as LAMP
stack is quite efficient compared to some other stacks like Java. :)
Plus there is lots of existing PHP code.

I must confess that I have only superficially scanned through existing
solutions to this static analysis problem. Some of the existing software
(like HipHop VM from Facebook) seems quite complex, however I couldn't
find anything that would be:

* exactly scoped on PHP + static analysis
* written in a functional language.

Therefore I think this project has a potential and working on it can
bring you glory. :)

I believe purely functional style (non-modifiable data structures!) will
be beneficial in this application.

If you want to contribute please join the project on OCaml Forge. The
source code is now on GitHub and it seems cool to me (but we can discuss
that if you have arguments).
  
** Stéphane Legrand then suggested and David MENTRE added:

 Did you take a look at Pfff? : https://github.com/facebook/pfff

And more exactly Scheck: https://github.com/facebook/pfff/wiki/Scheck
  

2) IPv6 packet parsing
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00144.html

** Johan Mazel asked and Stéphane Glondu replied:

 I am aware of several implementation for IPv4 packet parsing
 (ocaml-packet, melange, promiwag and maybe others that I missed).
 However, up to my knowledge, none of these implementations offer IPv6
 parsing functionnalities.
 I would like to know if there is anything available ?

Using bitstring makes parsing binary structures such as IPv6 (and IPv4)
packets easy:

  https://github.com/glondu/netacct-crans/blob/master/netacct-crans.ml
  
** rixed also replied:

IPv6 is on the TODO list for robinet[1], a small lib that parse
network traffic (with the help of bitstring which was already
suggested). It's hard to tell if this small library fits your use
case but if it does I'd gladly add support for IPv6.

[1]: https://github.com/rixed/RobiNet
  
** The following exchange occurred between Anil Madhavapeddy, rixed, and Gerd 
Stolpmann:

Anil Madhavapeddy:
 rixed:
  Anil Madhavapeddy:
   One feature I'd really like to see in Bitstring is support for Bigarray,
   since that avoids a copy into the OCaml heap and lets us do quite high
   performance parsing.  If I remember right, there was a patch on the
   Bitstring issue tracker, but it wasn't parameterised (so it's either
   Bistring+string or Bitstring+bigarray, which isn't ideal).
  
  Pardon my lack of familiarity with bigarrays, but I can't see what's the
  difference between copying packets from pcap ring buffer into a bigarray
  or into a string. Or do you mean using Bigarray.map_file on the whole
  raw ring buffer and handle it without pcap help?

Without knowing details: maybe no copy is required at all? The pcap ring
buffer could be directly wrapped as Bigarray.

 We have a number of use-cases that run OCaml in kernel mode, directly
 operating on packets read from a network driver that's also written in
 OCaml.  Bigarrays are used as the mechanism for passing around externally
 allocated memory (i.e. network card buffers) directly, whereas inspecting
 them with a string-based Bigarray requires an expensive data copy.
 
 See: http://anil.recoil.org/papers/2013-asplos-mirage.pdf
 or http://www.openmirage.org

For similar reasons, I also added some Bigarray functions to Ocamlnet:

http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/doc/html-main/Netsys_mem.html

If you look at the stub behind e.g. Unix.read, you'll see that the data
is first read into an internal unaligned buffer, and then copied to the
string buffer. This means usually two copies of the data: one from 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-10-15 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 08 to 15, 2013.

1) equivalent checking of ocaml program?
2) Procord 0.1.0: Delegate tasks to other processes
3) OCaml 2013: papers and slides are available
4) OPAM 1.1.0 Release Candidate
5) Marshalling: automatic discard of unmashalable data via ephemerons
6) Developper position: designing a C front-end in OCaml
7) Other Caml News


1) equivalent checking of ocaml program?
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00073.html

** Continuing the thread from last week, Gabriel Scherer said:

Shortly after writing my email, I found out that Ong had co-written a
recent article (CAV'12) on using those techniques precisely for
equivalence checking:

  Hector: An Equivalence Checker for a Higher-Order Fragment of ML
  David Hopkins' Andrzej S. Murawski and C.-H Luke Ong
  2012
  http://www.cs.ox.ac.uk/files/4786/cav12.pdf

They restrict themselves to a order-bounded fragment of higher-order
function types (and only allow ground reference types) suggested by
game-semantics considerations, on which equivalence checking is
decidable, and leave extensions to more complex settings where
equivalence becomes indecidable to future work.
You probably know more about this than I do (this is not my field at
all), but my understanding is that whether the problems are decidable
or not is not an actual concern with model checking, as even in
decidable cases the tools most often run out of time; actual
feasability on concrete examples seems the most useful way to evaluate
those, so I don't think going to undecidable fragments would be a
problem in principle. Of course, the more complex the fragment, the
more expansive the computations.
  

2) Procord 0.1.0: Delegate tasks to other processes
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00078.html

** Romain Bardou announced:

I am happy to announce the first release of Procord, a portable library
to delegate tasks to other processes.

Obtain it with opam:

  opam install procord

Or, download the tarball:

  https://github.com/cryptosense/procord/archive/v0.1.0.tar.gz

View a minimal, commented example:

  https://github.com/cryptosense/procord/blob/master/examples/minimal.ml

You can browse the API at:

  http://cryptosense.github.io/procord/api/index.html

Procord can spawn local worker processes or communicate using sockets to
a remote worker server. Workers will receive an input, execute a
function on this input, and send back the result. Meanwhile, the main
program can continue to run while waiting for the results.

Not relying on threads, Procord is robust - a segmentation fault in the
worker will not kill the main program. Not relying on fork, Procord is
portable - it has been tested on Linux and Windows.

Procord provides an easy way to have the same executable act as a worker
- local or remote - or as the main program. The actual behavior can be
specified on the command-line. The default is to run as the main
program, which delegates tasks by running itself.

I will present Procord at the OUPS meeting of this evening.
  
** Arnaud Spiwack asked and Romain Bardou replied:

 I see you are using Unix.kill to kill processes. But I was under the
 impression that it didn't work properly on Windows. Am I mistaken?

Indeed. In fact I made a feature request about this:

http://caml.inria.fr/mantis/view.php?id=6146

So, just waiting for OCaml 4.02 will solve the issue.

If waiting is not an option I can of course add this in Procord. I
should at least provide a way to get the PID / Process Handle so that
one can call TerminateProcess using his own binding.

While we are discussing the differences between Windows and Linux, there
is actually another one: the Windows server does not fork and, thus,
only accepts one task at a time. This could be solved by having the
server execute himself to run the tasks. But before actually
implementing this I prefer to wait and see whether there is a real need
(Windows servers are less common).
  
** Louis Gesbert then suggested and Jacques Garrigue added:

 You may find the bindings for Terminate_process in ocaml-top useful [1].
 
 I also had to handle sending a SIGINT to the ocaml toplevel, which wasn't 
 very fun,
 
 
 [1] https://github.com/OCamlPro/ocaml-top/blob/master/src/sigint_win.c

If you're just trying to kill an ocaml toplevel that you have spawned yourself,
you can have a look at labltk/browser/shell.ml.
By setting the environment variable OCAMLSIGPIPE and sending T or C to
this pipe you can kill or interrupt the ocaml toplevel asynchronously.
(At the time I implemented that, there was basically no other way to do that
in windows 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-10-08 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 01 to 08, 2013.

1) OASIS help - libraries with mixed C/C++ part
2) Feedback on the ocaml.org redesign and logo
3) QCheck 0.1
4) Other Caml News


1) OASIS help - libraries with mixed C/C++ part
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00052.html

** Micha? Kurcewicz asked and Philippe Veber replied:

 I am migrating some old code from OCamlMakefile to a oasis/ocamlbuild
 based build process. While the migration is generally straightforward, I
 have encountered some problems with a library where the C part includes
 mixed C/C++ code. Putting the C++ files into CSources: in _oasis does not
 seem to work, the files are not even copied over to the _build directory,
 changing the file extensions and adding some options (-x c++) also does not
 solve the problem. What is recommended way to build libraries that include
 a mixed C/C++ part using OASIS/ocamlbuild?

for an example you can have a look at a binding [1] of the Irrlicht 3d
engine (for the record my fork [2] currently has a small addition) or a
binding [3] I started (but never got very far) of the Ogre3D library. The
latter shows how to put the C++ files in a subdirectory, which was not that
easy to obtain.

HTH,
  Philippe.

[1] https://github.com/antegallya/OCaml-Irrlicht
[2] https://github.com/pveber/OCaml-Irrlicht
[3] https://github.com/pveber/ogrillon
  
** ygrek also replied:

One also needs to link with stdc++
The following should work

  CCopt: -g -x c++ -O2 -Wextra -Wstrict-overflow=5 -fno-strict-aliasing 
-Wfatal-errors
  CClib: -lstdc++
  

2) Feedback on the ocaml.org redesign and logo
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00057.html

** Amir Chaudhry said:

Just a brief reminder that I'd still like feedback on the OCaml logo and
ocaml.org redesign work (see previous message below).

I'm continuing the discussion on the infrastructure list [1] about the
redesign and how we migrate the current site to the new design. If anyone
would like to join in please do so over there.

[1] http://lists.ocaml.org/pipermail/infrastructure/2013-October/000304.html
  

3) QCheck 0.1
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-10/msg00058.html

** Simon Cruanes announced:

I'm happy to announce the first release of a small QuickCheck
implementation for OCaml, named `QCheck`. It consists in writing
invariants as function t - bool for some type t, and then checking that
the invariant holds on randomly generated instances of t.

QCheck is designed so that writing tests is as easy as possible[1],
especially for Arbitrary instances (the part where you generate random
values of a type) where it provides many combinators.

The library requires OCaml = 4.00.1, and is available under the BSD
license on opam via:

$ opam install qcheck

You can find documentation at:
http://cedeela.fr/~simon/software/qcheck/QCheck.html
source code at:
https://github.com/c-cube/qcheck
and some explanations here:
http://cedeela.fr/quickcheck-for-ocaml.html
  

4) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocaml.org/.

FPDays 2013 Real World OCaml tutorial in Cambridge:
  http://anil.recoil.org/2013/10/08/fpdays-real-world-ocaml.html

Announcing CCSS 1.4:
  http://nleyten.com/post/2013/10/07/Announcing-CCSS-1.4

Hugo-a-go-go:
  http://scattered-thoughts.net/blog/2013/10/06/hugo-a-go-go/

Using Travis for secure deployments with SSH:
  http://anil.recoil.org/2013/10/06/travis-secure-ssh-integration.html

SSL up again, special thanks to Gabriel Kerneis:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=887

Uucd 1.0.0 and Uunf 0.9.2:
  http://erratique.ch/software
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .


[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-10-01 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of September 24 to October 
01, 2013.

1) Feedback on the ocaml.org redesign and logo
2) Enhanced OCaml Documentation 4.01
3) Gg 0.8.0 and Vg 0.8.0
4) otags reloaded 4.01.1 for OCaml 4.01
5) meetup OCaml-Pairs (OUPS), mercredi 9 octobre à l'IRILL
6) embedding js_of_ocaml output?
7) OUnit v2.0.0
8) Thread behaviour
9) Esterel Technologies is looking for an Ocaml SW developer in Toulouse (CDI)
10) equivalent checking of ocaml program?
11) LablGtk 2.18.0 and LablGL 1.05
12) Uucd 1.0.0  Uunf 0.9.2
13) Other Caml News


1) Feedback on the ocaml.org redesign and logo
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-09/msg00326.html

** Amir Chaudhry asked:

I've just put up a blog post asking for feedback on the ocaml.org redesign
[1]. I'm specifically interested in getting feedback on (1) the second
iteration of the OCaml Logo and (2) the new design for ocaml.org. See the
blog post for more information. We're tracking feedback via issues [2] and
there are some known issues already listed there.

[1] http://amirchaudhry.com/ocamlorg-request-for-feedback/
[2] https://github.com/ocamllabs/sandbox-ocaml.org/issues?state=open
  

2) Enhanced OCaml Documentation 4.01
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-09/msg00329.html

** Hendrik Tews announced:

I would like to announce

 The Enhanced OCaml Documentation 
  Version 4.01
   available via http://www.askra.de/software/ocaml-doc/4.01

This version of the OCaml manual enhances the original html
version in the following way:

- Changes (wrt version 4.00) are tagged with icons and color 
- an additional appendix contains all grammar rules


As always, the enhanced documentation reveals some points that
have not been mentioned in the official 4.01 announcement from
Damien Doligez. This time, the most important such point is that
the documentation approves what long-term OCaml hackers have been
using for years to improve their code. You can use an infix
symbol as for-loop-variable:

   for (+) = ... to ... do ... done

will (mostly) word as (un)expected!
;-)
  

3) Gg 0.8.0 and Vg 0.8.0
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-09/msg00330.html

** Daniel Bünzli announced:

It's my pleasure to announce the first releases of:

* Gg, a module providing basic types for computer graphics
* Vg, a declarative 2D vector graphics library.

More on these and their aim at the end of the message.  

My thanks to Edwin Török who contributed the color conversion functions
in Gg and helped with color science questions.

Besides, while I can trace my work on Vg to at least 2008 it would
still remain unreleased without the sponsorship of both Citrix Systems RD
and OCaml Labs. Many thanks to them and to the inspiring OCaml
Cambridgian atmosphere.

Comments are welcome,

Daniel


# Note on installing

Once opam 1.1 is released, the packages will be in opam's repository  
and can be installed with:

  opam install gg vg# (SVG renderer only)
  opam install gg uutf otfm js_of_ocaml vg# (all renderers).  

If you are eager to use the software and have the opam 1.1 beta installed  
you can get them through my unreleased software repo:

  opam repo add erratique-u http://erratique.ch/software/opam/unreleased
  opam upgrade
  opam install gg uutf otfm js_of_ocaml vg

these packages will be removed from erratique-u once they are in the  
opam repository.


# Gg

Gg is an OCaml module providing basic types for computer graphics. It
defines types and functions for floats, vectors, points, sizes,
matrices, quaternions, axis-aligned boxes, colors, color spaces, and
raster data.

Gg is made of a single, independent, module and distributed under the
BSD3 license.  

The aim of Gg is to provide an efficient, immutable, C friendly, type
infrastructure for computer graphics programming. It's neither a
general purpose linear algebra package nor a computational geometry
library. I hope it can serve as a minimal common ground for other
graphics libraries to exchange data without having to depend on each
other.

From an API point of view the library is considered mostly
complete. The only thing that could still change significantly is the
support for representing raster data (Gg.raster), in any case,
consult the documentation which clarifies what may still change.

Home page: http://erratique.ch/software/gg  
Documentation: http://erratique.ch/software/gg/doc/Gg
github: https://github.com/dbuenzli/gg


# Vg

Vg is an OCaml module 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-09-24 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of September 17 to 24, 2013.

1) OCaml on Android
2) OCaml release 4.01.0
3) OCaml vs Ada and/or GUI options
4) Beta release of OPAM 1.1.0
5) Ocaml on an embedded arm system (no linux)
6) Call for Talks - Open World Forum / OSDC
7) SIunits 0.1
8) ocaml interface to berkeley db?
9) Other Caml News


1) OCaml on Android
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-09/msg00257.html

** Jon Harrop asked and Anil Madhavapeddy replied:

 What is the status of OCaml on Android? Have any Android apps been written
 in OCaml?

There's a GitHub OPAM repository here:
https://github.com/vouillon/opam-android-repository

and I've just ordered myself my first Android device, as Mirage has just been
ported over to it a few days ago in UNIX mode:
https://lists.cam.ac.uk/pipermail/cl-mirage/2013-September/msg00062.html

I haven't tried it myself yet, but intend to once my physical device shows
up. Googling reveals a few applications built using it already, but I have
no idea how substantial they are.
  
** Thomas Sibut-Pinote also replied:

I'm not sure if this anwers your question, but someone wrote an Ocaml
toplevel for Android:
http://vernoux.fr/2011/11/11/ocaml-toplevel-for-android/
https://play.google.com/store/apps/details?id=fr.vernoux.ocaml
  
** Kristopher Micinski  said and Ivan Gotovchits suggested:

 The basic problem with running OCaml on Android is that pretty much
 everything (minus a few system services / daemons, for example) runs
 inside a Dalvik VM.  Everything that is a real app thus uses the
 facilities of the SDK to interact with the underlying
 system.  (Various services such as internet can be opened via a raw
 socket, and are protected via lower level system modifications.)

And what about OCaml-Java [1]. Will it be possible to use it with
dalvik?

[1] http://ocamljava.x9c.fr/preview/
  
** Kristopher Micinski then said and Xavier Clerc added:

 With a little bit of hacking it'd probably work, but I'm not sure of the
 status of ocaml-java and haven't looked into the implementation details.
 Since ocaml-java outputs class files (afaik) you'd have to sort of hack the
 android build pipeline yourself, but that wouldn't be the hard part: all
 the tools are there. The harder part is that the Android SDK is very Java
 oriented, and it just feels awkward as hell to use in OCaml even if you
 were to write a thin wrapper around the SDK.

In theory, you are right that it wouldn't be hard.
In practice, the problem is that OCaml-Java emits classes
for Java 1.7 while (to the best of my knowledge) Android
only accepts Java 1.6 classes. As far as I know, there is no
other pending problem.

From this point, the question would be: is it better to wait
for Android to update to Java 1.7 (or even 1.8...), or to
modify OCaml-Java? Honestly, I would need quite a bit
of encouragement to modify OCaml-Java in this direction...

Regarding interaction with the classes of the Android SDK,
one may be interested in the typer extension allowing to
manipulate Java instances from pure OCaml code:
http://ocamljava.x9c.fr/preview/javaext.html
The main potential problem with this approach is that the
extension currently allows only to implement interfaces, but
not to extend classes. It may be a problem if for example the
event system of Android is based on abstract classes.
Another problem may be the linking, i. e. the way Android
expects to execute an application: is it a bare main method,
or is there a need to implement/extend a given interface/class?
  
** Kristopher Micinski said and Xavier Clerc replied:

 Yes, it does rely on extending an abstract class. This does, in fact,
 permeate the framework.

This problem is indeed to be fixed in a future version of OCaml-Java.
Currently, you can extend an abstract class only in well delimited
circumstances, for example to build an applet.
  
** Alexandre Pilkiewicz said:

http://gallium.inria.fr/blog/ocaml-on-a-nexus-7/
  
** Richard Mortier suggested and Xavier Clerc replied:

 a colleague here ported cadmium to android a while back. don't know
 how relevant/working it still is though.

 https://github.com/dominicjprice/joecaml

Beware, Cadmium is only providing an OCaml bytecode interpreter
written in Java. You hence only get a Java equivalent of the ocamlrun
program.
  

2) OCaml release 4.01.0
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-09/msg00264.html

** Continuing the thread on this release, Nicolas Braud-Santoni announced:

Exherbo [1] since tonight [2].

[1] http://exherbo.org/
[2] 
https://github.com/nbraud/nicoo_exherbo/commit/24037f640154b8352a5dac7359d7b94dd3451f64
  

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-09-03 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of August 27 to September 03, 
2013.

1) Ocamlnet-3.7.3
2) OCaml 4.01.0 RC1
3) Literate (sort-of) programming in OCaml
4) Pippo: a pretty interesting pre-processor that uses OCaml
5) Other Caml News


1) Ocamlnet-3.7.3
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-08/msg00171.html

** Gerd Stolpmann announced:

Ocamlnet-3.7.3 is now available for download. Changes in this release:

 - Support for ocaml-4.01
 - New directives for ocamlrpcgen to control the language mapping better
 - Bug fixes here and there

Details about this release can be found on the project page:

http://projects.camlcity.org/projects/ocamlnet.html

See ChageLog for a detailed list of changes:

http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/ChangeLog

Gerd


PS. The versions 3.7.0 to 3.7.2 were release attempts but turned out as
buggy. Don't use them if you fetched one (they were visible for a short
period).
  

2) OCaml 4.01.0 RC1
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-09/msg1.html

** Damien Doligez announced:

The release of OCaml version 4.01.0 is imminent.  We have
created a release candidate for your testing pleasure.  Please
download the sources, compile, install, and test your favourite
software with it (or try it with OPAM).  Then let me know
whether it works for you.

We want to know about any show-stopping bugs, especially in the
compilation and installation phases.

This release candidate is available as source code at this
address: http://caml.inria.fr/pub/distrib/ocaml-4.01/

It will become the official release in one week unless a
show-stopping bug is discovered in the meantime.

Happy hacking,

-- Damien Doligez for the OCaml team.


OCaml 4.01.0:
-

(Changes that can break existing programs are marked with a *)

Other libraries:
- Labltk: updated to Tcl/Tk 8.6.

Type system:
* Propagate type information towards pattern-matching, even in the presence of
  polymorphic variants (discarding only information about possibly-present
  constructors). As a result, matching against absent constructors is no longer
  allowed for exact and fixed polymorphic variant types.
* PR#6035: Reject multiple declarations of the same method or instance variable
  in an object

Compilers:
- PR#5861: raise an error when multiple private keywords are used in type
  declarations
- PR#5634: parsetree rewriter (-ppx flag)
- ocamldep now supports -absname
- PR#5768: On unbound identifier errors, use spell-checking to suggest names
  present in the environment
- ocamlc has a new option -dsource to visualize the parsetree
- tools/eqparsetree compares two parsetree ignoring location
- ocamlopt now uses clang as assembler on OS X if available, which enables
  CFI support for OS X.
- Added a new -short-paths option, which attempts to use the shortest
  representation for type constructors inside types, taking open modules
  into account. This can make types much more readable if your code
  uses lots of functors.
- PR#5986: added flag -compat-32 to ocamlc, ensuring that the generated
  bytecode executable can be loaded on 32-bit hosts.
- PR#5980: warning on open statements which shadow an existing identifier
  (if it is actually used in the scope of the open)
* warning 3 is extended to warn about other deprecated features:
  - ISO-latin1 characters in identifiers
  - uses of the () and (or) operators instead of () and (||)
- Experimental OCAMLPARAM for ocamlc and ocamlopt
- PR#5571: incorrect ordinal number in error message
- PR#6073: add signature to Tstr_include

Standard library:
- PR#5899: expose a way to inspect the current call stack
  (Printexc.get_callstack)
- PR#5986: new flag Marshal.Compat_32 for the serialization functions
  (Marshal.to_*), forcing the output to be readable on 32-bit hosts.
- Add optimized composition operators | and @@ in Pervasives

Other libraries:
- PR#5568: add O_CLOEXEC flag to Unix.openfile, so that the returned
  file descriptor is created in close-on-exec mode

Runtime system:
* PR#6019: more efficient implementation of caml_modify() and caml_initialize().
  The new implementations are less lenient than the old ones: now,
  the destination pointer of caml_modify() must point within the minor or
  major heaps, and the destination pointer of caml_initialize() must
  point within the major heap.

Internals:
- Moved debugger/envaux.ml to typing/envaux.ml to publish env_of_only_summary
  as part of compilerlibs, to be used on bin-annot files.
- The test suite can now be run without installing OCaml first.

Bug fixes:
- PR#3236: Document the fact that queues are not thread-safe
- PR#3468: (part 1) Sys_error documentation
- 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-08-27 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 30 to August 27, 2013.

Sorry for the hiatus, I was away for three weeks with tethering-only internet 
access.

1) OCaml-Java: blending OCaml  Java
2) Book announcement: Parallel and Concurrent Programming in Haskell
3) New iteration of the Windows installer
4) WODI (beta4) (Windows port of GODI)
5) Call for Participation: CUFP 2013
6) Real World OCaml beta2 now available (final beta)
7) ocaml+opam in Cloud9 IDE
8) OCaml-RDF 0.6.0
9) Turning floating point errors into exceptions
10) CamlPDF 1.7
11) OCaml 4.01.0+beta1
12) Merlin 1.3 -- advanced Vim and Emacs editor modes
13) Threads and transaction isolation in OCaml
14) should.ml, literate assertions for OCaml
15) Other Caml News


1) OCaml-Java: blending OCaml  Java
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-07/msg00353.html

** Xavier Clerc announced:

OCaml-Java is a project whose goal is to provide a compiler
targeting the JVM. The related objectives are to gain access
to a greater number of libraries, and to be able to take advantage
of multiple cores.

During the past few months, OCaml-Java has greatly evolved
and now contains the necessary mechanisms to easily blend
OCaml and Java in a single application, and to develop multicore
programs.

To access OCaml code from Java code, a tool (namely ocamlwrap)
allows to generate Java class definitions mapping OCaml types
and values to Java elements. An overview of the tool is available
at the following address:
http://ocamljava.x9c.fr/preview/ocamlwrap.html

To access Java code from OCaml code, an extension to the original
OCaml typer allows to create and manipulate Java instances from
purely OCaml code. The typer extension is presented at the
following address:
http://ocamljava.x9c.fr/preview/javaext.html

To take advantage of multiple cores, various abstractions are
provided by the newly-introduced Concurrent library. It features
low-level abstractions such as threads and locks, but also high-level
abstractions such as map/reduce computations and parallel
operations over arrays. An introduction to the library and its
ocamldoc-generated documentation can be reached at the following
addresses:
http://ocamljava.x9c.fr/preview/concurrency.html
http://ocamljava.x9c.fr/preview/concurrent/index.html

The project is available as a binary distribution, just needing an
installed Java 1.7 SDK to be used. The binary distribution can be
downloaded at:
http://ocamljava.x9c.fr/preview
while the bugtracker can be reached at:
http://bugs.x9c.fr/

To conclude, I would like to acknowledge the OCaml Labs for
welcoming me. A significant part of this work has actually been
performed while visiting the OCaml Labs.
  

2) Book announcement: Parallel and Concurrent Programming in Haskell
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-08/msg0.html

** Francois Berenger announced:

The book is written by Simon Marlow
and published by O'Reilly.

OK it's for Haskell, but I'm sure
some people in here will be interested.

There is a free online reading link:
http://chimera.labs.oreilly.com/books/123000929/index.html
  

3) New iteration of the Windows installer
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-08/msg2.html

** Jonathan Protzenko announced:

Dear OCaml programmers using Windows,

I'm happy to announce a new iteration of the Windows installer that I'm 
currently maintaining. The installer installs /native/, 32-bit OCaml 
compilers, that produce /native/, 32-bit windows programs. The OCaml 
native compiler (ocamlopt) and tools (flexlink) requires a proper 
toolchain to be installed, namely the 32-bit one from the mingw64 
project. This toolchain is impeccably packaged in Cygwin, so the 
installer will advertise the use of cygwin as a development 
environment. Some other tools require the presence of Unix-like 
utilities; OCamlbuild, for instance, requires bash to be available. 
This is also achieved by using Cygwin as a development environment. The 
installer also installs findlib.

The installer does _not_ install any other OCaml library. This is the 
job of a package manager; unfortunately, there is still a long way to 
go on Windows. If I can tweak anything in the installer that would ease 
the life of a package manager, please let me know.

This release fixes several bugs that have been mentioned on this list.
- The Cygwin mirror is no longer hardcoded. The original idea was to 
save the user one more setup screen, where they have to choose which 
Cygwin 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-07-23 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 16 to 23, 2013.

1) Ubuntu PPAs for OCaml (4.00 and 4.01dev)
2) Batteries 2.1
3) Request for feedback: Procord, a library to delegate tasks to other processes
4) ocamlnet-3.6.6
5) GODI is shutting down
6) Other Caml News


1) Ubuntu PPAs for OCaml (4.00 and 4.01dev)
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-07/msg00121.html

** Anil Madhavapeddy announced:

I've put together two Ubuntu PPAs to make it more convenient to use modern
OCaml/OPAM versions on Ubuntu via binary packages.

OPAM stable:
https://launchpad.net/~avsm/+archive/ppa
This includes the latest stable OCaml (4.00.1) and OPAM (1.0.0).

OPAM unstable:
https://launchpad.net/~avsm/+archive/ppa-opam-unstable
This includes the latest snapshot of OCaml (4.01.0dev) and OPAM (1.0.1dev).
This should get you reasonably stable snapshot of both, and will include the
release candidates of OCaml when it's released.

For now, these are experimental PPAs as I muddle my way through learning how
Debian packaging works. Reports of breakage or success to me directly would
be appreciated. Most of this PPA was based on the excellent Debian package
sources, and thanks to Mehdid Dogguy in particular for the OPAM packaging.
  

2) Batteries 2.1
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-07/msg00128.html

** Edgar Friendly announced:

It's been a while since 2.0, and batteries has had a bunch of improvements that
should be shared with a wider audience.

More features, more bugfixes, more batteries.

Thanks to the *many* contributors in this release; batteries exists because of
you.

E.

Changelog:

Added: 
Array.{avg,favg,singleton}, 
Bigarray.of_enum, 
Hashtbl.{modify,modify_def,modify_opt,map_inplace,filter_inplace,filter_opt_inplace},
 
IMap.{modify,modify_def,modify_opt}, LazyList.lazy_fold_right, 
List.{singleton,unfold,min_max,modify,modify_dep,modify_opt, span, nsplit, 
group_consecutive}, 
Map.modify_opt (*3), 
MultiMap.modify_opt (*3), 
MultiPMap.modify_opt (*3), 
Option.{default_delayed , map_default_delayed}, 
Set.find, Set.Incubator.op_map, 
String.rev, 
Substring.{equal,contains,iteri,enum}
Fixed:
Compilation with Ocaml 4.01
Speedup in LazyList.append
More organized magic for fast list snoc
Speedup in String.{replace,nreplace}
Cleanup int32.[un]pack exceptions
Fix last bit access in BatBitSet
Float.round corner case on predecessor of 0.5 fixed
Fix Enum.concat's clone implementation
Fix List.n_cartesian_product to allow empty input
Fix BatText.rfind's index calculation
Improve Pervasives.undefined to be curry-able
Array.backwards doesn't clone array anymore
Remove useless allocation in Splay.cfind
More unit tests, benchmarks
  

3) Request for feedback: Procord, a library to delegate tasks to other processes
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-07/msg00135.html

** Romain Bardou asked:

I plan on writing yet another library to help with concurrency in OCaml.
The motivations for this library, and the interface I have in mind, are
available here:

http://romain.bardou.fr/procord/api/Procord.html

Before actually implementing the library, I would be very happy to
receive feedback. I am interested to know, among others:
- whether I miss important information which would make the very
existence of this library stupid (such as, it already exists);
- whether I forgot some important use case;
- whether the names I chose have better ubiquitous equivalents;
- whether you believe I should choose another interface entirely, for
instance, if you don't like functors.
  
** Török Edwin then said and Romain Bardou replied:

 Processing streams of data in parallel without having to read all the data
 in memory first.

Good point. I'm not sure how to deal with this and I actually think it
calls for a slightly different paradigm. Although maybe one could
eventually add send/receive functions to send/receive to/from an 'a
process, and the same for the worker. It would allow to transmit more
than one input and more than one output.

 You could sort of do this with your current interface but only on Unix
 (i.e. mkfifo and pass filename).
 Don't know what'd work on Windows, perhaps creating a (named) pipe, and
 sending the file descriptor to a newly spawned child?

I don't think there are named pipes on Windows but I may be wrong. Maybe
it can be emulated using files anyway. I don't think sending a file
descriptor is a good idea but sending a file name is of course possible.

 Also it'd be nice to have something similar to the 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-06-18 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of June 11 to 18, 2013.

1) pareto -- OCaml statistics library
2) Ocamlnet-3.6.5
3) Real World OCaml beta1 available
4) Other Caml News


1) pareto -- OCaml statistics library
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-06/msg00074.html

** Sergei Lebedev announced:

I'm working on a statistics library for OCaml, called 'pareto' [1]. My goal was
to cover all of the features available in Brian O'Sullivan's 'statistics' [2]
library, which seems to be pretty popular [3] in Haskell community. Here's a
list of what's currently implemented:

* Common statistical tests for significant differences between samples
(Student's t test, chi^2 test, Mann Whitney U-test, Wilcoxon signed-rank test,
binomial sign test).
* Uniform interface for common discrete and continuous probability
distributions.
* Sample statistics, quantile estimation, kernel density estimation.
* Resampling methods: jackknife, BCa bootstrap.

See 'examples/'[4]directory on GitHub for usage examples.

Any feedback is appreciated!

--Sergei

[1] https://github.com/superbobry/pareto
[2] https://github.com/bos/statistics
[3] http://packdeps.haskellers.com/reverse/statistics
[4] https://github.com/superbobry/pareto/tree/master/examples
  

2) Ocamlnet-3.6.5
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-06/msg00091.html

** Continuing this old thread, oliver announced:

the ocamlnet-package on AUR (Arch Linux) was orphaned.
I adopted it and updated to 3.6.5:

https://aur.archlinux.org/packages/ocamlnet/
  

3) Real World OCaml beta1 available
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-06/msg00101.html

** Anil Madhavapeddy announced:

Yaron Minsky, Jason Hickey and I are pleased to announce the beta release of
our forthcoming O'Reilly book, called Real World OCaml, available online at
http://realworldocaml.org

The book is split into three parts: language concepts, tools and techniques,
and understanding the runtime. As promised last year, we are making a public
beta available for community review and to help us hunt down inaccuracies and
find areas that need more clarification.

We've had the book in closed alpha for six months or so and have developed a
feedback system that uses Github to record your comments. This lets us follow
up to each review with clarifications and keep track of our progress in fixing
issues. During alpha, we've received over 1400 comments in this fashion (and
addressed the vast majority of them!). However, since we anticipate more
comments coming in from a public beta, we would request that you read the FAQ
to avoid drowning us in repeat comments: http://www.realworldocaml.org/#faq

(TL;DR followup another comment on Github directly if you can instead of
creating a new issue via the web interface)

This release is available in HTML format online at:
http://www.realworldocaml.org

O'Reilly is currently preparing a Rough Cuts release that will make the beta
available as PDF and in popular eBook formats. We anticipate that this will
be available later this week, and I'll send a followup when that happens.

Finally, we would especially like to thank our alpha reviewers. Their feedback
(https://github.com/ocamllabs/rwo-comments/issues) has been invaluable
to the beta release. The book also includes substantial contributions to
individual chapters from Jeremy Yallop (FFI), Stephen Weeks (GC) and Leo White
(objects).

If you have any comments that you'd like to send directly by e-mail, please
contact us at
rwo-authors AT recoil.org.

Release notes for beta1:

* The first-class modules chapter is incomplete, pending some portability
  improvements to the ocaml-plugins Core library.
* The binary serialization chapter is also incomplete, but has just enough
  to teach you about the Async RPC library.
* The installation chapter will be revised in anticipation of the OCaml 4.1
  release, and is currently quite source-based.
* The packaging and build systems chapter hasn't been started yet. We're
  still deciding whether or not to make this an online pointer rather than
  a print chapter, since it's likely to change quite fast.
* We are preparing exercises per chapter that are not included in this
  particular beta release, but will be available online as soon as possible.
* The code examples will all be clonable as a separate repository in beta2.
  

4) Other Caml News


[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-06-11 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of June 04 to 11, 2013.

1) Ocamlnet-3.6.5
2) post-doc position at MSR-Inria
3) ocaml-ctypes, a library for calling C functions directly from OCaml
4) Core Suite 109.27.00 + core_kernel
5) OCaml on zLinux
6) Use-site variance in OCaml
7) New Book: OCaml from the Very Beginning
8) Deadline extension: OCaml 2013, new deadline on June 18 (anywhere on earth)
9) Findlib-1.4
10) Other Caml News


1) Ocamlnet-3.6.5
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-06/msg00043.html

** Amending the announcement from last week, Gerd Stolpmann said:

Well, things go wrong...

There was a build problem in 3.6.4 so that netstring-pcre did not work
properly. This is fixed in the new versiopn 3.6.5 I just released.

Gerd

 Hi,

 I've just released Ocamlnet-3.6.4. This is a maintenance release
 including:

 - New configure options for PCRE (-enable-full-pcre, -enable-pcre).
 There is also documentation about the PCRE issue in Regexp.html
 (remember that PCRE is no longer the default regexp engine).
 - More documentation for Netmulticore: Netmcore_basics
 - New Netplex module for mailboxes: Netplex_mbox.
 - netcgi2-apache builds against apache-2.4

 plus various smaller fixes and additions.

 For a full description, see the ChangeLog.

 Get Ocamlnet, read the manual etc. from
 http://projects.camlcity.org/projects/ocamlnet.html
  

2) post-doc position at MSR-Inria
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-06/msg00042.html

** Damien Doligez announced:

Research team: Tools for Proofs, MSR-INRIA Joint Centre
===

The Microsoft Research-INRIA Joint Centre is offering a 2-year
position for a post-doctoral researcher to contribute to the ADN4SE
project aiming at extending the proof development environment for TLA+
developed in the Tools for Proofs project
(http://msr-inria.com/projects/tools-for-proofs) and applying it for
the verification of key components of a real-time operating system.


Research Context


TLA+ is a language for specifying and reasoning about systems,
including concurrent and distributed systems. It is based on
first-order logic, set theory, temporal logic, and a module system.
TLA+ and its tools have been used in industry for over a decade. More
recently, we have extended TLA+ to include hierarchically structured
formal proofs that are independent of any proof checker. We have
released several versions of the TLAPS proof checker
(http://tla.msr-inria.inria.fr/tlaps) and integrated it into the
TLA+ Toolbox, an IDE for the TLA+ tools
(http://research.microsoft.com/en-us/um/people/lamport/tla/tla.html).

TLAPS and the Toolbox support the top-down development of proofs and
the checking of individual proof steps independently of the rest of
the proof. This helps users focus on the part of the proof they are
working on. Although it is still under active development, TLAPS is
already a powerful tool and has been used for a few verification
projects, in particular in the realm of distributed algorithms
(e.g.,
http://research.microsoft.com/en-us/um/people/lamport/tla/byzpaxos.html).

TLAPS consists of the Proof Manager (PM, an interpreter for the
proof language that computes the proof obligations corresponding to
each proof step) and an extensible list of backend provers. Current backends
include the tableau prover Zenon, an encoding of TLA+ as an object logic
in the Isabelle proof assistant, and a generic backend for SMT solvers.
When possible, we expect backend provers to produce a detailed proof that
is then checked by Isabelle. In this way, we can obtain high assurance
of correctness as well as satisfactory automation.

The current version of the PM handles only the action part of TLA+:
first-order formulas with primed and unprimed variables, where a
variable v is considered to be unrelated to its primed version v'.
This allows us to translate non-temporal proof obligations to standard
first-order logic, without the overhead associated with an encoding of
temporal logic into first-order logic. An extension for handling full
TLA+, including its temporal logic for verifying liveness properties,
is currently being developed.


Description of the activity of the post-doc
===

The post-doctoral position is funded by the PIA ADN4SE project
(http://www.systematic-paris-region.org/en/projets/adn4se) that
develops a real-time operating system and development tools for
embedded systems based on PharOS. The system aims at providing
certifiable correctness and performance guarantees, and core protocols
of the operating system will be formally 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-06-04 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 28 to June 04, 2013.

1) OPAM and packaging
2) ~/.opam design
3) opam packages wrapped inside a spec file
4) A modern meta programming system for OCaml
5) Interfacing with QtQuick 2.0 from Qt5, RFC
6) Ocamlnet-3.6.4
7) automatic extaction of the .mli (and a little more) from the .ml
8) Other Caml News


1) OPAM and packaging
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00145.html

** Very deep in this thread, Chet Murthy said and Christophe Troestler replied:

 OK.  A little more.  OPAM is already a tremendous improvement.  But to
 really make it possible to build -systems- in Ocaml, you have to be
 able to distribute collections of programs, config, and libraries,
 across multiple (admittedly identical) machines.  And distribute
 updates to same.  OPAM is in some ways like BSD ports -- it works
 great for maintaining single machines from source-code.
 
 But what's needed is a way to maintain -many- machines, and to
 distribute updates in a granular manner that be -managed- -- rolled
 forward, rolled back, with full knowledge of which versions of which
 packages are being installed.  And everything with -zero- version
 skew.  So any nondeterminism happened at buiild-time -- by
 deploy-time, all machines are getting identical files with identical
 timestamps.
 
 It's a tall order, b/c OPAM will need to figure out how to capture
 enough of the environment (in order to check it on the target machine
 where a binary is installed) to verify whether it's safe to install
 that binary.  But boy would it be nice.
 
 And as a bonus, we could wrapper opam in the debian apparatus (I
 think) and get a really nice way to turn opam packages into debian
 packages.

Those interested in that should help Sylvain to develop oasis2debian¹
and other helpers.  Oasis has rich metadata and can be the root from
which packages are created (there is also oasis2opam² which usually
performs a better job than humans ;-) ).

¹ https://github.com/ocaml/oasis2debian
² https://github.com/ocaml/oasis2opam
  
** Thomas Gazagnaire then added:

We are indeed in the process of experimenting with that idea (see [1]).
Nothing is ready yet, but that's definitely something we are interested in.

The hard part is (as always) to keep track of the correct external
dependencies (such as the available shared C libraries available at the time
of build). A good first approximation is to say that the external
dependencies never change, but that's obviously not very safe to rely on that
assumption too much, so we are thinking of keeping track of the result given
by ldd as well.

[1] https://github.com/venator/opam/blob/binary/src/core/opamBinary.ml
  

2) ~/.opam design
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00242.html

** Sébastien Dailly asked and Thomas Gazagnaire replied:

 Maybe is the subject now closed, and I'm answering too late, but I'll
 greatly appreciate if opam could follow the XDG Directory design[1] :

 $XDG_CONFIG_HOME/opam (default ~/.config/opam) for the configuration
 $XDG_DATA_HOME/opam (default ~/.local/opam) for the package and all datas

 This allow to stop the polution in the users ~ , and give the user a way to
 define it's own path.

 [1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

The subject is not closed at all, and we might move in this direction in
future releases of OPAM. See for instance [1]

The current design has a lot of advantages (the main one being that you can
remove your ~/.opam if you want restart from scratch) and it can be tweaked
to have a global installation (see [2,3], even if the tweak is not very well
documented). But yes, for some configurations (such as shared NFS homedirs),
the current situation is not perfect and it would be nice to be able to
separate the data from the configuration bits. Luckily, all the paths used by
OPAM are defined in [4] so they can be changed without too much hassle.

[1] https://github.com/OCamlPro/opam/issues/401
[2] https://github.com/OCamlPro/opam/issues/398
[3] https://github.com/OCamlPro/opam-repository/issues/746
[4] https://github.com/OCamlPro/opam/blob/master/src/core/opamPath.ml
  

3) opam packages wrapped inside a spec file
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00261.html

** Florent Monnier said, Francois Berenger asked, and Florent Monnier replied:

 For fun I've played with wrapping an opam package inside a rpm package.
 I just have to tar.gz the package directory and in the 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-05-28 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 21 to 28, 2013.

1) French study on security and functional languages
2) OPAM: installing batteries pa_strings.
3) Other Caml News


1) French study on security and functional languages
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00146.html

** David Mentré said:

For those reading French, ANSSI (French agency for information
security) published a study on security and functional languages, with
a set of recommendations. OCaml is apparently well studied:

http://www.ssi.gouv.fr/fr/anssi/publications/publications-scientifiques/autres-publications/lafosec-securite-et-langages-fonctionnels.html


Cette étude, menée par un consortium composé de Saferiver, Normation,
AMOSSYS et du CEDRIC dans le cadre formel d?un marché du SGDSN, avait
pour objectif principal d?étudier l?adéquation des langages
fonctionnels pour le développement d?applications de sécurité, de
proposer le cas échéant des recommandations, et de mettre en pratique
certaines de ces recommandations.

  
** Fabrice Le Fessant said:

Some comments on this topic:

- LaFoSec is the second study funded by ANSSI (it was done by a consortium
of experts, among which many security experts and one of the main
developers of OCaml, so I would not take their recommendations
lightly, personally), the first one is JavaSec (
http://www.ssi.gouv.fr/fr/anssi/publications/publications-scientifiques/autres-publications/securite-et-langage-java.html),
so there is indeed a comparison between OCaml, other functional languages,
and imperative languages, showing that there are many more security
 problems with Java than with OCaml.

- LaFoSec was started in 2010, which explains why it focuses on OCaml 3.12.

- If some observations seem obvious (for smart people that you are ;-) ), a
lot of them are much less obvious (the fact for example that you can
discover a secrete key using polymorphic comparisons without breaking the
type system). Also, they give an interesting set of arguments for pushing
OCaml instead of other programming languages, so for me, they are really
going in the good direction, it's a very good thing for the OCaml community.

- There is a document that was also written, but has not been published (it
was described at the last JFLA'2013 seminar, also in French), providing a
set of recommendations to improve OCaml for security applications. I don't
know why it was not published with the other ones, maybe because it would
become obsolete faster than the other ones.
  
** Olivier Levillain also said:

For information, some of the results have been presented last February
during the JFLA (Journées francophones des langages applicatifs). The
slides presented are available on the conference web site
(http://jfla.inria.fr/2013/programme.html).
  
** Anil Madhavapeddy said and Olivier Levillain replied:

 I was very glad to see the release of the Parsifal code onto Github too:
 https://github.com/ANSSI-FR/parsifal

 It looks like you have done a lot of the work required towards building
 a pure OCaml SSL and Kerberos stack, as well as DNS and SSH parsers in
 there too. We were just discussing the lack of a pure OCaml SSL library
 for MirageOS (which already has a full reimplementation of device drivers
 and TCP/IP and HTTP, and is just missing the final SSL piece).

I'm glad to see you are interested in Parsifal. It was recently
published on GitHub and will be presented as a short paper at SSTIC 2013
(https://www.sstic.org/2013, not to be confused with SSTiC 2013).

However, this is still a project in development and I must warn you it
was first written to allow for writing quick and robust *parsers*. That
is why for the moment, the code essentially consists in the description
of some formats and protocols. We are beginning to work on animating
the protocols, but this will need a lot of work to get done properly.

Concerning the protocols you cite, here is the status :
- nearly all SSL/TLS messages and X.509 certificates are supported and
some test tools already exist (but only for the first handshake round-trip);
- Kerberos as you see it in the repository is at a very early stage but
more commits are coming once I have time to review them;
- DNS is working and I wrote a picodig version to make some requests
(but this one was easy: there is no real context in the protocol);
- We have not yet worked on SSH but it would be a good idea.
  

2) OPAM: installing batteries pa_strings.
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00190.html

** Ivan Gotovchits asked and Gabriel Scherer replied:

 It seems that I'm the only person in the Internet having such problem.

 I do

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-05-21 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 14 to 21, 2013.

1) ocaml-bitstring 2.0.4
2) standard 3d vector library in OCaml
3) concurrent caml-light?
4) 2D vector graphics
5) Core Suite 109.23.00 + async_parallel
6) Other Caml News


1) ocaml-bitstring 2.0.4
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00079.html

** Richard Jones announced:

bitstring is a library for manipulating bitstrings, binary file
formats, protocols, etc from OCaml.

http://code.google.com/p/bitstring/

The list of changes is here:

http://code.google.com/p/bitstring/source/list
  

2) standard 3d vector library in OCaml
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00081.html

** Continuing this thread from last week, Florent Monnier asked and Francois 
Berenger announced:

 I would enjoy to see your library.

It's in OPAM now under the name vector3.
  

3) concurrent caml-light?
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00085.html

** Chet Murthy asked and François Boisson replied:

 Does anybody know whatever happened to concurrent caml-light? Anybody
 have any idea if the Doligez-Gonthier-Leroy GC was ever implemented in
 another system?

Yes, Camllight is on 0.82-3 version. I tried to maintain it.
You can find debian and ubuntu package on

deb http://boisson.homeip.net/depot wheezy divers

(change wheezy with squeeze, quantal, precise, raring and so on)

and source on

* cvs of INRIA
* deb-src http://boisson.homeip.net/ ./
* https://github.com/FBoisson/Camllight
  
** Xavier Leroy also replied:

 Anybody have any idea if the Doligez-Gonthier-Leroy GC was ever
 implemented in another system?

Yes, for Java, at IBM Haifa (of all places):

Tamar Domani, Elliot K. Kolodner, Ethan Lewis, Eliot E. Salant, Katherine
Barabash, Itai Lahan, Yossi Levanoni, Erez Petrank, Igor Yanover: Implementing
an On-the-Fly Garbage Collector for Java. ISMM 2000: 155-166
http://doi.acm.org/10.1145/362422.362484

later extended with generations:

Tamar Domani, Elliot K. Kolodner, Erez Petrank: A generational on-the-fly
garbage collector for Java. PLDI 2000: 274-284
http://doi.acm.org/10.1145/349299.349336
  

4) 2D vector graphics
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00096.html

** Deep in this thread, Francois Berenger said and Florent Monnier added:

 By the way, I just saw in OPAM that there are bindings
 to cairo, which looks quite nice for 2D vector graphics.

There's even Caboodle a mini-puzzle game that uses it,
which is very simple but interesting as an example of what we can do with it.

For Mageia Linux users, just install it with:
$ su - -c urpmi caboodle
$ caboodle

If you don't have any package for your distro, you may want to get our
patches from:
http://svnweb.mageia.org/packages/cauldron/caboodle/current/
before to compile it.

Or more minimalist examples on Rosetta:
http://rosettacode.org/wiki/Category:Ocaml-cairo

For 2D accelerated graphics, you may also appreciate SFML 2.0,
there are 2 usable bindings: ocaml-sfml and ocsfml.
Both are good for the 2.0 version of SFML that was just released
several days ago.
  

5) Core Suite 109.23.00 + async_parallel
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00102.html

** Jeremie Dimino announced:

I am pleased to announce the 109.23.00 release of the Core suite.

The following packages were upgraded:

- async_parallel
- core
- core_extended
- jenga

async_parallel is a new library.  It is for running tasks in other
processes on a cluster of machines.  A detailed description is
included in the API documentation:

  https://ocaml.janestreet.com/ocaml-core/109.23.00/doc/parallel/Std.html

Files and documentation for this release are available on our website
and all packages are in opam:

  https://ocaml.janestreet.com/ocaml-core/109.14.00/individual/
  https://ocaml.janestreet.com/ocaml-core/109.14.00/doc/

Here are the changelogs for versions 109.15.00 to 109.23.00:

# 109.15.00

## async_extra

- In `Rpc.client` and `Rpc.with_client`, allowed the client to
  implement the rpcs.

  Added a new optional argument: `?implementations:_ Client_implementations.t`.
- Added new module `Versioned_rpc.Both_convert` to allow the caller
  and callee to 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-05-14 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 07 to 14, 2013.

1) extlib 1.5.4
2) standard 3d vector library in OCaml
3) Linux epoll bindings
4) an issue with coercing private types
5) Interfacing with QtQuick 2.0 from Qt5, RFC
6) String, Array, Bigarray.char
7) smarter #load directive
8) New OCaml-Paris meetup on May 21, 19h30, IRILL
9) oasis help: support for qtest in oasis
10) Other Caml News


1) extlib 1.5.4
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00026.html

** ygrek announced:

New release of extlib is out - fixing installation problems only.
Get it as usual at http://code.google.com/p/ocaml-extlib/
  

2) standard 3d vector library in OCaml
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00024.html

** Francois Berenger asked:

Is there a standard library for this purpose?

Maybe I should relase mine, I have a small one.
  
** Francois Berenger replied:

I would enjoy to see your library.

Especially if some functions are usable for OpenGL.
Here is bellow what I'm using for OpenGL.
This is not a vector lib but a matrix lib tailored for use with
forward compatible OpenGL.
It only contains 2 or 3 (not-optimised) functions for vectors computations.

https://forge.ocamlcore.org/scm/viewvc.php/trunk/TEST3/ogl_matrix.mli?view=markuprevision=94root=glmlite
https://forge.ocamlcore.org/scm/viewvc.php/trunk/TEST3/ogl_matrix.mli?view=markuproot=glmlite

https://forge.ocamlcore.org/scm/viewvc.php/trunk/TEST3/ogl_matrix.ml?view=markuprevision=94root=glmlite
https://forge.ocamlcore.org/scm/viewvc.php/trunk/TEST3/ogl_matrix.ml?view=markuproot=glmlite

But this current revision 94 in the svn is not my more advanced version.
The more recent version is not in the svn because it's C code rewriten
in OCaml and the original code was provided under a more restrictive
license than the one of glMLite (MIT), and I don't want to downgrade
to (L)GPL.

Someone told me that I should not bother about this issue and that
this kind of code should be considered as only math.

http://www.linux-nantes.org/%7Efmonnier/ocaml/GL/fc/code/ogl_matrix.ml.xhtml
http://www.linux-nantes.org/%7Efmonnier/ocaml/GL/fc/code/

If your lib contains things useful for OpenGL I would be pleased to
integrate these parts in my module Ogl_matrix, or maybe even create a
new one Ogl_vector.
(But only if your license is MIT or similar)
  
** Daniel Bünzli also replied:

It's not standard, unreleased and I hate to pre-announce but in the following
months I plan to release Gg, a module that gives you basic types for 2D and
3D computer graphics; vectors, matrices, quaternions, axis-aligned boxes,
colors and raster data.

Vectors and matrices are abstract but represented internally as records of
floats. This allows to pass them directly to C functions that take double
arrays and avoids bounds checking in OCaml code. The memory layout of
matrices is also the one expected by OpenGL.

Except for the Raster module --- metadata for bigarrays to allow libraries to
share raster data without depending on each other e.g. an OpenCV or image
loading library and an OpenGL library --- the module is pretty stable now, it
still needs a final code review though and one or two function names may
change.

The current documentation of gg can be found here [1], the code can be
browsed here [2]. It can also be installed via the erratique-unstable opam
repo:

opam repo add erratique-unstable
http://erratique.ch/software/opam-unstable
opam update
opam install gg

But I'd advise you not to that until the next release of opam because of this
bug [3] which while harmless makes your `opam update` experience become
unpleasant (you have to do a `opam remove gg`, before being able to `opam
update`).

Comments are welcome.

Best,

Daniel


[1] http://erratique.ch/software/gg/doc/Gg.html
[2] https://github.com/dbuenzli/gg/
[3] https://github.com/OCamlPro/opam/issues/552
  
** rixed also replied:

For what it's worth, I also did a small 2d vector library[1] some time ago in
order to learn some OCaml while doing something fun. What might be of interest
is that it was able to read font outlines from truetype files, and some non
trivial triangulation algorithm was implemented. If someone is interrested it
could be a good thing to port this with this upcoming Gg lib (instead of my
own slower and certainly less elegant vector module).

[1]: http://gitorious.org/ocalme/geom
  
** Francois Berenger added:

By the way, I just saw in OPAM that there are bindings to cairo, which looks
quite nice for 2D vector graphics.
  

3) Linux epoll bindings
Archive: 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-05-07 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 30 to May 07, 2013.

1) OCaml mechanize?
2) -principal
3) Request for feedback: A problem with injectivity and GADTs
4) Other Caml News


1) OCaml mechanize?
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg3.html

** Continuing the thread from last week, Richard Jones said:

 There are bindings to Perl's WWW::Mechanize in perl4caml. Its website
 seems down,

The latest code is in the git repo:

http://git.annexia.org/?p=perl4caml.git;a=summary
  

2) -principal
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg8.html

** Yaron Minsky asked and Jacques Garrigue replied:

 Can anyone describe the pluses and minuses of turning on -principal?
 Is it considered to be good practice for codebases that are compatible
 with it?  Can it change behavior of currently working code?

Turning on -principal allows detecting risky uses of type information to
help type inference.
By risky I mean that success or failure of type inference may depend
on the order in which subexpressions are typed.
This kind of type information is only used by a limited number of features:
* polymorphic methods
* using different order of labeled arguments in a function
* some discarding of optional arguments
* choice of the source type in a coercion (i.e. automatic upgrading of
   (expr : t2) into (expr : t1 : t2) when the type of expr is closed).
  This is particularly useful for private type abbreviations.
* GADTs
* disambiguation of record field and constructor names (new in trunk)

The technical definition is based on polymorphism, but the intuition
is that type information follows the (functional) flow of data, even going
through polymorphic functions (being conservative when merging flows).
So a simple way to understand is: supposing that type annotation physically
adds type information to the expression they decorate, will all values
reaching the use point be decorated?
It also flows backward (the expected type is propagated), but does not
go through functions in that case.

# type t =  id: 'a. 'a - 'a ;;
type t =  id : 'a. 'a - 'a 
# let f (x : t) = x, x#id;; (* safe code: the type of x is known at all its 
use points *)
val f : t - t * ('a - 'a) = fun
# let f x = (x : t), x#id;; (* unsafe code: the type is only known because 
typing goes from left to right *)
Warning 18: this use of a polymorphic method is not principal.
val f : t - t * ('a - 'a) = fun
# let f x = x#id, (x : t);;(* just exchanging the members of the pair 
causes a failure *)
Error: This expression has type  id : 'a; .. 
   but an expression was expected of type t
   The universal variable 'a0 would escape its scope

In an ideal world, I would suggest systematically using -principal, as it makes
the notion of known type well-defined.
However, there are drawbacks to -principal
* type inference is slower (more copying occurs)
* cmi's become bigger
The first point is mainly a problem if you use objects.
The second one if you have already problems with cmi size (again, mostly 
objects)

As a result the suggested approach is to only compile with -principal once in a 
while.
This is reasonable because if compiling with -principal works, in theory it is 
guaranteed
that the program will be accepted without -principal too. Of course the 
semantics do
not change.

However there is a difficulty: since the generated cmi's may differ, in general 
one
has to maintain completely separate builds.
If you have a complete set of mli's, then a solution is to always compile mli's 
with
(or without) -principal. (Compiling the mli without principal may in theory 
cause
propagation to fail in some cases, but you are on the safe side, and I have
never observed it)

So yes, it is good practice. But I'm afraid few invested the effort in doing it.
Looking at the features you use in Core, this may be a good idea to try.
(My understanding is that Lexifi tried, but they had problems because they
use big object types).
By the way, the ocaml compiler itself doesn't use any of the above features,
so it is not directly concerned.
  

3) Request for feedback: A problem with injectivity and GADTs
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-05/msg00011.html

** Continuing the thread from last week, Jacques Garrigue said:

Ironically, I have just found that lablgtk2 does not compile with the fixed 
version.
lablgtk2 does not use GADTs, but it uses constrained type parameters in classes.

The problem is as follows:

gobject.mli:
type -'a gobj

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-04-30 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 23 to 30, 2013.

1) first release of dolog: the dumb ocaml logger
2) ackermann microbenchmark strange results
3) OCaml-Java  concurrent programming: request for feedback
4) OCaml mechanize?
5) Request for feedback: A problem with injectivity and GADTs
6) Book reviewers wanted
7) Thematic trimester Semantics of proofs and certified mathematics, spring 
2014, Paris
8) Other Caml News


1) first release of dolog: the dumb ocaml logger
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00162.html

** Francois Berenger announced:

After an 'opam update', you should be able to see the dolog package.

Here is its minimalistic interface definition:
---
type log_level = FATAL | ERROR | WARN | INFO | DEBUG

val set_log_level : log_level - unit
val set_output : out_channel - unit

val fatal : string Lazy.t - unit
val error : string Lazy.t - unit
val warn : string Lazy.t - unit
val info : string Lazy.t - unit
val debug : string Lazy.t - unit
---

The full source code can be found here:

https://github.com/HappyCrow/dolog

The license is a BSD one.

I believe the more complete logging alternative
is Xavier Clerc's Bolt (http://bolt.x9c.fr/).
  

2) ackermann microbenchmark strange results
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00179.html

** ygrek asked:

Got some time scratching my head over this little puzzle.
Consider this bog-standard ackermann code :

let rec ack m n =
  match m, n with
  | 0,n - n+1
  | m,0 - ack (m-1) 1
  | m,n - ack (m-1) (ack m (n-1))
in let _ = ack 4 1 ()

One could also pass m and n as a tuple. Also the call to the actual computation
can be a toplevel let or not.  All in all 4 variants. Can you predict what will
be the performance and what is the difference (if any) in generated code?

All code and Makefile is attached.

Running `make bench` here consistently gives the following (ack1, ack3 - tuples,
ack2, ack4 - curried) :

ack1.ml
0:03.85

ack2.ml
0:04.70

ack3.ml
0:04.60

ack4.ml
0:03.85

Tested with 3.12.1 and 4.00.1 (ack4 becomes slower).

Moreover, the generated assembly code for the main loop is the same, afaics.
The only difference is the initialization of structure fields and the initial
call to ack. Please can anybody explain the performance difference? I understand
that microbenchmarks are no way the basis to draw performance conclusions upon,
but I cannot explain these results to myself in any meaninful way.
Please help! :)
  
** Many people replied, including Xavier Leroy:

As others said, probably code placement. A good tool to explore these
issues under Linux is perf, in particular perf stats, which lets
you count various hardware events. Running it on your 4 programs,
you'll see that the number of instructions executed is almost exactly
the same, but the branch mispredictions (for instance) vary
significantly, in a way correlated with the overall execution time.

(Note that this doesn't have anything to do with OCaml: you'd observe
crazy variations like these with any compiled language.)

 I understand that microbenchmarks are no way the basis to draw
 performance conclusions upon, but I cannot explain these results to
 myself in any meaninful way.

Nobody can except perhaps a few engineers at Intel or AMD who have the
whole microarchitecture of their processors imprinted in their heads.
(And then they will not tell you.) See, modern microarchitectures
contain so many clever heuristics that performance is generally very
good but essentially unpredictable...

rixed AT happyleptic.org
adds:

 Remember me of a paper I read some years ago that was measuring the
 effect of the various optimisation levels of gcc against the effect
 of addresses choices (randomised using environment strings of
 various lengths!), and which conclusion was that the effect of -O3
 compared to -O2 was less than the effect of choosing a good
 environment string :-) Couldn't find it again using Google ; maybe
 someone remember this paper?

It's probably Producing Wrong Data Without Doing Anything Obviously
Wrong! by Diwan et al, ASPLOS 2009,
http://www-plan.cs.colorado.edu/diwan/asplos09.pdf
This paper made quite a splash in the compiler community...
  

3) OCaml-Java  concurrent programming: request for feedback
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00180.html

** Xavier Clerc:

The OCaml-Java is a project whose goal is to allow compilation
of OCaml sources to Java bytecode, thus allowing execution on
any JVM. The objectives are to 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-04-16 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 09 to 16, 2013.

1) Functional Programming at Jane Street
2) try...finally , threads, stack-tracebacks  in ocaml
3) Build number and date in OCaml?
4) Microsoft-funded PhD opportunity (software/ system verification)
5) Merlin 1.0 released
6) modified error messages for ocamlc
7) OCaml 2013 - Call for presentations
8) Other Caml News


1) Functional Programming at Jane Street
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00075.html

** Yaron Minsky:

Jane Street is looking to hire functional programmers for our offices
in New York, London and Hong Kong.

Jane Street has the largest team of OCaml developers in any industrial
setting, and the world's largest OCaml codebase. We use OCaml for
running our entire business, working on everything from statistical
research to systems administration to automated trading systems. If
you're interested in using OCaml to solve real-world problems, there's
no better place.

Jane Street is an informal and intellecutal place --- you'll get to
work with an extremely talented group of developers and traders (a
pretty geeky group in its own right), pushing the bounds of functional
programming and learning about the business of trading.

We have a strong commitment to OCaml and to open-source software.
We've continue to develop and release our own open source software, as
well as support OCaml Labs and OCamlPro in building out the language
infrastructure.

Compensation is more than competitive, and no prior experience with
finance is required.

Here are some resources you can use to learn more about Jane Street
and what we do.

- A talk I gave at CMU about how and why we use OCaml
http://ocaml.janestreet.com/?q=node/61
- Our technical blog: http://ocaml.janestreet.com
- Our open-source site: http://janestreet.github.io

You can apply here:

http://janestreet.com/apply
  

2) try...finally , threads, stack-tracebacks  in ocaml
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00089.html

** Chet Murthy asked and, after many replies, Jacques-Henri Jourdan said:

 People have previously asked about try...finally support in Ocaml, and
 it's been observed (correctly) that you can write a little combinator
 to give you this support, e.g.

 let finally f arg finf =
 let rv = try Inl(f arg) with e -
 Inr e
 in (try finf arg rv with e - ());
 match rv with
 Inl v - v
 | Inr e - raise e

 The problem is, you discard stack-traceback when you rethrow the
 exception. One can program around this explicitly by capturing the
 backtrace string and appending it to the rethrown exception, but it's
 cumbersome and won't work for exceptions like Not_found that are
 already defined without a mutable string slot.

 It sure would be nice of ocaml had try...finally that preserved the
 traceback information properly  though maybe it isn't possible.
 Certainly in the case where the finally block doesn't raise any
 exceptions itself (even those that are caught silently), it seems like
 it ought to be possible.

I recently published a blog post proposing a solution to the backtrace
problem of Ocaml. It includes a Camlp4 filter and a small Ocaml library
to handle exception backtraces. The performance drawback is negligible
when backtraces are not activated, and reasonable when they are.

You can read about it here :

http://gallium.inria.fr/blog/a-library-to-record-ocaml-backtraces/
  

3) Build number and date in OCaml?
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00073.html

** Étienne André asked:

I've been using OCaml for a couple of years, but without using any
advanced feature; so my question may be a little naive. Is there any
way to insert easily the current date and time of compiling, as well
as, e.g., an incremental build number in an OCaml program? So that it
is printed at runtime, e.g., in the program header.

I quite stupidly used the Unix.gettimeofday() function before
realizing that it is of course executed at runtime.

Of course, I could do it using an external script that would modify
the OCaml source code before compiling, but is there any native OCaml
feature for achieving this in a cleaner manner?
  
** Julien Signoles suggested:

This kind of information is part of your build process and are not
directly accessible in OCaml. If you want to access it in your OCaml
program, you have to pass them from the build environment to the
program environment. As Jeremie Dimino said, the usual way is to
general a small OCaml file at 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-04-02 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 26 to April 02, 2013.

1) Yypkg mingw-builds 1.2b1 - 70 Windows 32/64 packages, OCaml cross-compiler
2) Master-slave architecture behind an ocsigen server.


1) Yypkg mingw-builds 1.2b1 - 70 Windows 32/64 packages, OCaml cross-compiler
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-03/msg00267.html

** Adrien Nader announced:

I'm pleased (and much relieved) to announce a new version of the yypkg
mingw-builds. Together with yypkg, this provides a package manager both
on Linux and on Windows with 70 packages of libraries and binaries built
both for i686 and x86_64. Everything is easily fully reproducible.

Release highlights include:
- New x64 toolchain (both as a cross- and native toolchain)
- Improved native toolchains
- OCaml cross-compiler, only targets i686-w64-mingw32 (see bug 5737)
- More packages
- Updated packages
- Installers for Windows

You can find details, documentationa and downloads on the new website:
http://yypkg.org/mingw-builds/

PS: you can also read/write comments and vote on reddit if you feel like
it's worth it:

http://www.reddit.com/r/programming/comments/1b8egi/yypkg_mingwbuilds_windowslinux_package_manager_70/
  
** He later added:

I've put a new version (1.2 RC1) which fixes the issues I had found in
beta1. The documentation and the binaries are updated; there are small
fixes here and there (mostly in the doc even though there is still room
for improvements).

The address hasn't changed and you can find everything on yypkg.org:
http://yypkg.org/mingw-builds/

As before, I've submitted it to reddit. Unlike before, I haven't been
blocked by its spam filter.
http://www.reddit.com/r/programming/comments/1bi47j/yypkg_mingwbuilds_12rc1_70_packages_for_windows/
   
  

2) Master-slave architecture behind an ocsigen server.
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-03/msg00246.html

** Philippe Veber asked:

I'm developping an ocsigen website doing some scientific calculations.
Up to now, the calculations were done in the same process that runs
the server. In order to gain in scalability (and maybe stability too),
I would like to run those calculations in a separate (pool of)
process(es). As this is a pretty typical setup, I guess quite a few
people have already done that. So I'd like to hear some suggestions on
what library to use in this particular context. It seems to me that
the release library [1] should do the job and is lwt-friendly, but
there are maybe other good options?

Thanks for any hint, cheers!

Philippe.

[1] https://github.com/andrenth/release
  
** Martin Jambon suggested:

I wrote and used a library called Nproc about a year ago. It lets you
create (Nproc.create) a pool of N processes, to which you can submit
(Nproc.submit) computations of any type quasi-magically - just make
sure any big environment required for the computation is not copied
with each closure that you send to the workers. The submodule
Nproc.Full provides a more advanced interface that lets each worker
process have its own local environment.

https://github.com/MyLifeLabs/nproc

I haven't used Nproc in a while but it was working fine and should
still work.
  
** Philippe Veber then said and Alain Frisch replied:

 nproc meets exactly my needs: a simple lwt-friendly interface to
 dispatch function calls on a pool of processes that run on the same
 machine. I have only one concern, that should probably be discussed on
 the ocsigen list, that is I wonder if it is okay to fork the process
 running the ocsigen server. I think I remember warnings on having parent
 and children processes sharing connections/channels but it's really not
 clear to me.

FWIW, LexiFi uses an architecture quite close to this for our
application. The main process manages the GUI and dispatches
computations tasks to external processes. Some points to be noted:

- Since this is a Windows application, we cannot rely on fork.
Instead, we restart the application (Sys.argv.(0)), with specific
command-line flag, captured by the library in charge of managing
computations. This is done by calling a special function in this
library; the function does nothing in the main process and in the
sub-processes, it starts the special mode and never returns. This
gives a chance to the main application to do some global
initialization common to the main and sub processes (for instance, we
dynlink external plugins in this initialization phase).

- Computation functions are registered as global values. Registration
returns an opaque handle which can be used to call such a function. We
don't rely on marshaling closures.

- The GUI process actually spawns a 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-03-26 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 19 to 26, 2013.

1) Case study in optimization: porting a compiler from OCaml to F#
2) Oregon Programming Languages Summer School - call for participation
3) Other Caml News


1) Case study in optimization: porting a compiler from OCaml to F#
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-03/msg00176.html

** Deep in this thread, Roberto Di Cosmo said:

We are quite happy that Parmap is useful in your applications,
and would love to know more about your use cases.

Btw, I uploaded to HAL an author version of the article published in Procedia
Computer Science, so that everybody can access the paper ... it is
available at

http://hal.archives-ouvertes.fr/docs/00/69/25/15/PDF/parmap-author-file.pdf
  

2) Oregon Programming Languages Summer School - call for participation
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-03/msg00202.html

** Amal Ahmed announced:

This year's Oregon PL Summer School will take place from July 22nd to
August 3rd. The registration deadline is April 16th. Full information
on registration and scholarships an be found here:

   http://www.cs.uoregon.edu/Activities/summerschool

The school has a long and successful tradition (sponsored by the NSF,
ACM SIGPLAN, and industry). It covers current research in the theory
and practice of programming languages. Material is presented at a
tutorial level that will help graduate students and researchers from
academia or industry understand the critical issues and open problems
confronting the field. Prerequisites are an elementary knowledge of
logic and mathematics, as covered in undergraduate classes on discrete
mathematics, and some knowledge of programming languages at the level
of an undergraduate survey course.

A new feature this year is a Coq boot camp session, to be held on July
21st -- one day before the summer school officially begins. The boot
camp will provide a one-day, intensive, hands-on introduction to the
practical mechanics of the Coq proof assistant. More information is
available at the summer school website.


This year's program is titled Types, Logic, and Verification. The
speakers and topics include:

Amal Ahmed -- Logical Relations
Northeastern University

Robert Harper -- Type Theory Foundations
Carnegie Mellon University

Dan Licata -- Dependently-Typed Programming in Agda
Carnegie Mellon University and Institute for Advanced Study 

Greg Morrisett -- Coq as a Programming Language
Harvard University

Simon Peyton-Jones -- Adventures with Types in Haskell
Microsoft Research

Frank Pfenning -- Linear Logic and Session-based Concurrency
Carnegie Mellon University

Andrew Tolmach -- Software Foundations in Coq
Portland State University

Stephanie Weirich -- Designing Dependently-Typed Programming Languages
University of Pennsylvania

Steve Zdancewic -- Verifying LLVM Optimizations in Coq
University of Pennsylvania

We hope you can join us for this excellent program.

Amal Ahmed
Zena Ariola
Bob Constable
Frank Pfenning
Benjamin Pierce
OPLSS 2013 organizers
  

3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocaml.org/.

The failures of Debian (and its derivatives):
  
http://bentobako.org/david/blog/index.php?post/2013/01/28/The-failures-of-Debian-%28and-its-derivatives%29

Stog 0.8.0:
  http://caml.inria.fr/cgi-bin/hump.cgi?contrib=818

OCamlRSS 2.1.0:
  http://caml.inria.fr/cgi-bin/hump.cgi?contrib=850
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .



___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-03-19 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 12 to 19, 2013.

1) Case study in optimization: porting a compiler from OCaml to F#
2) OPAM 1.0.0 released !
3) Use of OCaml in universities and engineering schools
4) Riakc 0.0.0
5) Core Suite 109.14.00 released + custom_printf
6) Other Caml News


1) Case study in optimization: porting a compiler from OCaml to F#
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-03/msg00085.html

** Jon Harrop said:

There has been some discussion here about the implications of single- vs
multi-threaded garbage collectors and, in particular, their performance in
the context of the kinds of metaprogramming that OCaml has traditionally
been used for.

I recently ported a compiler written in OCaml to the F# programming language
for a client and performance turned out to be an issue so I'd like to
present this as a case study to provide some real data. Unfortunately I
cannot disclose precise details.

The original compiler was 15kLOC of OCaml code. The amounts of DSL code that
it consumes and C code that it produces can be considerable and compilation
can take minutes. Consequently, performance is valued by my client's
customers and, therefore, the original code had been optimized for OCaml's
performance characteristics.

A direct translation of the OCaml code to F# proved to be over 10x slower.
This was so slow that it impeded testing my translation so I did some
optimization early. Specifically, profiling indicated that the biggest
problem was the high rate of exceptions being raised and caught. Exceptions
are around 600x slower on .NET than in OCaml so this can quickly degrade
performance. I changed all of the hot paths to use union types (usually
option types) instead of exceptions, according to F# idioms. Although this
incurs a lot of unnecessary boxing in F# the performance improvements were
substantial and the F# version became 5x slower than the OCaml.

On a related note, thorough testing showed that my almost-blind translation
of 15kLOC of code was completely error free. I think this is a real
testament to the power of ML's static type system. The only error I have
introduced so far occurred when I was replacing the use of an exception in a
function with a union type.

After demonstrating the correctness of the translation, my effort turned to
trying to improve performance in an attempt to compete with the original
OCaml code. I had believed that this could well prove to be prohibitively
difficult or even impossible because symbolic code is OCaml's main strength.
However, I have managed to make the F# around 8x faster than it was and, in
particular, substantially faster than the original OCaml.

So this non-trivial symbolic code base has not had its performance suffer
from the adoption of a multicore-friendly garbage collector.
  
** Julien Verlaguet asked and Jon Harrop replied:

 Thanks for sharing this case-study with us!

No problem. I found it in my drafts folder. :-)

 Have you tried parallelizing the OCaml version?

No. I didn't touch the OCaml code at all.

 I am thinking pre-forked processes communicating with pipes?

That would work but it would be a lot of effort compared to
Array.Parallel.map in F#.

 We write a lot of large-scale static-analysis in OCaml here at Facebook.

Good to hear. :-)

 Parallelizing them with pre-forked processes gave us very good
performances.

I'm not sure how much message passing would be required in this case and
don't have time to investigate.

 I would be curious to see a case-study of pre-forked OCaml vs threaded F#.

Me too. Only problem is that fork-based parallel OCaml code takes a long
time to write in comparison. Incidentally, the F# does not make direct use
of threads.
  
** Pierre-Alexandre Voye then suggested:

So you could maybe use Parmap.map ?
Parmap.parmap ~ncores:4 funct (Parmap.L elem_list)
  
** Jon Harrop replied and Jean-Marc Alliot said:

We have been using Parmap and are quite happy with it (we use it as an
alternative to the Ocaml/MPI implementation when MPI is not strictly
required), with excellent scalability on our applications (even if we
had to change from time to time a little bit or our code, regarding
the fact that Parmap does not allow in place modifications).

 What happens if the inner function returns results via mutation? I
 assume you must rearrange the code to return all results explicitly
 and they will then be deep copied (which destroys scalability due to
 limited shared memory bandwidth on multicores).

As fas as I can tell there is no copy of any form. Parmap only
collects results. If you do in place modifications, they are lost.
Parmap is, in a way, functional...

 Does it do load balancing? I assume not given that ncores is
 hardcoded.

There is an optional argument (chunksize) to manually control load

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-03-12 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 05 to 12, 2013.

1) Commercial Users of Functional Programming 2013
2) OPAM mailing-lists ERRATUM
3) Barista 2.0-beta release
4) A brief guide to a bit of the OCaml type checker
5) llpp v15
6) [ocamlgraph] Johnson's algo, C-bindings, GraphML reader, edge dominators
7) If you distribute oasis' setup.ml with your software, please use a recent 
(= 0.3.0) version of Oasis
8) OpenGL Ocaml mailing-list
9) Other Caml News


1) Commercial Users of Functional Programming 2013
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-03/msg00019.html

** Thomas Gazagnaire announced:

This year, CUFP 2013 will be in Boston (and it is still co-located with ICFP 
2013).
If you use OCaml (or any other functional language) for practical 
applications, then you should consider applying!

http://cufp.org/2013cfp

COMMERCIAL USERS OF FUNCTIONAL PROGRAMMING 2013
CUFP 2013
http://cufp.org/conference
CALL FOR PRESENTATIONS
Boston, MA, United States
Sep 22-24
Talk Proposal Submission Deadline 29 June 2013
Co-located with ICFP 2013
Sponsored by SIGPLAN

The annual CUFP workshop is a place where people can see how others
are using functional programming to solve real world problems; where
practitioners meet and collaborate; where language designers and users
can share ideas about the future of their favorite language; and where
one can learn practical techniques and approaches for putting
functional programming to work.

Giving a CUFP Talk
==

If you have experience using functional languages in a practical
setting, we invite you to submit a proposal to give a talk at the
workshop. We are looking for both experience reports and
in-depth technical talks.

Experience reports are typically 25 minutes long (but negotiable), and
aim to inform participants about how functional programming plays out
in real-world applications, focusing especially on lessons learned and
insights gained. Experience reports don't need to be highly technical;
reflections on the commercial, management, or software engineering
aspects are, if anything, more important.

Technical talks are also 25 minutes long (also negotiable), and should
focus on teaching the audience something about a particular technique
or methodology, from the point of view of someone who has seen it play
out in practice. These talks could cover anything from techniques for
building functional concurrent applications, to managing dynamic
reconfigurations, to design recipes for using types effectively in
large-scale applications. While these talks will often be based on a
particular language, they should be accessible to a broad range of
programmers.

If you are interested in offering a talk, or nominating someone to do
so, send an e-mail to marius(at)twitter(dot)com or
sperber(at)deinprogramm(dot)de or by 29 June 2013 with a short
description of what you'd like to talk about or what you think your
nominee should give a talk about. Such descriptions should be about
one page long.

There will be a short scribes report of the presentations and
discussions but not of the details of individual talks, as the meeting
is intended to be more a discussion forum than a technical
interchange. You do not need to submit a paper, just a proposal for
your talk! Note that we will need all presenters to register for the
CUFP workshop and travel to Boston at their own expense.

Program Committee
=

Marius Eriksen (Twitter, Inc.), co-chair
Mike Sperber (Active Group), co-chair
Mary Sheeran (Chalmers)
Andres Löh (Well-Typed)
Thomas Gazagnaire (OCamlPro)
Steve Vinoski (Basho)
Jorge Ortiz (Foursquare, Inc.)
Blake Matheny (Tumblr, Inc.)
Simon Marlow (Facebook, Inc.)

More information


For more information on CUFP, including videos of presentations from
previous years, take a look at the CUFP website at
http://cufp.org. Note that presenters, like other attendees, will need
to register for the event. Presentations will be video taped and
presenters will be expected to sign an ACM copyright release
form. Acceptance and rejection letters will be sent out by July 16th.

Guidance on giving a great CUFP talk


Focus on the interesting bits: Think about what will distinguish your
talk, and what will engage the audience, and focus there. There are a
number of places to look for those interesting bits.

Setting: FP is pretty well established in some areas, including
formal verification, financial processing and server-side
web-services. An unusual setting can be a source of interest. If
you're deploying FP-based mobile UIs or building servers on oil
rigs, then the challenges of that scenario are worth focusing
on. Did FP help or hinder in adapting to the setting?

Technology: The CUFP audience is hungry to learn about how FP

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-03-05 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of February 26 to March 05, 
2013.

1) Brand-new BER MetaOCaml for OCaml 4.00.1
2) Core Suite 109.11.00 released + ocaml_plugin
3) Research Assistantship at Oxford on Bidirectional Transformations
4) Other Caml News


1) Brand-new BER MetaOCaml for OCaml 4.00.1
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-02/msg00199.html

** Continuing an old thread, Anil Madhavapeddy announced:

Thanks to Cedric Cellier packaging it up and sending us a pull request [1],
you can try our MetaOCaml BER straight from OPAM via:

$ opam update
$ opam switch 4.00.1+BER
$ eval `opam config env`
$ ocaml...

-anil

[1] https://github.com/OCamlPro/opam-repository/pull/461
  

2) Core Suite 109.11.00 released + ocaml_plugin
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-02/msg00213.html

** Jeremie Dimino announced:

I'm pleased to announce the 109.11.00 release of the Core suite. We
are now distributing the ocaml_plugin project, which aims at making
dynlink more easier. It offers a high-level API where the user can get
a first class module out of a few ml source files, the compilation
being handled automatically.

ocaml_plugin has been tested only on Linux, but we plan to make it usable
on other platforms as well.

Files and documentation are available on our website and all packages
are in opam:

  https://ocaml.janestreet.com/ocaml-core/109.11.00/individual/
  https://ocaml.janestreet.com/ocaml-core/109.11.00/doc/

Changelogs for versions 109.08.00 to 109.11.00:

# 109.08.00

## async_extra

- Added module `Async.Command`
  This is `Core.Command` with additional async functions.  In particular
  it contains a function `async_basic` that is exactly the same as
  `Core.Command.basic`, except that the function it wraps returns
  `unit Deferred.t`, instead of `unit`.  `async_basic` will also start the
  async scheduler before the wrapped function is run, and will stop the
  scheduler when the wrapped function returns.

## async_unix

- Added module `Async.Process`
  This is a new module for creating and dealing with child processes.
- For `Writer.save`, replaced the `temp_prefix` argument with `temp_file`.
- Added `Ivar.invariant` function.
- Added value `Scheduler.fold_fields`
  This lets one fold over the fields in the scheduler, eliminates an
  annoying place in catalog browser that reached into the internals of
  async to compute the sizes of the scheduler fields

## core

- Cleaned up and updated the `README`.
- Changed executables to enable backtraces if `OCAMLRUNPARAM` is not set.
- Changed `Command` so that executables show build info and version info
  This happens when an executatble is called as:

foo.exe version

  Before this change, rather than display build info, executables
  would display the not-so-helpful:

  (no option given - printing version)
- Added back `Float` rounding functions with a hardcoded direction.
- Exposed `with bin_io` and `with compare` for the =sexp_bool= type.
- Added value `Core.Never_returns.sexp_of_t`.
- Added values `Or_error.tag{,_arg}`
  These are analogous to `Error` functions of the same name.
- Added functor `Sexpable.Of_sexpable`
  This is for serializing values of one type as though it were some
  other isomorphic type.
- Added module `Backtrace.Exn`
  This exposes OCaml stdlib's `Printexc` functions for backtraces.
- Added module `Flags`
  This implements Unix-style sets of flags that are represented as an
  `int` with various bits set, one bit for each flag, e.g.,
  `Linux_ext.Epoll.Flag`.
- Added module `Uuid`
  This module implements universally unique identifiers based on version
  3 of the UUID specification.  It used to be in `Core_extended=`
- Added module `Type_equal`, which defines the equality GADT.

## type_conv

- Fixed type_conv to stop dropping parens in arguments such as:

type t = {
  a : int with default(1), sexp_drop_if(fun x - (x + 1) * 2 = 4)
} with sexp

# 109.09.00

## async

- Switched `Async.Std`'s toplevel bindings for `Deferred.Or_error`'s
`bind` and `map` to use
  `Deferred.Result`.
  This allows them to be used with any `'error` type, rather than just
`Error.t`.

## async_core

- Fixed bug in `Async.Throttle`, in which jobs weren't started in order.

## async_unix

- Added module `Thread_safe_pipe`, for streaming data outside async into async.
  This a more efficient and feature-ful way to send a sequence of values
  from outside async into async than `Thread_safe.pipe`, which has been
  eliminated.
- Changed functions in `Thread_safe` to always wake up the scheduler.
  Changed `Thread_safe.run_in_async{,_exn}` to not run a cycle, and
  instead rely on the scheduler to run 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-02-26 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of February 19 to 26, 2013.

1) llpp v13
2) Beta-release of Merlin
3) Extracting information from HTML documents
4) strange typechecking result
5) What is triggering a lot of GC work?
6) Other Caml News


1) llpp v13
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-02/msg00148.html

** malc announced:

New version of llpp (tagged v14) is now available at
http://repo.or.cz/w/llpp.git

Blurb:

llpp a graphical PDF viewer which aims to superficially resemble
less(1)

Changes:

* Bugfixes
* Keyboard handling imrpovements (keypad, Neo layout, altgr)
* Some functionality to make integration with synctex easier
(shift click, -remote command line option)
  

2) Beta-release of Merlin
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-02/msg00154.html

** Frédéric Bour announced:

We are very pleased to announce the beta release of Merlin. Merlin is a tool
which provides smart completion, among other things, in your favorite editor.
As of today, Vim and Emacs are supported.

See it at work:
https://github.com/def-lkb/merlin#screenshots

Its features include:
- completion of values, constructorsand modules based on local scope
- retrieving type of identifiers and/or expressions under cursor
- integration of findlib to manage buildpath
- highlighting of syntax errors, type errors and warnings inside the editor
- to a certain amount, resilience to syntax and type errors

It works only with Ocaml 4.00.1 (may works with newer versions).

If you happen to have an opam installation with the right version
(opam switch 4.00.1), you can try it right away with:

$ opam remote add kiwi http://kiwi.iuwt.fr/~asmanur/opam/.git 
http://kiwi.iuwt.fr/%7Easmanur/opam/.git 
$ opam install merlin

Then to get started and set-up your editor:
- https://github.com/def-lkb/merlin#setting-up-vim
- https://github.com/def-lkb/merlin#emacs-interface

Check it out at: https://github.com/def-lkb/merlin

The current version still needs to be tested under various systems and
configurations, your feedback is welcome.
  
** Gabriel Scherer then said:

I looked into Merlin in the last few days, so here is a bit more
information if you, like me, are interested in design information
about projects before deciding whether to use (and potentially
contribute to) them.

Interface-wise: using Merlin (at least on emacs) feels a lot like
ProofGeneral (or CoqIde): there is a checked zone from the start of
the buffer to the first error, and reliable type information is
available in all this checked zone. The interface is rather simple and
easy to use.

(If you're considering porting Merlin to another editor: merlin is an
OCaml program that inputs and outputs JSON queries, so it seems rather
easy to port to any editor having plugin support in any language with
JSON support. Given its youth, you should however expect Merlin's
protocol to evolve over the next development period, so editor plugin
developers would need to follow Merlin's internal changes for now.)

The major difference between Merlin and -annot-based tools such as
Ocamlspotter or Typerex2 is that Merlin does the work of parsing OCaml
sentences into chunks and sending them incrementally to the
type-checker, instead of sending the whole buffer at once and using
the output. This means that Merlin is much more robust with respect to
files that have errors and cannot be compiled as a whole: you'll get
reliable type information from the start of the file upto the first
error (and some resilience heuristic to have more after). The OCaml
type-checker is in fact able to provide some typing information even
for incorrect programs, so -annot-based tools do support some of those
features, but in a less reliable and more coarse-grained way.

The design trade-off is that Merlin has to copy/adapt more logic from
the compiler: it embeds an OCaml parser derived from the compiler's
one (you won't get parsing bugs as with regexpy elisp modes), and
currently also copies and slightly modifies the type-checker (I hope
this can be changed in the future, possibly by adding some flexibility
to the type-checker regarding eg. production of warnings). This means
more maintenance work to port Merlin to future OCaml versions. On the
other hand, it's probably not reasonable to expect the compiler
type-checker to be re-engineered for optimal incrementality support,
so having an external implementation of incrementality that piggybacks
on the batch typer interface makes sense.

My personal intuition is that Merlin's design is a good long-term
choice for an editor service (as opposed to code-analysis services).
You want tools such as ocamldoc, dead code analysis, or 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-02-12 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of February 05 to 12, 2013.

1) OCaml Platform - Mailing List
2) Memoize GADT
3) ocp-indent beta release
4) Core Suite 109.08.00 released
5) OCaml Labs Monthly Update
6) OMonad 0.2
7) OCaml tests on Travis CI
8) geany as an ocaml ide
9) ReactiveML 1.08.04
10) Other Caml News


1) OCaml Platform - Mailing List
Archive: http://thread.gmane.org/gmane.comp.lang.caml.general/56705

** Amir Chaudhry announced:

As some of you may be aware from the Consortium meeting, there's an
ongoing project to create an OCaml Platform. The Platform will combine
the core OCaml compiler distribution from INRIA with a comprehensive,
coherent set of libraries, tools, documentation, and other resources.
For example, the OPAM package manager will play a central role in both
packaging and distribution, as well as supporting continuous
integration testing.

This email is to let you know that we've set up a mailing list to
discuss the Platform (platform at lists.ocaml.org), and those who
are interested can follow the day-to-day discussions there [1]. Any
important announcements, including releases, would also be copied to
the caml-list when appropriate, so you don't need to join if you only
want updates.

Best wishes,
Amir

[1] http://lists.ocaml.org/listinfo/platform
  

2) Memoize GADT
Archive: http://thread.gmane.org/gmane.comp.lang.caml.general/56708

** Christophe Papazian asked and Alain Frisch replied:

 this must be a very basic question for some of you, sorry for the 
 inconvenience :
 
 When I have function f of type (a - b), I can easily add a layer to
 that function to memoize the result by using a (a,b) Hashtbl.t to
 store the results of the expensive to compute f.
 
 let mf = let e = Hashtbl.create 0 in ( fun x - try Hashtbl.find e x with 
 Not_found - let res = f x in Hashtbl.add e
 x res; res )
 
 But now, I have a function g 
   let g (type a) : a gadt - a = 
 
 And If I apply the same method, type a becomes weak (_'a).
 
 Is there something simple to memoize that function as easy as the
 previous example and keep its polymorphism ? I think not, but I hope
 to be wrong.

We have encountered exactly the same problem recently.  A slightly more 
general version of your question is how to memoize a function of type

   'a t - 'a s

for two type parametrized constructors t and s (and similarly with 
higher arities).  We want an hash table which can hold key/value 
bindings ('a t * 'a s) for any 'a.  The equality of keys must be such 
that when (key1 : 'a t) is equal to (key2 : 'b t), we can deduce that 'a 
and 'b are the same type (i.e. the value must hold enough information to 
deduce the type from the content), which guarantees that 'a s and 'b s 
are also the same type (and so the existing value associated to key1 can 
be returned for key2).  This assumption often holds when 'a t is a GADT 
representing expressions which evaluate to values of type 'a.

Our solution (implemented by my colleague Sebastien, in Cc:) has been to 
create a functor with the following signature:

==
module type ParametricType = sig
   type 'a t
end

module ParametricEquality : sig
   type (_, _) t =
 | Eq: ('a, 'a) t
 | Ne: ('a, 'b) t
end

module type ParametricHashedType = sig
   type 'a t
   val equal: 'a t - 'b t - ('a, 'b) ParametricEquality.t
   val hash: 'a t - int
end

module ParametricHashtbl : sig
   module type S = sig
 type 'a key
 type 'a value
 type binding = Binding: 'a key * 'a value - binding
 type t
 val create: int - t
 val clear: t - unit
 val reset: t - unit
 val copy: t - t
 val add: t - 'a key - 'a value - unit
 val remove: t - 'a key - unit
 val find: t - 'a key - 'a value
 val find_all: t - 'a key - 'a value list
 val replace: t - 'a key - 'a value - unit
 val mem: t - 'a key - bool
 val length: t - int
 val iter: (binding - unit) - t - unit
 val fold: (binding - 'a - 'a) - t - 'a - 'a
   end
   module Make(X:ParametricHashedType)(Y:ParametricType): S with type 'a 
key = 'a X.t and type 'a value = 'a Y.t
end
==

Note that the first input of the function (ParametricHashedTyped) looks 
like the standard argument to Hashtbl.Make, except that the equality 
function returns a dynamic witness of equality between 'a and 'b in case 
of equality between two values of types 'a t and 'b t.  This is 
implemented using a GADT.  We also use a GADT to introduce an 
existential on 'a for key/value pairs of type ('a t * 'a s) to be used 
for iterators (iter/fold).  Instead we 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-01-29 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of January 22 to 29, 2013.

1) beta-release of OPAM
2) Portable timeout function
3) omonad-0.0.1
4) OCaml 4.00.1 for Android: OPAM packages
5) Working Group: the future of syntax extensions in OCaml, after camlp4
6) If I wanted to write SWIG in OCaml, what library would I need?
7) Datalog-0.1
8) CWN archive links
9) Other Caml News


1) beta-release of OPAM
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00155.html

** Continuing the thread from last week, Thomas Gazagnaire announced:

I've created a FAQ with these two questions on OPAM wiki: 
https://github.com/OCamlPro/opam/wiki/FAQ

Feel free to edit and contribute!

(once we get sufficiently nice contents, this can automatically go somewhere 
on opam.ocamlpro.com as the other wiki pages).
  

2) Portable timeout function
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00164.html

** Samuel Mimram asked and Daniel Bünzli replied:

 I would like to implement a timeout function of type:
 
 float - ('a - 'b) - 'a - 'b option
 
 which takes a maximum number n of seconds to run, a function f, an
 argument x, and returns Some (f x) if the computation ends before n
 seconds and None otherwise. Of course, there is a simple
 implementation using Unix.setitimer, but apparently it does not work
 under windows because of signals implementation (and I don't have
 access to a windows machine...). Since this is a pretty standard idom
 I expected to find it implemented in some library, but could not find
 one. Also, I'd rather not heavily change the code (i.e. monadic
 threads are not really an option here, and a small function would be
 appreciated).
 
 Extra points if your solution also works with js_of_ocaml! :)

This looks very similar to a question I asked a few years ago. You can read 
these threads [1,2]. 

I'm afraid but I think there's little hope that you'll find what you are 
looking for (but I'd love the proven wrong). 

Best,

Daniel

[1] https://groups.google.com/d/topic/fa.caml/lga2GNq3n7U/discussion
[2] https://groups.google.com/forum/?fromgroups=#!topic/fa.caml/rwndTEzAWvE
  
** Gerd Stolpmann replied:

I think this is not possible without changes in the OCaml runtime -
what we would need here is an emulation of signals under Windows, so
that a timer thread could be started that finally sends the signal to
the compute thread. However, such an emulation would be limited to
pure computations, and would not be able to interrupt system calls (no
support from Windows).

As long as you know that your compute functions allocate memory, it
will do garbage collections, and you could set a GC hook:

exception Timeout

let timer tmo f x =
  let t0 = Unix.gettimeofday() in
  let alarm = ref None in
  Gc.major();
  try
let al =
  Gc.create_alarm
(fun () -
   let t1 = Unix.gettimeofday() in
   if t1 -. t0  tmo then raise Timeout
) in
alarm := Some al;
let r = f x in
Gc.delete_alarm al;
alarm := None;
Some r
  with Timeout -
( match !alarm with
| Some al - Gc.delete_alarm al
| None - ()
);
None

But this does not work if the function does not allocate enough memory
(and also note that there are several race conditions in timer).

 Extra points if your solution also works with js_of_ocaml! :)

I don't think that there is any support in js_of_ocaml for completely
asynchronous events (i.e. something like the regular check for signals
the standard runtime does).
  
** Samuel Mimram then added:

Thanks for all your answers! I really appreciated the Gc.create_alarm
hack, which does the job alright for now, but is quite imprecise. I
have submitted a feature request for addition to the standard library
[1], we'll see...

Cheers,

Samuel.

[1] http://caml.inria.fr/mantis/view.php?id=5908
  

3) omonad-0.0.1
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00172.html

** Wojciech Meyer announced:

I'm pleased to pre-release a small syntax extension for monadic programming
called omonad.

The major difference between omonad and pa_monad[_custom] is that omonad
does not use Camlp4 and is based on -ppx flag implemented on the current
trunk of the toolchain.

The monadic code can look like this:

  let compute c =
Exception.(perform begin
  a -- return (1+2);
  b -- return (a+4);
  return (b + a * c)
end)
  in
  let computation =
Exception.(perform begin
  a -- compute 10;
  b -- return (a - 37);
  c -- (perform begin
 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-01-22 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of January 15 to 22, 2013.



1) beta-release of OPAM
2) Stog 0.6 is out
3) Hash function: complexity and circular structures
4) sedlex = ulex without camlp4
5) Fan, a promising replacement of camlp4
6) Job offer on formal methods (fixed term contract)


1) beta-release of OPAM
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00073.html

** Thomas Gazagnaire announced, spawning a huge thread:

I'm very happy to announce the beta release of OPAM (0.9.1). OPAM is a 
package manager for OCaml to install libraries and tools from source 
archives. It supports multiple simultaneous compiler installations, flexible 
package constraints, and a Git-friendly development workflow.

The goal of this beta release is to formally introduce OPAM to the community, 
to gather some general feedback on the documentation and tools and 
double-check that we've not forgotten some useful features. I would also like 
to use that opportunity to make an official call to maintainers: if you have 
developed packages which are already in OPAM do not hesitate to claim their 
ownership and to improve their description - if your packages are not yet in, 
it's time to start packaging them! 

OPAM is developed by OCamlPro[1] and has been in alpha release since June 
2012. It is already quite mature and has gained some nice momentum (+40 
contributors, +300 packages). OPAM has been initially funded by Jane 
Street[2] and the DORM EU research project, and it has received continuous 
help and resources from OCamlLabs[3].

The source code of OPAM is available on Github:
* installer: https://github.com/OCamlpro/opam
* packages and compiler descriptions: 
https://github.com/OCamlPro/opam-repository
* website: https://github.com/OCamlPro/opam2web

The documention:
* install instructions and tutorial are available http://opam.ocamlpro.com/
* the main source of documentation is 'opam --help' or 'opam command --help'
* user manual: 
https://github.com/OCamlPro/opam/raw/master/doc/dev-manual/dev-manual.pdf

You can report issues on github bug tracker:
* https://github.com/OCamlPro/opam/issues

The next steps for us is to focus on improving the package descriptions 
quality and the global consistency of 
https://github.com/OCamlPro/opam-repository. We will gladly accept any kind 
of help and support from the community to do this! We plan to announce the 
release of 1.0.0 in a couple of months, with improved package quality and 
better integration with the future OCaml platform.

Last point, if you are working in a company and that you already use OPAM, or 
plan to use OPAM, and you would like to help us ensuring it a sustainable 
future[2], you can contact us at 
contact AT ocamlpro.com.


On behalf of the OPAM team,
Thomas Gazagnaire

[1] http://www.ocamlpro.com/
[2] http://www.janestreet.com/
[3] http://www.cl.cam.ac.uk/projects/ocamllabs/
  
** Anil Madhavapeddy then added:

If you're using Homebrew on the Mac, just do a brew update and you should 
get the latest beta release (0.9.1) via it. Enjoy!
  
** Thomas Gazagnaire also added:

To people already using OPAM, I forgot to mention that it is highly 
recommended to NOT upgrade opam using opam. The auto-update thing was a 
mistake at the first place. It is also advised to start from a fresh opam 
init. It should work if you don't, but it would definitely avoid some 
confusions in some corner-cases.
  
** Alan Schmitt asked and Fabrice Le Fessant replied:

 I'm thinking of trying it, but there was a bit of information I could
 not find on the web page: where does OPAM puts the things it compiles?
 Is it easy to just try it with an existing installation of ocaml 
 libraries?

OPAM installs everything in ~/.opam by default, so it won't pollute
your current installation of OCaml. You have to use:

eval `opam config -env`

in a terminal to start using the version of OCaml installed by OPAM
(you can put that in a .bashrc file, for example).
  

2) Stog 0.6 is out
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00095.html

** Maxence Guesdon announced:

It is my pleasure to announce that Stog 0.6 is available from
http://zoggy.github.com/stog/install.html

Stog is a kind of Jekyll in OCaml: It is a static web site generator,
able to handle blog posts as well as regular pages.
  

3) Hash function: complexity and circular structures
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00113.html

** Jean-Baptiste Jeannin asked and Nicholas Lucaroni replied:

 The 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-01-15 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of January 08 to 15, 2013.

1) Batteries 2.0.0 released
2) wrap/unwrap some OCaml code in Emacs
3) some beautiful OCaml code
4) PG'OCaml 1.7
5) FoCaLiZe 0.8.0
6) new meetup: OUPS - Ocaml Users in PariS and OPAM Party
7) ilist-0.1.0 - indexed lists
8) Propagating types to pattern-matching
9) Other Caml News


1) Batteries 2.0.0 released
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00025.html

** Edgar Friendly  announced:

Batteries 2.0.0 is now available for general consumption. After years
of having to put up with the oddity that is Batteries_uni and the
issues with Camomile's data files, the Batteries Included Team is
proud to break backwards compatibility and release version 2.0.0 to
fix these.

Now free of any camlp4 and made of 100% pure OCaml with no external
dependencies, batteries is easier to build and better than ever.

A complete list of API incompatible changes and new additions is
available at
https://github.com/ocaml-batteries-team/batteries-included/wiki/Interfacechanges12
and the new documentation is online at
http://ocaml-batteries-team.github.com/batteries-included/hdoc2/index.html

Download from ocamlforge at
https://forge.ocamlcore.org/frs/download.php/1096/batteries-2.0.tar.gz
  

2) wrap/unwrap some OCaml code in Emacs
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00031.html

** Francois Berenger asked and Gaius Hammond replied:

 Anyone has something to recommend in order to do this in Emacs for OCaml 
 code?
 
 The use case is you have a big file and you only want to only see the
 code of a few functions and only the first line for other functions.

Code folding, this is usually called. See 
http://gaiustech.wordpress.com/2010/09/20/code-folding-in-emacs/
  

3) some beautiful OCaml code
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00032.html

** Francois Berenger said:

The code is here:

https://raw.github.com/orbitz/blog_post_src/master/intro_return_t/ex5.ml

There is a full blog post about it there:

http://functional-orbitz.blogspot.se/2013/01/introduction-to-resultt-vs-exceptions.html

Regards,
F.

PS: I'm not the author of this beauty
  
** David Mentre asked and Malcolm Matalka replied:

 Regarding this blog post, the final code is using Polymorphic Variants
 (http://caml.inria.fr/pub/docs/manual-ocaml/manual006.html#toc36).
 E.g.
 
 | _ -
 Error (`Bad_line s)
 

 I never fully grasped polymorphic variants compared to regular ones
 but I always had the feeling the polymorphic variants where less safe
 that variants because they would allow more possibility to mix
 unrelated things[1].

 Are the use of polymorphic variant mandatory to write code
 Return-Value-style code or can regular variants be used?

 Best regards,
 david

 [1] Of course this ability is the very thing that is of interest to
 people using polymorphic variants.

Hey, author here,

The problem polymorphic variants are solving here is that if you want to
sequence unrelated functions but return their errors, you have to join
their return types with the return types of the function that is calling
them. Polymorphic variants basically do this for you without every
function defining its own error return variant.

This, so far, is the only time I have found polymorphic variants the
best solution for a problem in Ocaml.
  
** Gerd Stolpmann also replied to David:

 I never fully grasped polymorphic variants compared to regular ones
 but I always had the feeling the polymorphic variants where less safe
 that variants because they would allow more possibility to mix
 unrelated things[1].

That's exactly the point: Polyvariants allow you to mix unrelated
things. I don't think, though, that they are unsafer, because you get
help from the compiler to keep these things nevertheless separated.
You need to be aware what can happen, and here and there it is helpful
to add a type hint or a coercion to control typing.

 Are the use of polymorphic variant mandatory to write code
 Return-Value-style code or can regular variants be used?

No. You can also use normal variants, but of course you need then a
declaration like

type error = Bad_line of string | Bad_name of string | ...

before using it. Also, function composition can be very painful.
Imagine you wrote two modules M1 and M2 in this style, and each module
defines an error type. Now you want to call functions from both
modules at one place, and run into the problem that you get [Error e1]
values with [e1:M1.error_type] 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-01-07 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of January 01 to 08, 2013.

1) new OPAM command-line interface
2) Cmdliner / Uutf / Uunf / Uucd minor releases
3) Building a GADT from an untyped representation
4) ODT 2.3 released
5) Other Caml News


1) new OPAM command-line interface
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg2.html

** Continuing this old thread, Thomas Gazagnaire announced:

Just to let people know that I've taken into account most of the remarks 
(even if I still have few changes to do) so I've merged the cmdliner branch 
into the main tree. Please use the master branch now for testing.
Also, due to an unfortunate sequence of actions (see [1]) all previous 
release of OPAM will likely not compile from source anymore because an url 
change. To fix this, I've release 0.8.3, so packager should upgrade ASAP 
(this is already available in homebrew for OSX users). 0.9.0 should also be 
released quite soon, I'm fixing the few remaining blocker bugs that showed 
off before christmas.

Regards,
Thomas

[1] https://github.com/OCamlPro/opam/issues/347
  

2) Cmdliner / Uutf / Uunf / Uucd minor releases
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg9.html

** Daniel Bünzli announced:

The following packages were updated. 

# http://erratique.ch/software/cmdliner v0.9.3
- Allow user specified SYNOPSIS sections.

# http://erratique.ch/software/uutf v0.9.2
- utftrip, better tool help. 
- Fix Uutf.is_uchar always returning false. 
Thanks to Edwin Török for reporting and providing the fix and test.

# http://erratique.ch/software/uunf v0.9.1
- Updated for Unicode 6.2.0. 
- Fix Uunf.is_scalar_value always returning false. 
- Make the module completely safe for the client. 
- Change command line help of unftrip.

# http://erratique.ch/software/uucd v0.9.2
- Updated for Unicode 6.2.0.
- Fix Uucd.is_scalar_value always returning false.
  

3) Building a GADT from an untyped representation
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg4.html

** Philippe Veber asked:

Suppose I define a GADT for expressions:

type _ expr = 
| Int : int - int expr 
| Float : float - float expr

Now I want to write a parser, that will build an ['a expr] from a
string. Without thinking much, I tried the following:

let parse_expr : type s. string - s expr = fun x - 
  try Int (int_of_string x) 
  with _ - 
Float (float_of_string x)
;;

Which fails with the following error message:

Error: This _expression_ has type int expr but an _expression_ was
expected of type s expr

That makes sense, since [s] is a locally abstract type. I tried a
couple of variants and finally realised that I could not even write
the type of [parse_expr]: it should be [string - 'a expr] for some
['a], but I'm not sure that really means something.

So to put it simple, how does one construct a GADT value from a string ?
  
** Later in the thread, Tiphaine Turpin suggested:

I don't think that you can achieve what you are you are asking
exactly, unless ressorting to an existential type. You can do it using
GADT too, as described in the existential types section of

https://sites.google.com/site/ocamlgadt/

For your example, you can write:

type any_expr =
  | Expr : _ expr - any_expr
;;

let parse_expr x =
  try Expr (Int (int_of_string x))
  with _ -
Expr (Float (float_of_string x))
;;
  
** Jeff Meister then said and Jeremy Yallop replied:

 However, by using an existential type like that, you're losing the
 additional type checking benefits of GADTs. The return type of parse_expr is
 now any_expr, not 'a expr. You can write e.g. the function extract_int_value
 : int expr - int, where OCaml knows you don't need to match the Float case,
 but you'll never have an int expr to pass to this function, at least not as
 a result of parsing. Anything handling a parsed any_expr must match the Expr
 case, which of course can have any expr inside. At this point, it seems like
 just a cumbersome way to write the traditional expr type.

 I went through basically this same thought process while trying to
 understand how I could apply the new OCaml GADT features, and I concluded
 that GADTs weren't providing any extra utility in the case where they must
 be constructed by parsing an input string. That's a shame since parsing and
 transformation is such a canonical use of OCaml, so I would love to be
 proven wrong here!

The good news is that you can still enjoy the benefits of GADTs, even
when you need to construct values at runtime whose types 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2013-01-01 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of December 25, 2012 to 
January 01, 2013.

Happy new year!

1) C interop: Return values in parameters
2) Other Caml News


1) C interop: Return values in parameters
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-12/msg00172.html

** Marek Kubica asked and Török Edwin replied:

 I am trying to wrap a C library in OCaml but I don't know how to do
 this particular thing:
 
 I have a library that looks roughly like this:
 
 int function(void** ptr);
 
 So I get an int as return value to show whether the function succeeded
 and it *sets* the ptr.
 
 void* ptr;
 function(ptr);
 // ptr is different now
 
 How can I wrap such a function in OCaml?
 When I call my OCaml wrapper
 
 let retval = function ptr in
 ...
 
 the pointer does not get updated. Is there a function in the C API to
 force OCaml to update the values?

Use a 'yourtype ref' for the parameter (or a record with a mutable field) 
on the OCaml side,
and you can update the field on the C side then.

Or if your C type is not actually void*, and your C function doesn't have 
side-effects (besides updating ptr)
you can also make the OCaml function return the actual value, and raise an 
exception if the function failed.
  
** Marek Kubica then said and Gabriel Scherer replied:

 Use a 'yourtype ref' for the parameter (or a record with a mutable
 field) on the OCaml side, and you can update the field on the C side
 then.

 I was thinking about the same thing and checked

 http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php
 and
 http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html

 and couldn't find how to modify a ref value from C.

 My code looks like this:

 CAMLprim value ost_read_next_header(value archive, value entry)
 {
 struct archive* handle = (struct archive*)archive;
 struct archive_entry* ent = (struct archive_entry*)entry;
 printf(ent: %p\n, ent);
 int retval = archive_read_next_header(handle, ent);
 // ent changed
 printf(ent: %p\n, ent);
 entry = (value)ent;
 return Val_int(retval);
 }

 And the second parameter is defined as entry ref, yet when I look at
 the resulting value from OCaml, the ref's value did not change:

 let entry = ref (Archive.entry_new ()) in
 Archive.print_pointer !entry;
 ...
 ignore (Archive.read_next_header handle entry);
 Archive.print_pointer !entry;

 It still points to the same value that my Archive.entry_new returned.

 Or if your C type is not actually void*, and your C function doesn't
 have side-effects (besides updating ptr) you can also make the OCaml
 function return the actual value, and raise an exception if the
 function failed.

 I thought about this, but I have a number of these functions and some
 have more than one return parameter, so I'd need to return a tuple at
 least. I plan to make this wrapper as close to C and low-level, so I
 can write a proper high-level wrapper on top.

 If the ref-appoach does not get me anywhere, I might still do this.

References are a derived concept defined as:

type 'a ref = { mutable contents : 'a }

You can update them from the C side just as you would handle a
polymorphic record, with Field and Store_field.

In the code you show, the OCaml value corresponding to the pointer is
exactly the pointer, hidden as a 'value' type. This is correct as
OCaml detects out-of-(OCaml)-heap pointer. However, if you used a
custom block instead (
http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html#toc150
), OCaml would do the boxing for you: Data_custom_val(v) already
returns a pointer than can be dereferenced or mutated.

I think you have a choice between using references explicitly for
those functions of the API that mutate input references, or uniformly
representing this type of data as a custom block. The latter option
may be valuable if you have uses for the other features of custom
blocks, eg. the user-defined comparison and finalization operations,
and probably not worth the trouble otherwise. Finally, explicitly
using references to signal mutability in some part of your API is
probably clearer and a better design.
  

2) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocaml.org/.

Singleton types for code inference, continued:
  
http://gallium.inria.fr/~scherer/gagallium/singleton-types-for-code-inference-2

Singleton types for code inference:
  
http://gallium.inria.fr/~scherer/gagallium/singleton-types-for-code-inference

Macaque 0.6.1:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=867
  

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-12-25 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of December 18 to 25, 2012.

Merry Christmas!

1) new ocaml.org website
2) OCaml wiki
3) OCaml search into libraries for ocaml.org
4) Post-doc/Software Engineer at OCamlPro
5) Other Caml News


1) new ocaml.org website
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-12/msg00070.html

** Ashish Agarwal announced:

We are pleased to announce that a new website for the OCaml community
is now live at http://ocaml.org. Please get in the habit of referring
to this site instead of caml.inria.fr as our goal is to port all
content to the new site (most has already been done but a few pages
remain).

You can contribute by forking the github repo:
[1] https://github.com/ocaml/ocaml.org
  

2) OCaml wiki
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-12/msg00095.html

** Wojciech Meyer asked, spawning a huge thread:

These days ocaml.org is a great resource and starting point for the
community and people interested in learning OCaml. It would be great
however if we have a collective wiki for OCaml too. Not being here at
any rate competitive and just complementary.

It could cover:
- using core toolchain
- tooling like Oasis, OPAM, ocamlfind, ocamlbuild etc.
- type system tricks
- small projects with good code examples
- tools settings, emacs  vim configuration snippets
etc.

it should be searchable, and fairly centralised.

What kind of wiki engine we would like to use?

I'd just opt either for oddmuse, mediawiki perhaps with some movement
towards custom one based on Ocsigen and Eliom, but here I don't have any
strong opinions, feel free to propose anything else.

Separate issue is storage and server etc., I'd happily organise/discuss
these things, once we know the details :-)

I'm open for any ideas and people joining up with the effort.
  
** Benedikt Meurer suggested and Anil Madhavapeddy replied:

 Why not use the wiki provided by Github for the ocaml.org project?

That works too; Thomas has written a Github Markdown to HTML converter in
COW [1], and is using that to generate the OPAM website from the Github
wiki (for the documentation that you see on http://opam.ocamlpro.com).

[1] http://github.com/mirage/ocaml-cow
  
** Vincent Balat suggested:

We have been using our home-made (Eliom based) wiki for years on
http://ocsigen.org and http://www.pps.univ-paris-diderot.fr and it is
probably a good candidate for ocaml.org. The project is called
Ocsimore (see http://ocsigen.org/ocsimore ).
 
You can test it on page:
https://ocsigen.org/sandboxwiki/
 
Log in with user test, password test.
 
and see the manual for the syntax here:
https://ocsigen.org/ocsimore/dev/manual/wiki
 
This wiki is somewhat different from all others, but has very
interesting features that may be useful for ocaml.org:
 
* you can mix static pages and wiki pages: if the static page is
present, it will be sent, otherwise the wiki page is displayed. It is
possible for example to keep the current web site and add
progressively new pages using the wiki.
 
* you can create several wikis on the website, corresponding to
different rights. For example http://ocsigen.org/devarea/ is a wiki
restricted to ocsigen's developers.
 
* There is no default page container, and no default stylesheet: each
wiki has its own container, common to every page of the wiki, that is
itself written using wiki syntax. Editing the container requires
special rights.
 
* CSS are also edited online (by the users who have the right for
this)
 
* You can create CSS for the whole wiki or specific CSS for some pages
 
* The base component of the wiki is not the page, but the wikibox
Each page (and each wikibox) can contain several wikiboxes, and a
wikibox may appear on several pages
 
* Each wikibox can be given specific rights (read/write/see
history/change CSS...)
 
* Each wikibox may itself be a container. For example if you want a
menu common to several pages.
 
* The wiki syntax is following the wikicreole standard, with some
additions. The goal is to have most the possibilities offered by HTML.
All the pages from the websites mentioned above are written with this
syntax.
 
* It is possible to write extensions to the wiki syntax. For exemple we have
code language=ocaml| ...  to display OCaml with syntax highlighting.
 
 
Ocsimore also has a forum module (for messages/comments) but it is
still beta.
 
Ocsimore is conceived to be extensible and very customisable (even if
it requires to understand a complex piece of code). It has very
powerful right managements.
 
We never announced/released Ocsimore yet because there are still a lot
of work to do to improve user friendliness. But things improved a lot
in the 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-11-06 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 30 to November 06, 
2012.

1) Why should I use .mli files?
2) Functional programming users group in Cambridge, UK (free beer!)
3) Writing the function Set.map using first-class modules and 4.00 inference
4) Bisect 1.3 release
5) OCaml interpreter in JavaScript
6) Other Caml News


1) Why should I use .mli files?
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-11/msg5.html

** Deep in this thread, Jacques Garrigue explained:

Wow.
I see that a big debate is going on mli files and declarations
inside ml files.

I think that lots of people have given this problem a lot of thought
during many years.
My conclusion has unfortunately been that trying to solve this at
the language level without breaking backward compatibility is
very difficult.

For instance, one is currently allowed to do something like that:

a.ml:
let f x = x

let b = f true

a.mli:
val f: int - int

This may look stupid, but this kind of code (of course more
complicated) exists in the wild, and sometimes for sensible
reasons.
For this kind of reason, I do not see any easy way to import
information from mli files to ml files.

Now, is maintaining mli files really painful?
In my experience, not at all.
Taking as example the ocaml compiler itself, the only
duplication that bothers me a little is the error type exported
by many modules, as one always has to keep it in sync by
copy-paste. This is a bit of a problem because for most uses
this type could be abstract (you don't really care about its
contents), but in some rare occasions you need it public.
For other types, do not see syncing as a disadvantage, because
it rather makes you conscious that other modules depend on
this type, so better look at it twice :-)

Of course I know that some people (probably with a different
background) do not like mli files.
Couldn't we just imagine a preprocessing tool that allows to
generate both ml and mli from the same file?
This is pretty standard for literate programming.
It could even call the compiler if you want the types to be inferred
automatically (even though I personally think that having to write
value types in the mli file is good, because you know when you
are changing an export.)
As an external tool, it could use pragmas (keywords inside
comments) for instance.
Something close to ocamldoc (ocamldoc itself?) but which you
would integrate in the compilation cycle.

Anyway, I just wanted to state, from my experience, my lack of
enthusiasm about modifying the core language to accommodate
that.
  

2) Functional programming users group in Cambridge, UK (free beer!)
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-11/msg8.html

** Mike McClurg announced:

We're starting a functional programming group in Cambridge, UK, called
NonDysFunctional. We're having our first meet up this Friday from 5pm
to 9pm at the Old Spring Pub. Feel free to come at any time during
that window. Citrix has kindly offered to pay for everyone's beer, so
come thirsty!

See our website for more information, including a map to the Old
Spring: http://nondysfunctional.wikidot.com/blog:2

Also, we will be tweeting about future events on @nondysfun
(https://twitter.com/nondysfun)

If you think you might come, please email me, just so I have an idea
of how many people might turn up. You don't have to register in order
to come, however. Hope to see you there!
  
** He later added:

We had a successful meeting last Friday for our first Cambridge
functional programmers meetup. As requested by those who turned up,
I've created a meetup group to help us organize. If you are
interested, please join here:

http://www.meetup.com/Cambridge-NonDysFunctional-Programmers/

We're probably going to have another meeting in early December. It
will probably just be another pub meetup. If you've got any requests
for dates or for particular pubs, please let me know.

Now that we've got an online home at meetup.com, I'll avoid spamming
this list with future announcements.
  

3) Writing the function Set.map using first-class modules and 4.00 inference
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-11/msg00011.html

** Jeff Meister said:

I found an interesting (to me, anyway) use of OCaml's first-class
modules, and particularly the new 4.00 type inference features, which
I thought was worth sharing with the list. This has probably been
observed by someone else already, but I haven't seen it discussed.

In the OCaml standard library, the polymorphic set data structure 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-10-30 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 23 to 30, 2012.

1) OCaml-bitcoin 1.0
2) Bolt 1.4 release
3) opam and versions
4) Other Caml News


1) OCaml-bitcoin 1.0
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00151.html

** Dario Teixeira announced:

OCaml-bitcoin is a library offering an OCaml interface to the official
Bitcoin client API. It works by making JSON-RPC calls over the network
to a running Bitcoin daemon offering the client API. The project's
homepage can be found here:

http://ocaml-bitcoin.forge.ocamlcore.org/

Bitcoin has been a controversial subject, to say the least. With this
in mind, I've written a blog post that hopefully clarifies my view on
the subject. It also contains some technical information concerning
the implementation of OCaml-bitcoin:

http://nleyten.com/post/2012/10/24/Announcing-OCaml-bitcoin-1.0

To summarise: the release of this library should not be construed as
an unconditional support of Bitcoin in its current form. There is
enough potential in the idea, however, to warrant some guarded
support.
  

2) Bolt 1.4 release
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00189.html

** Xavier Clerc announced:

This post announces the 1.4 release of the Bolt project, whose goal is
to provide a comprehensive yet flexible logging framework for the
OCaml language.

Home page: http://bolt.x9c.fr

Main changes since 1.3:
- API change: introduction of modes, allowing to choose when data is written
- API change: updated support for Pajé format (version 1.2.3)
- support for '' and '||' in filters (new configuration format only)
- new 'minimal' layout using only message
- new 'bell' output writing the bell character on the standard output
- new 'say' output using MacOS X text-to-speech
- support for Growl under Windows
- bug#86: '-ocaml-prefix' doesn't really work
- bug#87: install shouldn't build anything
- bug#89: do not activate warnings by default
- bug#105: crashes with 'Not_found' when both BOLT_FILE and BOLT_CONFIG are not 
set
- bug#107: when using syntax extension with level NONE, preprocessed code
  

3) opam and versions
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00198.html

** Jon Ludlam asked and Thomas Gazagnaire replied:

 For our purposes, we need to be able to ensure that our builds are
 reproducible, and hence need to know exactly which versions are installed.
 We had hoped to achieve this by removing or disabling packages whose
 sources were got directly from a master branch in github. However, it turns
 out that some packages that are 'stable' are dependent upon these packages,
 which seems brittle. The question is how to fix it? Should the opam
 repository maintainers require that 'stable' packages aren't dependent on
 'unstable' ones? Should opam itself be aware of the difference and enforce
 this policy? If someone really wants to release a stable version of their
 thing and it's dependent upon an upstream project with only a github repo,
 should the developer engage the upstream devs and request at least a tag,
 or should they make their own tarball/github fork?

Before the 1.0 release my plan is:
* to remove the unstable packages in the main opam-repository (ie. every
packages should have a stable tarball with a fixed checksum) [1]
* add a way to specify commits/branches for unstable packages if needed. [2]

The current workaround is, as Anil pointed out, to clone opam-repository, use
'opam-mk-repo' at its root to generate a local mirror of opam.ocamlpro.com,
and tell opam to add the local repository as a remote: 'opam remote -add
local /path/to/your/local/repository'

Then 'opam remote -list' should display the list of repositories and their
respective priority (higher is better). You can also tweak ~/.opam/repo/index
manually to tell opam to use your local repository only for some packages,
for instance the unstable ones (don't forget to run 'opam update' after
changing the index file).

For [1], I'm gladly accepting external contributions (for [2] as well
actually if someone really wants to hack into opam).

--
Thomas

[1] https://github.com/OCamlPro/opam-repository/issues/171
[2] https://github.com/OCamlPro/opam/issues/267 
  

4) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-10-23 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 16 to 23, 2012.

1) Silicon Valley
2) llpp v13
3) OCaml Labs
4) GODI news
5) opam and versions
6) Ocuality v0.8
7) Parameterizing a function with a thread monad
8) Other Caml News


1) Silicon Valley
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00087.html

** Mike Lin asked and William Le Ferrand replied:

 I'm curious what kind of critical mass there might be for an OCaml
 meetup/UG in Silicon Valley. Who's around? Has this been tried/failed
 before?

There used to be OCaml dinners in bay area, 3 or 4 were organized
about 1 year ago. At some point we even held a little hackathon
resulting in a small website for posting ocaml challenges (code should
be at https://github.com/baoug), now deceased.
  
** Ashish Agarwal then added:

Mike, I suggest you just start a group on http://meetup.com. We've
had good success with the NYC OCaml Meetup (and it's not just because
of Jane Street, indeed most of our members are not from Jane Street).
The hard work is in recruiting speakers to give talks, organize
hack-a-thons, etc., but it only takes a couple committed people to
make it work.

And once you start it, be sure to let the http://ocaml.org dev team
know so we can add it to the new website under the Meetings section.
  

2) llpp v13
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00090.html

** malc announced:

New version of llpp (tagged v13) is now available at
http://repo.or.cz/w/llpp.git

Blurb:

llpp a graphical PDF viewer which aims to superficially resemble
less(1)

Changes:
* Bugfixes
* Presentation mode in multi column case
  

3) OCaml Labs
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00098.html

** Yaron Minsky announced:

A thing that should be of interest to many on this list. We discussed
this already at the OCaml Users and Developers conference, but we're
now talking about it more widely: a new lab is being formed at
Cambridge University that is focused on improving the OCaml ecosystem.
Jane Street is the primary funder, and Anil Madhavapeddy is the
technical lead.

If you're interested in reading a bit more about it, both Anil and I
have posts about it:

- https://ocaml.janestreet.com/?q=node/109
- http://anil.recoil.org/2012/10/19/announcing-ocaml-labs.html

We hope and expect this effort to add to the energy and excitement of
the OCaml community, and to contribute materially to the software
infrastructure we all depend on.
  
** Paolo Donadeo asked and Anil Madhavapeddy replied:

 While I'm very grateful for your effort and while anxiously waiting for
 your book, I notice that in your post you mention a brand new package
 manager, OPAM.

 Do we really need of yet another package manager? How can't OPAM scatter
 the community further?

 Now, if I write a small library and I want to make it available to OCaml
 developers, I have to care about: making the source code Debian and Red Hat
 friendly, godi friendly, oasis-db friendly and, now, OPAM. And there are
 probably other systems I don't even know.


This is certainly a valid criticism given the current state of affairs,
but I would encourage you to listen to Thomas' talk to OUD to get an
overview of why OPAM came about, and where it's going:
http://www.youtube.com/watch?v=ivLqeRZJTGs

OPAM has picked up lessons from all the other previous package managers,
and is, as Markus noted, a generally pleasant experience for beginners to
use. It supports a nice workflow for developing libraries, has
first-class support for multiple repositories (either DVCS or local
archives), and simultaneous installations of multiple standard libraries.

Just this by itself probably wouldnt justify a brand new package manager,
and the longer term plan is tighter integration with OASIS, ocamlbuild and
the many other build systems available. Ultimately, we want to make it
really easy for a beginner to jump in, write their own code, reuse other
peoples code, and publish it online. There have been a number of (very
brave and good) pieces of this puzzle over the years (notably OASIS), but
OPAM aims to pull them all together into an integrated whole.

You'll see much more of this in the next few months as OCaml Labs spins up
and begins supporting OCamlPro more in their efforts. The first thing
we're doing is to get the ocaml.org infrastructure in place (and moving
over the excellent ocaml-lang.org over to the new domain), and part of
that work will be to figure out the unification of OASIS-DB, OPAM and
other package 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-10-16 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 09 to 16, 2012.

1) Improved syntaxic coloration
2) Godi for Windows
3) Parmap package in OPAM
4) Fan hosted on github now
5) Other Caml News


1) Improved syntaxic coloration
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00043.html

** Lilian Jean BESSON announced:

I'm publishing today some files to improve syntaxic coloration for
OCaml sources (.ml .mli) using the GTK SourceView library.

Gedit and Gobby are popular text editor which use GTK SourceView for
syntaxic coloration, and my two files (ocaml.lang and naereen.xml are
in the archive sent with this email) can be used with them to give you
one of the best OCaml sources syntaxic coloration ever !

If you are not yet conviced, take a look at my page
https://sites.google.com/site/naereencorp/tools/gtksourceview (those
file are also attached to the message), which aims to show some of
improvement done by my modifications. Detail concerning installation
and personalisation of the color profile naereen.xml are given there
(sorry for non-french users, this page is not yet translated in
english). Some improvement are steel experimental, like OCamlDoc
format balises in ocamldoc comments.

Moreover, the language file ocaml.lang can give ideas to improve the
other popular syntaxic coloration solutions : VIM, Emacs, PyGmentize,
nano, caml2html, or also Jota Text Editor for examples.

If those two files appears to be useful for one of you, I'll send
theme to GTK SourceView developpers, hopping they will be include in
the next versions of GTK SourceView 2 and 3.
  

2) Godi for Windows
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00044.html

** Andreas announced:

This post announces the creation of a godi distribution for windows.

Wodi differs from the official godi distribution in the following
ways:

- it ships binary packages for windows (32- and 64-bit builds). You
don't need to compile ocaml and often used libraries from source. For
convenience, there are also packages for often used external
c-libraries (pcre, tcl/tk, gmp, gtk, ... ).

- a gtk-based gui for package management that hides the cygwin shell
and the godi console from casual users.

- patched source packages and build instructions for windows.


More details: http://wodi.forge.ocamlcore.org/
  
** Deep in this thread, Andreas said and Edgar Friendly replied:

 godi-zip is indeed broken. I've updated godi-zip to version 1.05 and
 hopefully fixed it.

On this note, I realize that I have not announced to this list that
camlzip has released version 1.05 with findlib support (and an
official findlib package name). There are no changes to the library
code, just an extra line in the makefile for installing with findlib
and a simple META file.
  

3) Parmap package in OPAM
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00045.html

** Francois Berenger announced:

For those living on the edge of source-based installers
for OCaml software and libraries, this e-mail
is just to let you know that a Parmap package is
available in the OPAM repository
(https://github.com/OCamlPro/opam-repository).

Thanks to Thomas Gazagnaire, Roberto Di Cosmo
and maybe others who contributed!
  

4) Fan hosted on github now
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00048.html

** Bob Zhang announced:

I have moved Fan into github now (https://github.com/bobzhang/Fan).

What's Fan? We see that a lot of computer scientists are creating
languages to target their domain, but creating a language is itself a
domain, Fan is targeted at this domain. Yes, Fan is targeted to
compiler domains. Fan aims to make creating a language easier.

Fan is a successor to Camlp4, which was mainly developed by Daniel de
Rauglaudre and Michel Mauny, and later was largely renovated by
Nicolas Pouillard. Fan is way more faster than Camlp4, generally 100
times faster (bootstrapping using native version only takes 4s in my
machine) and Fan has a very robust bootstrapping system compared with
Camlp4. Fan has all the features that Camlp4 provides and much more.

Currently Fan is not usable, (so users should still stick to Camlp4
for one year or two) mainly because the API is un-stable, yet. But I
would be happy to hear feature request. I am open to pull request.

No documentation yet, but there's a link to the previous talk I gave

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-10-09 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 02 to 09, 2012.

1) OCaml 4.00.1 released
2) Macaque 0.6
3) Yypkg 1.6.0
4) Camlp5 6.07 compatible with OCaml 4.00.1 released
5) Mingw-builds 1.1 rc1
6) Other Caml News


1) OCaml 4.00.1 released
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00021.html

** Damien Doligez announced:

We have the pleasure of celebrating the birthdays of Denis Diderot
by announcing the release ofOCaml version 4.00.1.
This is mainly a bug-fix release, see the list of changes below.

It is available here: http://caml.inria.fr/download.en.html

This is released as source for the time being, but the binary
versions should be available soon.

We would like to take the opportunity to thank all the packagers
out there who make this easy to install for end users without
recompiling.

Happy hacking,

-- Damien Doligez for the OCaml team.


OCaml 4.00.1:
-

Bug fixes:
- PR#4019: better documentation of Str.matched_string
- PR#5111: ocamldoc, heading tags inside spans tags is illegal in html
- PR#5278: better error message when typing make
- PR#5468: ocamlbuild should preserve order of parametric tags
- PR#5563: harden Unix.select against file descriptors above FD_SETSIZE
- PR#5690: ocamldoc ... -text README raises exception
- PR#5700: crash with native-code stack backtraces under MacOS 10.8 x86-64
- PR#5707: AMD64 code generator: do not use r10 and r11 for parameter passing,
as these registers can be destroyed by the dynamic loader
- PR#5712: some documentation problems
- PR#5715: configuring with -no-shared-libs breaks under cygwin
- PR#5718: false positive on 'unused constructor' warning
- PR#5719: ocamlyacc generates code that is not warning 33-compliant
- PR#5725: ocamldoc output of preformatted code
- PR#5727: emacs caml-mode indents shebang line in toplevel scripts
- PR#5729: tools/untypeast.ml creates unary Pexp_tuple
- PR#5731: instruction scheduling forgot to account for destroyed registers
- PR#5735: %apply and %revapply not first class citizens
- PR#5738: first class module patterns not handled by ocamldep
- PR#5742: missing bound checks in Array.sub
- PR#5744: ocamldoc error on val virtual
- PR#5757: GC compaction bug (crash)
- PR#5758: Compiler bug when matching on floats
- PR#5761: Incorrect bigarray custom block size
  
** Hezekiah M. Carty then said:

Thank you for the new release! For anyone looking to build the new
release from source, ocamlbrew has been updated to install OCaml
4.00.1 by default:

https://github.com/hcarty/ocamlbrew

To give it a try with the default components (OCaml, findlib, odb.ml,
oasis, utop, ocamlscript) run the following in a terminal:

curl -kL https://raw.github.com/hcarty/ocamlbrew/master/ocamlbrew-install |
bash

That will build and install everything under $HOME/ocamlbrew. See
README.md and RECIPES.md at the link above for build requirements and
other configuration examples.
  
** Jonathan Protzenko also said:

The self-installer has been updated, it is available at
http://protz.github.com/ocaml-installer/. As usual, if you want to
help improve the installer script for Windows, I'll gladly accept any
patches.
  

2) Macaque 0.6
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-10/msg00023.html

** Gabriel Scherer announced:

Macaque is the result of a student project aiming to develop a
type-safe and composable way to interact with SQL databases from
OCaml. We propose a form of comprehension syntax that allow to
modularily create queries in a strongly-typed and relatively
principled way.

## Release 0.6

After a few years of mild continuous development, people have
requested at several occasions that release be made. I therefore tag
the current state of Macaque as 0.6.

You can get an archive from the forge:
https://forge.ocamlcore.org/frs/download.php/1027/macaque-0.6.tar.gz

You can also get the new version from darcs:
darcs get --tag 0.6 http://forge.ocamlcore.org/anonscm/darcs/macaque/macaque

Thanks to everyone I have interacted with during this development;
thanks to Vincent Balat and Anastasia Gornostaeva for their feedback.
Thanks in particular to Jacques-Pascal Deplaix for his frequent
feedback and occasional suggestions and contributions.


## More Details

Macaque was initially developed at the PPS lab in Paris, under the
supervision of Jérôme Vouillon. The current development mode could be
described as coinductive: things get done in reaction to user
requests or needs.

The technical limitations of Macaque are the following:

- It only support PostGreSQL (from lack of time to develop
other backends).

- Each feature of the SQL language must be considered and added
separately, 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-10-02 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of September 25 to October 
02, 2012.

1) release Javalib 2.2.2 and Sawja 1.4
2) OCaml-RDF 0.1
3) Ocamldap New Maintainer
4) Ocamldap 2.2
5) Other Caml News


1) release Javalib 2.2.2 and Sawja 1.4
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-09/msg00122.html

** Pierre Vittet announced:

We have the pleasure to announce a new release of Javalib and Sawja
(the Static Analysis Workshop for JAva).

Javalib and Sawja are libraries written in OCaml. Javalib parses Java
.class files into OCaml data structures. Sawja is relying on the
Javalib library, and providing a high level representation of Java
bytecode programs. Whereas Javalib is dedicated to isolated classes,
Sawja handles bytecode programs with their class hierarchy and control
flow algorithms. Sawja also provides some stackless intermediate
representations of code and static analysis tools that makes analyses
easier.

The main new feature of this release is the ability to use formulae.
It is a way to add information at the source code level which can then
be used in an analysis. It is useful, for example, to guarantee
assertions that cannot be found by the analyser or even to manage
structures/functions which are implicitly present in the code environment.

More information, examples, and a series of tutorials are available at
http://sawja.inria.fr. The Sawja devteam is looking forward to your
questions and feedback on the library.
  

2) OCaml-RDF 0.1
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-09/msg00123.html

** Maxence Guesdon announced:

It is my pleasure to announce the first release of OCaml-RDF:
http://ocaml-rdf.forge.ocamlcore.org/

OCaml-RDF is a native OCaml library to manipulate RDF graphs.
  

3) Ocamldap New Maintainer
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-09/msg00128.html

** Eric Stokes announced and Jacques-Pascal Deplaix added:

 Jacques-Pascal Deplaix is taking over the Ocamldap project. I've
 enjoyed working on it over the years, but no longer have time to
 devote to it. He will follow up with details.

For information for those interested, this release (2.2) is based on the
stable trunk (branches/OCAMLDAP_2_0).
The next release will be based on the main trunk, without the lasts
unstable commits (doesn't compiles since 2006).

Also, for information, the stable branch is under LGPL and the main
trunk in under LGPL with the special ocaml linking exception. So, the
next release will have the special ocaml linking exception.

The old svn repository:
* http://ocamldap.svn.sourceforge.net/viewvc/ocamldap/
  

4) Ocamldap 2.2
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-09/msg00129.html

** Jacques-Pascal Deplaix announced:

I'm happy to announce the version 2.2 of Ocamldap with the following changes:

 * OCaml 4 compatibility
 * Modularize the library in sub-libraries: ldap ldap.ldif ldap.toplevel
 * Use oasis
 * Repository cleaning
 * Maintainer changed (Thanks to Eric Stokes)
 * Switch from svn to git

The new repository is available at:

 * http://git-jpdeplaix.dyndns.org/libs/ocamldap.git/
 * https://gitorious.org/ocamldap/
 * https://bitbucket.org/deplai_j/ocamldap/

(Use the one you want)
  

5) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

Announcing Ohm, an OCaml Web Framework:
  http://www.nicollet.net/2012/10/announcing-ohm-an-ocaml-web-framework/

The Ocsigen cheatsheet:
  http://ocsigen.org/

Ocamldap:
  https://forge.ocamlcore.org/projects/ocamldap/

Delimited Overloading 0.8.15:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=858

Substitution is pullback:
  http://math.andrej.com/2012/09/28/substitution-is-pullback/

Programming Tools UX: When Statically Compiled Feels Dynamic:
  http://blog.opalang.org/2012/09/programming-tools-ux-when-statically.html

Jane Street at OUD:
  https://ocaml.janestreet.com/?q=node/108

OCaml Users and Developers slides and videos:
  
http://rwmj.wordpress.com/2012/09/26/ocaml-users-and-developers-slides-and-videos/
  

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-09-04 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of August 28 to September 04, 
2012.

1) xtmpl 0.2 and stog 0.2
2) Mascot 1.0 release
3) Kaputt 1.2 release
4) JoCaml 4.00.0 release
5) ocaml-lua v1.0: OCaml binding of Lua library
6) PROMELA library 0.4
7) ocaml-4.00.0 compilation problem with first class modules and optional 
parameters
8) hevea 2.00
9) Other Caml News


1) xtmpl 0.2 and stog 0.2
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00154.html

** Maxence Guesdon announced:

I'm happy to announce Xtmpl 0.2 is available from
http://zoggy.github.com/xtmpl
Xtmpl is a rewrite engine / templating library for Xml trees. This release
includes only minor changes.

I'm even happier to announce Stog 0.2, available from
http://zoggy.github.com/stog/install.html

Stog is a static multi-lingual web site and blog generator.
A lot of changes in this release, including: Processed files are now only
XML (no ad hoc format any more). The system is more flexible, more
convenient also. Documentation was updated accordingly.
  

2) Mascot 1.0 release
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00157.html

** Xavier Clerc announced:

This post announces the 1.0 release of the Mascot project, whose goal is to
provide a style-checker for OCaml sources.

Home page: http://mascot.x9c.fr

Main changes since 1.0-beta:
- support for checks based on binary annotations
- support for binary output mode, and report-only mode
- new code check: 'catch_all' to detect patterns catching all
exceptions
- new code check: 'code.ignore_unit' check to detect application of
'ignore' to expression whose type is 'unit'
- bug #72: allow punctuation after closing a block
- bug #74: handle the '::' operator
- bug #75: do not require whitespace after '?' used for optional label
- bug #76: do not require whitespace around '..' used for character
range
- bug #77: allow absence of whitespace before unary minus if previous
token is an opening one
- bug #79: treat '[ ... ]' and '[| ... |]' blocks like '{ ... }'
blocks
- bug #80: allow whitespace after '.' when used to introduce
polymorphic type
- bug #81: allow opening token after a label
- bug #84: use 'center' rather than 'p' tag with 'align' attribute,
and correct handling of icons
- bug #87: install shouldn't build anything
- bug #89: do not activate warnings by default
- bug #90: output available checks as a ready-to-use config
- bug #93: 'interface.duplicate' to detect duplicate entries in
signatures
- bug #94: do not require whitespace after colon
- bug #96: 'typography.trailing_white_space' now has a 'tolerance'
parameter in order to indicate how many whitespace characters may be
tolerated
- update for OCaml 4.00.0
  

3) Kaputt 1.2 release
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00156.html

** Xavier Clerc announced:

This post announces the 1.2 release of the Kaputt project, whose goal is to
provide a comprehensive testing framework for the OCaml language.

Home page: http://kaputt.x9c.fr

Main changes since 1.1:
- new 'Mock' module providing means of recording calls made to a function
- support for specification of partial functions (i. e. raising exceptions)
- preprocessor allowing to store tests in separated '.mlt' files
- removed deprecated functions
- update for OCaml 4.00.0
- bug#85: cmi file is not installed
- bugfixes to bigarray and nums support
  

4) JoCaml 4.00.0 release
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00163.html

** Luc Maranget announced:

It is my pleasure to announce the new release (4.00.0) of JoCaml.

JoCaml is the concurrrent and distributed extension of OCaml based upon
the join-caculus.

The new release follows OCaml evolution, it may be that the integration
of OCaml new features such as GADT and binary annotations is far
from perfect...


The new release is available from JoCaml web site:
http://jocaml.inria.fr/
  

5) ocaml-lua v1.0: OCaml binding of Lua library
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-09/msg0.html

** Paolo Donadeo announced:

I'm happy to announce the first release of ocaml-lua, the OCaml
binding of the Lua library. With ocaml-lua you can embed a Lua
interpreter in an OCaml program in a few lines of code, and 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-08-14 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of August 07 to 14, 2012.

1) postdoc positions at INRIA Saclay
2) extlib-1.5.3
3) Bisect 1.2 release
4) Bolt 1.3 release
5) Other Caml News


1) postdoc positions at INRIA Saclay
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00070.html

** Fabrice Le Fessant announced:

New postdoc positions at INRIA Saclay
OCaml performance, memory management and multicore

Job description:

We are currently looking for two one-year postdocs at INRIA Saclay[0],
to work on improving OCaml memory management, particularly in the
context of multicore systems. The candidate would contribute either to
the implementation of the OCaml runtime, to benefit from multicore
systems, or to the implementation of compiler optimizations and tools
to improve the performance of theorem provers, as part of the Bware
ANR project.

INRIA Saclay is one of the most recent units of Inria, the French
public institute of Computer Science. It is located close to Paris, on
the Campus of Saclay, colocated with the University of Paris 11 and
several of the best engineer schools in France (Ecole Polytechnique,
ENSTA, Supelec, etc.).

The Bware ANR project:

Bware is a project funded by the ANR (French Research Funding Agency),
to improve Atelier B [1], an industrial tool to efficiently deploy
the B method, developed by Clearsy. Bware will replace the current
solver used in Atelier B by new provers developed at INRIA
(Dedukti[2], Zenon[3], Why[4], Alt-Ergo[5]), most of them written in
the OCaml language. Part of the work will be to improve the
performances of these solvers, by implementing new compiler
optimizations in OCaml and taking benefit of multicore systems. Bware
is a project gathering both academic partners (CEDRIC, INRIA, LRI) and
industrial partners (Clearsy, Mitsubishi MERCE, OCamlPro).

Requirements:

Candidates should have a Ph.D. in Computer Science, and a previous
experience of both functional programming and system/compiler
development.

Application details:

To apply, or for more information, you can contact Fabrice Le Fessant
(fabrice.le_fessant AT inria.fr).
Applications should contain a detailed
CV, with a particular focus on the experience, both theoretical and
practical, that would be useful in the context of this postdoc.

[0] http://www.inria.fr/en/centre/saclay/
[1] http://www.atelierb.eu/en/
[2] http://www.lix.polytechnique.fr/dedukti/
[3] http://focal.inria.fr/zenon/
[4] http://why.lri.fr/
[5] http://alt-ergo.lri.fr/
  

2) extlib-1.5.3
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00088.html

** ygrek announced:

Just a short note to announce extlib 1.5.3 release for the sake of OCaml 
4.00 compatibility.
Get it at http://code.google.com/p/ocaml-extlib/
  

3) Bisect 1.2 release
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00093.html

** Xavier Clerc announced:

This post announces the 1.2 release of the Bisect project, whose goal is to 
provide 
a code coverage tool for the OCaml language.

Home page: http://bisect.x9c.fr

Main changes since 1.1:
- new '-combine-expr' to allow combination of results
- new 'dump' output mode (mainly for debug)
- new 'bisect' output mode (i. e. format of runtime data)
- new '-exclude-file' command-line switch to exclude toplevel functions
listed in a file
- update for OCaml 4.00.0
- bug #95: polymorphic recursion is not handled
- bug #104: configure script should be executable
  

4) Bolt 1.3 release
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-08/msg00094.html

** Xavier Clerc announced:

This post announces the 1.3 release of the Bolt project, whose goal is to 
provide 
a comprehensive yet flexible logging framework for the OCaml language.

Home page: http://bolt.x9c.fr

Main changes since 1.2:
- enhanced support for Daikon
- enhanced support for Pajé
- removed dependency upon 'Str' library
- API change: logger names now have type 'Name.t' rather than 'string'
- new configuration format (through 'BOLT_CONFIG' environment variable),
old format still available (through 'BOLT_FILE' environment variable)
- loggers are now stored in a tree, for better performances
- update for OCaml 4.00.0
  

5) Other Caml News

** From the ocamlcore planet blog:


[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-06-19 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of June 12 to 19, 2012.

1) cryptokit v1.6: Cryptographic primitives
2) ocaml-fileutils v0.4.4
3) ocaml-expect v0.0.3: Expect-like framework
4) No interface to the C sysconf function in the Sys or Unix module?
5) gperftools 0.1, extunix 0.0.5
6) Call for Participation: Mancoosi International Solver Competition
7) PEPM 2013: Preliminary Call for Papers
8) Appel à communication, JFLA 2013
9) FAN 0.1
10) Commercial Users of Functional Programming 2012: Call for Presentations
11) Other Caml News


1) cryptokit v1.6: Cryptographic primitives
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-06/msg00112.html

** Sylvain Le Gall announced:

Update to oasis v0.3.0~rc6

Download:
https://forge.ocamlcore.org/frs/download.php/891/cryptokit-1.6.tar.gz

This library provides a variety of cryptographic primitives that can be used
to implement cryptographic protocols in security-sensitive applications. The
primitives provided include:

- Symmetric-key ciphers: AES, DES, Triple-DES, ARCfour,
in ECB, CBC, CFB and OFB modes.
- Public-key cryptography: RSA encryption, Diffie-Hellman key agreement.
- Hash functions and MACs: SHA-1, MD5, and MACs based on AES and DES.
- Random number generation.
- Encodings and compression: base 64, hexadecimal, Zlib compression.

Additional ciphers and hashes can easily be used in conjunction with
the library. In particular, basic mechanisms such as chaining modes,
output buffering, and padding are provided by generic classes that can
easily be composed with user-provided ciphers. More generally, the library
promotes a Lego-like style of constructing and composing
transformations over character streams.

Get source code:
$ svn co http://scm.ocamlcore.org/svnroot/cryptokit/trunk

Browse source code:
https://forge.ocamlcore.org/scm/browser.php?group_id=133
  

2) ocaml-fileutils v0.4.4
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-06/msg00113.html

** Sylvain Le Gall announced:

Update to oasis 0.3.0~rc6

Download:
http://forge.ocamlcore.org/frs/download.php/892/ocaml-fileutils-0.4.4.tar.gz

Get source code:
$ darcs get 
https://forge.ocamlcore.org/anonscm/darcs/ocaml-fileutils/ocaml-fileutils

Browse source code:
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=ocaml-fileutils/ocaml-fileutils;a=summary
  

3) ocaml-expect v0.0.3: Expect-like framework
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-06/msg00120.html

** Sylvain Le Gall announced:

Update with oasis v0.3.0~rc6.

Download:
https://forge.ocamlcore.org/frs/download.php/894/ocaml-expect-0.0.3.tar.gz

This is a simple implementation of `expect` to help building unitary testing
of interactive program.

It helps to receive question and send answers from an interactive process.
You can match the question using a regular expression (Str). You can also
use a timeout to ensure that the process answer in time.

See the [Expect manual](http://expect.nist.gov/) for more information and
example.

Homepage:
http://forge.ocamlcore.org/projects/ocaml-expect/

Get source code:
$ darcs get http://darcs.ocamlcore.org/repos/ocaml-expect

Browse source code:
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=ocaml-expect;a=summary
  

4) No interface to the C sysconf function in the Sys or Unix module?
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-06/msg00119.html

** Francois Berenger asked and Markus Weißmann replied:

 Wouldn't it be possible to have one?

Afaik this is on the todo list of ocaml-extunix [1].

best regards
-Markus

[1] http://forge.ocamlcore.org/projects/extunix/
  

5) gperftools 0.1, extunix 0.0.5
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-06/msg00128.html

** ygrek announced:

Tonight one more new ocaml library was born, please welcome :

ocaml-gperftools 0.1


gperftools https://code.google.com/p/gperftools library provides interface 
to control tcmalloc behavior. This may be useful to
ocaml programs which delegate heavy lifting to C code, hence the ocaml 
bindings.

Located at http://gperftools.forge.ocamlcore.org/

ocaml-extunix 0.0.5
---

ExtUnix aims to collect thin bindings to various low-level system API in one 
library with consistent interface.
This 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-05-15 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 08 to 15, 2012.

1) camlp4 and generating class definitions
2) Barista 2.0-alpha3
3) OCaml Users and Developers (OUD)
4) 108.00-pre2 pre-release of Core suite
5) Any tool for unit tests as comments in OCaml source?
6) Other Caml News


1) camlp4 and generating class definitions
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-05/msg00103.html

** Joel Reymont asked and Jacques Garrigue replied:

 I would like to auto-generate an object with a couple of mutable
 fields and some methods.
 
 I would then like to pretty-print the code into a file.
 
 Are there any examples showing how to do this with camlp4?

My syntax extension for properties does that.
http://www.math.nagoya-u.ac.jp/~garrigue/code/ocaml.html
I haven't tested it recently but hopefully it still works.
  
** Philippe Veber also replied:

You can have a look at Martin Jambon's col syntax extension :

https://github.com/pveber/col

Have a look at pa_col.ml, starting line 400.


2) Barista 2.0-alpha3
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-05/msg00108.html

** Xavier Clerc announced:

This post announces the 2.0-alpha3 release of the Barista project, whose goal
is to provide a library for Java class file construction and a Java
[dis]assembler, released under the LGPLv3.
This new version fixes several critical bugs.

Home page: http://barista.x9c.fr
Forge page: https://forge.ocamlcore.org/projects/barista/

Main changes since 2.0-alpha2:
  - support for '*.sym' and '*.war' files in classpath
  - 'JAVA_HOME' environment variable used to load JDK classes
  - '/usr/libexec/java_home' utility used to load JDK classes (MacOS X)
  - 'Predef' module renamed to 'Predefined'
  - peephole rule for optimization of load/load sequences
  - no automatic detection of 'ocamljava' binary
  - bug #99: wrong packing of int32 into int64
  - bug: ocamlbuild plugin for ocamljava-based compilation
  - bug: invalid stack maps when double/long is followed by top
  - bug: invalid locals size when over 255
  - bug: incorrect graph flattening when wide gotos are used
  - bug: install 'cmi' file
  

3) OCaml Users and Developers (OUD)
Archive: https://sympa.inria.fr/sympa/arc/caml-list/2012-05/msg00110.html

** Didier Remy announced:

Dear OCaml Users and Developers,

This is a reminder that this year OCaml Meeting, renamed the OCaml
Users and Developers workshop (OUD), will be colocated with ICFP in
Copenhagen, Denmark on September 14th.

The deadline for submitting Talk Proposals is 8th June 2012,  only few
weeks away.  Visit http://oud.ocaml.org/2012/ for all details.

Don't miss it!

Didier

  OCAML USERS AND DEVELOPERS WORKSHOP 2012
OUD 2012
  http://oud.ocaml.org
 CALL FOR PRESENTATIONS
   Copenhagen, Denmark
   Fri, Sep 14th
  Co-located with ICFP 2012
Sponsored by SIGPLAN
Talk Proposal Submission Deadline 8th June 2012


In 2012, the OCaml Meeting will be renamed the OCaml Users and Developers
workshop (OUD), and be colocated with ICFP in Copenhagen, Denmark. It
will be held on Friday September 14, after the ML workshop (Thu 13)
and before the Commercial Users of Functional Programming (Sat 15).

The OCaml Users and Developers Workshop will bring together industrial
users of OCaml with academics and hackers who are working on extending the
language, type system and tools. Discussion will focus on the practical
aspects of OCaml programming and the nitty gritty of the tool-chain and
upcoming improvements and changes.  Thus, we aim to solicit talks on
all aspects related to improving the use or development of the language,
including, for example:

- compiler developments; new backends, runtime and architectures.
- practical type system improvements, such as (but not exhaustively) 
  GADTs, first-class modules, generic programming, or dependent types.
- new library or application releases, and their design rationales.
- tool enhancements by commercial consultants. 
- prominent industrial uses of OCaml, or deployments in unusual
  situations.

It will be an informal meeting, with an online scribe report of the
meeting, but no formal proceedings for this year. Slides of presentations
will be available online from the workshop homepage.

To submit a talk, please register an abstract or outline (1-2 pages) at
http://oud.ocaml.org/talks with as much 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-05-01 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 24 to May 01, 2012.

1) llpp v12
2) Other Caml News


1) llpp v12
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-04/msg00162.html

** malc announced:

New version of llpp (tagged v12) is no available at
http://repo.or.cz/w/llpp.git

Blurb:

llpp a graphical PDF viewer which aims to superficially resemble
less(1)

Changes:

* MuPDF[1]  had a 1.0 release.
* Split columns mode
* Hints mode a la conkeror[2] (handy for mouseless navigation)
* Made sure that things do run under Cygwin's X and XQuartz

[1] http://mupdf.com/
[2] http://conkeror.org/
  

2) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at 
lt;http://planet.ocamlcore.org/gt;.

Hg repository on bitbucket:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=830

Fun(c) with OCaml and Mazes:
  http://www.martani.net/2012/04/func-with-ocaml-and-mazes.html

The Haskell / Snap ecosystem is as productive (or more) than Ruby/Rails.:
  http://blog.dbpatterson.com/post/21885034168
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .




___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-04-24 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 17 to 24, 2012.

1) Build OCaml iOS apps under Lion
2) PEC ver. 1.1
3) ERic release v0.2
4) Boolean expression simplifier library
5) Kendall tau in OCaml
6) OCaml marine navigation iPad app
7) cocan.org
8) ODT 2.2 released
9) Other Caml News


1) Build OCaml iOS apps under Lion
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-04/msg00125.html

** Jeffrey Scofield announced:

I've created a new version of OCamlXARM, which is my name for a version
of the OCaml compiler that builds executables for iOS.  The new version
(1.0.15) works with Lion (OS X 10.7) and the latest Xcode (4.3.2).

A while back there were some queries about using OCamlXARM on Lion, and
I promised to get it working after our latest iOS app was released.  So,
the 1.0.15 release is what I promised.

Instructions for downloading a binary release of OCamlXARM, or building
it from source, and for testing, are at:

http://psellos.com/ocaml/compile-to-iphone.html

You can read about what I had to do to get it working on
Lion in my sporadic blog:

http://psellos.com/2012/04/2012.04.ocamlxarm-lion-1.html

There were problems reported in using the old OCamlXARM with Lion.  I
haven't seen any of these problems with the latest OCamlXARM.  I built
all my test apps, and also rebuilt the real-world iOS apps that we sell.
They all worked with no problems that I could find.  (In particular,
our real-world apps do plenty of floating arithmetic, and it works.)

Please let me know of any comments or problems.  I'd especially
like to hear about bugs in OCamlXARM (so I can fix them).
  

2) PEC ver. 1.1
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-04/msg00115.html

** Satoshi Ogasawara announced, starting a long discussion on it vs React:

I'm please to announce release PEC version 1.1, a push-based event combinator 
library
which is helpful to write event driven systems with purely functional style.

 https://github.com/osiire/Pec

PEC is similar to React library but there are some different points.

- PEC's update cycle is separated from sending events.
  You can send a value to event during update cycle.

- PEC doesn't hold any pointer(including weak one) to event until the
  event will be subscribed.

- All PEC's signal are switchable. 'switch' means you can replace dependency
  of a signal keeping signals depends on the signal unchanged.

You can see sample codes to use PEC.

https://github.com/osiire/Pec/blob/master/test/
  

3) ERic release v0.2
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-04/msg00127.html

** Damien Guichard announced:

I'm please to announce release ERic version 0.2a, a small/simple (may be
simplistic ?) graph-based knowledge database.
The interface is command-line only.

SVN: http://subversion.developpez.com/projets/ERic/trunk

Author:  Damien Guichard.
Last modification:   18-Apr-2012
Version: 0.2a
Licence: EUPL 1.1
Development status:  Stable
Kind:Application written in OCaml
Topic:   Databases
Homepage:   
http://www.developpez.net/forums/f1699/applications/projets/projets-heberges/eric/
  

4) Boolean expression simplifier library
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-04/msg00128.html

** Markus W. Weißmann announced:

I'd like to announce the first public release of the 'boolean expression 
simplifier' library bes.
It is an implementation of several algorithms for minimizing boolean 
expressions similar to the espresso solver [1] -- though in OCaml.
The source code is available on ocamlforge under the new bsd license:

http://bes.forge.ocamlcore.org/

It comes with a simple front-end program for reading and simplifying 
expressions in DFA from text files.
Students trying to verify their Karnaugh Veitch map solutions rejoice! ;)


Regards

-Markus

[1] http://embedded.eecs.berkeley.edu/pubs/downloads/espresso/index.htm
  
** Francois Berenger asked and Markus W. Weißmann replied:

 I'm curious, what is it used for?
 
 Is it for people doing proof checkers or things like this?

Like that, yes:
We successfully use it for reducing the size of programs we want to perform 
model checking on. My concrete target are industrial robot systems [1].

I even tried to integrate it into a compiler to reduce the size of 
right-hand-side boolean 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-04-11 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 03 to 10, 2012.

1) New version of the binary installer for Windows
2) Non-blocking IO interface design


1) New version of the binary installer for Windows
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00353.html

** Continuing the thread from last week, Jonathan Protzenko said and Sylvain Le 
Gall replied:

 I've also looked into odb compatibility, and it looks like after writing 
 a few patches, odb now runs fine on Windows. However, Oasis-generated 
 setup.ml files do not work at all on windows. Any help in that area 
 would be highly appreciated.

This has nothing to do with windows. This is related the version number
of OCaml which is 4.01.0+dev0 (2012-03-12). OASIS 0.2 doesn't handle
spaces in the version number... A more classical scheme for version
number with date is 4.01.0+dev0_2012-03-12. But anyway, this is fixed
since OASIS 0.2.1~alpha1 and will be automatically fix in any packages
hosted on the forge -- and it won't be there when your installer will
use a non dev version of OCaml.

BTW, the bug related to these issues is here:
https://forge.ocamlcore.org/tracker/index.php?func=detailaid=1135group_id=54atid=291
I recommend to follow it.

From what I have seen I am more concerned by the fact that the camlp4
findlib path contains strange char... There are some bugs in findlib on
Windows with pathname, I have attached a patch to the bug. Please test
and send it to Gerd Stolpmann.


2) Non-blocking IO interface design
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-04/msg00055.html

** Daniel Bünzli said:

This is problematic : 

https://github.com/williamleferrand/xmlm

http://ambassadortothecomputers.blogspot.com/2010/08/mixing-monadic-and-direct-style-code.html

To solve this problem I'm looking for a simple interface design to
make my IO modules compatible with monadic concurrency libraries (lwt,
async, [insert your own here]) and event based loops (select(2),
poll(2), etc.). The design should have the following properties:

1. Unified interface for blocking and non-blocking mode. 
2. The existence of the non-blocking mode should not significantly
 impact blocking mode users.
3. Input possible from in_channel, string, refillable fixed-size string 
 buffer (non-blocking mode). 
4. Output possible to out_channel, Buffer.t, flushable fixed-size string
 buffer (non-blocking mode).
5. No third-party IO libraries/paradigms so that the module can adapt
 to the one the user chooses.
6. Reasonably efficient.

I looked for some time into Haskell's enumerators, pipes and other
conduits but I eventually came back to a more ad-hoc approach that
abstracts as follows. I'll gladly take any feedback you may have.

Suppose we want to IO streams of value of `type t`. For example xmlm's
signals (lexemes as they should be called) if you are familiar with
that.

For input (decoding) we begin with a type for input sources, decoders
and a function to create them.

type src = [ `Channel of in_channel | `String of string | `Manual ]
type decoder 
val decoder : src - decoder

A [`Manual] source means that the client will provide the decoder with
chunks of bytes to decode at his own pace. The function for decoding
is :

val decode : decoder - [ `Await | `End | `Error of e | `Yield of t ]

[decode d] is : 

- [`Await] iff [d] has a [`Manual] input source and awaits for
more input. The client must use [decode_src] (see below) to provide it.
- [`Yield v], if a value [v] of type [t] was decoded. 
- [`End], if the end of input was reached.
- [`Error e], if an error [e] occured. If you are interested in a
best-effort decoding, you can still continue to decode after
the error.

For [`Manual] sources the function [decode_src] is used to provide
the byte chunks to read from : 

val decode_src : decoder - string - int - int - unit

[decode_src d s k l] provides [d] with [l] bytes to read, starting at
[k] in [s]. This byte range is read by calls to [decode] with [d]
until `Await is returned. To signal the end of input call the function
with [l = 0].

That's all what is needed for input. Just a note on the `Error
case. Decoders should report any decoding errors with [`Error] to
allow standard compliant decodings. However at that point they should
give the opportunity to the client to continue to perform a best
effort decoding. In that case [decode] should always eventually return
[`End] even if [`Error]s were reported before. I think best-effort
decoding on errors is a good thing: I was annoyed more than once with
xmlm simply failing with `Malformed_char_stream on files produced by
legacy software that gave invalid UTF-8 encodings for funky
characters. 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-04-03 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 27 to April 03, 2012.



1) Reducing boxing for floats
2) Ocsigen Eliom 2.1
3) New version of the binary installer for Windows
4) Other Caml News


1) Reducing boxing for floats
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00330.html

** Alain Frisch said:

I'd like to ask for the community help in evaluating the benefits of a new
strategy to control boxing/unboxing of floats in ocamlopt.

I've implemented this new strategy in the more_unboxing branch of the SVN. You
can find some description (and micro-benchmarks) there:

http://caml.inria.fr/mantis/view.php?id=5204


If numerical code is the bottleneck of one of your applications, it would be
helpful if you could you try out the more_unboxing branch (forked from the
trunk in january 2011, IIRC) and report the results on Mantis.
  
** Dario Teixeira then replied:

Thanks for this!  I've given the 'more_unboxing' branch a brief try, using
the N-body problem from the infamous shootout as benchmark.  Below are the
results for executables compiled with 3.12.1, today's SVN trunk, and today's
'more_unboxing' branch.  The compiler options are the same as used in the
shootout; the tests consisted of 10^9 iterations on an x86_64 machine:

Version 3.12.1:

 time ./nbody.native 1_000_000_000
 .23user 0.13system 18:32.61elapsed 99%CPU (0avgtext+0avgdata 
3472maxresident)k
 0inputs+0outputs (0major+273minor)pagefaults 0swaps

SVN trunk (2012/03/29):

 time ./nbody.native 1_000_000_000
 969.29user 0.62system 16:14.66elapsed 99%CPU (0avgtext+0avgdata 
3488maxresident)k
 0inputs+0outputs (0major+273minor)pagefaults 0swaps

SVN branches/more_unboxing (2012/03/29):

 time ./nbody.native 1_000_000_000
 960.72user 0.30system 16:03.51elapsed 99%CPU (0avgtext+0avgdata 
3472maxresident)k
 0inputs+0outputs (0major+272minor)pagefaults 0swaps

Though the improvement from trunk to more_unboxing is small (about 1%) and
may in fact disappear altogether if one were to run a serious statistical
analysis, the improvement from 3.12.1 to 4.00 is quite striking: about 13%!
What has changed in the compiler that would explain this?

Also, a note to those using GODI: it's fairly straightforward to have multiple
co-existing OCaml installations, making the test of trunk or experimental
branches less disrupting.  You'll find at the end the steps I used to get the
'more_unboxing' branch running.  (Note that I had to run each godi_make step
individually because of step 6, though I'm sure the GODI ninjas will find
ways to streamline this process even further.)

Best regards,
Dario Teixeira



1) Tell GODI the SVN location to checkout.
   Edit $GODI/etc/godi.conf:

  OCAML_SVN_CHECKOUT = yes
  OCAML_SVN_PATH = /ocaml/branches/more_unboxing

2) cd $GODI/build/godi/godi-ocaml-src

3) godi_make clean

4) godi_make fetch

5) godi_make extract

6) GODI expects the source code directory to be called 'work/ocaml'.
   So we must do some renaming before proceeding:

  mv -T work/more_unboxing work/ocaml

7) godi_make patch

8) godi_make configure

9) godi_make build

10) godi_delete godi-ocaml-src-3.12.1godi1

11) godi_make install

12) godi_make package

13) Start godi_console and mark package godi-ocaml for rebuilding.
This will automatically force an overall rebuild.

14) Enjoy! 


2) Ocsigen Eliom 2.1
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00340.html

** Vincent Balat announced:

We are happy to announce release 2.1 of Ocsigen Eliom.
 
With Eliom, you can implement client-server Web applications fully in
OCaml. Client parts, delimited by a syntax extension, are automatically
extracted from the application source code and compiled to _javascript_ using
the Js_of_ocaml compiler.
 
Eliom also provides very powerful tools to implement classical Web sites, and
makes it possible to mix usual Web interactions with advanced client side
features.
 
Links:
 
Main changes in this version: http://ocsigen.org/eliom/Eliom21
Eliom project's page: http://ocsigen.org/eliom/
Ocsigen tutorial: http://ocsigen.org/tutorial/
The example of the tutorial: http://ocsigen.org/graffiti/
Ocsigen project: http://ocsigen.org
  

3) New version of the binary installer for Windows
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00322.html

** Jonathan Protzenko announced:

I've spent the past few days improving the OCaml installer for windows. This
should solve all 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-03-27 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 20 to 27, 2012.

1) Explicitely named type variable and type constraints
2) OCaml app for iOS, Schnapsen card game
3) Wanted: GADT examples: string length, counting module x
4) GADT examples: composable functions list
5) Js_of_ocaml version 1.1
6) Software engineer position at MyLife
7) Other Caml News


1) Explicitely named type variable and type constraints
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00254.html

** Philippe Veber asked and Jacques Garrigue replied:

 I found myself defining a type that would both contain a module type and a 
 type constraint:
 
   module type Screen = sig
 type state
 type message
 val init : state
 [...] 
val emit : state - message option
   end
   type 'a screen = (module Screen with type message = 'a) constraint 'a = 
 [ `quit]
 
 That is supposed to express that screens emit messages, and that one of the 
 messages can be quit. Now I've got some trouble when using the 'a screen 
 type in a function that unpack the module it contains:
 
   let f (screen : 'a screen) = 
 let module Screen = (val screen : Screen) in
 match Screen.(emit init) with
   | Some `quit - 1
   | _ - 0
 
   ;;
 Error: This expression has type
  ([ `quit ] as 'a) screen = (module Screen with type message = 'a)
but an expression was expected of type (module Screen)

Indeed, this is clearly wrong: these two module types are not equivalent.

 New attempt:
 
 # let f (screen : 'a screen) = 
 let module Screen = (val screen : Screen with type message = 'a) in
 match Screen.(emit init) with
   | Some `quit - 1
   | _ - 0
   
   ;;
 Error: Unbound type parameter 'a

Wrong again, as subtyping between module signatures does not
allow free type variables.

 Though here I'm not sure the error is right. New attempt:
 
 
 # let f (type s) (screen : s screen) = 
 let module Screen = (val screen : Screen with type message = s) in
 match Screen.(emit init) with
   | Some `quit - 1
   | _ - 0
   
   ;;
 Error: This type s should be an instance of type [ `quit ]
 
 Which makes sense. So here is my question: is there a way to impose a 
 constraint on the newtype introduced in argument? Let me say that I'm 
 aware I should write this more simply. For instance in the module type 
 Screen, emit could have type state - [`quit | `message of message]. So my 
 question is only a matter of curiosity. Still, I'd be happy to know :o).

No, currently there is no way to do that.
One can only create locally abstract types, not locally private types.
In theory I see no problem doing that, but with the current approach this 
would require new syntax,
and be rather heavy.

  let f (type s = private [ `quit]) (screen : s screen) = ...

And to be fully general, recursion between those types should be allowed 
too...

As a side note, writing
type message = private [ unit]
makes the problem clearer.
And solves it in some cases:

module type Screen =
  sig
type state
type message = private [ `quit ]
val init : state
val emit : state - message option
  end
# let f (module Screen : Screen) =
match Screen.(emit init) with
| Some `quit - 1
| _ - 0
  ;;
val f : (module Screen) - int = fun

(using 4.00, but you can also write with (val ...))
  

2) OCaml app for iOS, Schnapsen card game
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00267.html

** Jeffrey Scofield announced:

As more proof that you can write real-world iOS apps in OCaml, our little
outfit Psellos has just released a second OCaml app through the App Store.
It plays the classic card games Schnapsen and Sixty-Six.

You can find info about the app at our website:

http://psellos.com/

We think using OCaml was a real advantage in building the game-playing
engine.  It also seemed a great fit for the animation subsystem that I
wrote to make the cards move (immutably).

Also, these are great card games.  One of our friends was inspired by
the app to start up a blog about Schnapsen (also on the website).

In addition to the two apps that we sell (for cheap), I've written 5
apps that show how to code for iOS in OCaml.  The sources for all 5 are
available at our website in the OCaml section
(http://psellos.com/ocaml/).  A few people have used these examples as
the basis for their own apps.

There's also info on how to cross compile to iOS and to the iOS
Simulator, how to build the cross compilers we're using, and how to use
OpenGL ES from OCaml.

Recently there was a question about updating our tools to work with
Apple's latest Xcode.  Now that the app is released, 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-03-20 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 13 to 20, 2012.

1) CVE request: Hash DoS vulnerability (ocert-2011-003)
2) New version of standalone ocaml interval library + mpfr/mpfi preliminary 
bindings for ocaml
3) Arrays and private types
4) ML workshop 2012: call for presentations
5) Software Development Engineer at OCamlPro (Paris, France)
6) Spring release
7) Efficient scanning of large strings from files
8) Parsing cmi file
9) Other Caml News


1) CVE request: Hash DoS vulnerability (ocert-2011-003)
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00186.html

** Deep in this thread, Xavier Leroy replied to many people:

Gerd Stolpmann writes:
 The Random module is definitely not good enough (e.g. if you
 know when the program was started like for a cgi, and the cgi reveals
 information it should better not like the pid, the Random seed is made
 from less than 10 unpredictable bits, and on some systems even 0 bits).

Dario Teixeira adds:
 I think the problem may be in finding a good source of randomness
 that is common across all OSes.  In Unixland this problem has
 largely been solved: pretty much everyone supports /dev/random and
 /dev/urandom.  Windows does things differently, however.

David Allsopp adds:
 Does the source of randomness have to be common? The decision to use
 a random seed doesn't need to be limited by a problem getting a good
 cryptographically secure generator on a given OS - you'd simply
 document that the implementation on that particular OS doesn't seed
 with a good PRNG and await a patch from someone who may care in the
 future, but at least the philosophy behind the decision is correct!

We are also thinking of strengthening Random.self_init, for instance
by using /dev/urandom when available.  This said, for randomizing
hashtables or other data structures, we do *not* need a
cryptographically-strong PRNG: we're not generating an RSA key pair or
some other situation where cryptographic quality is required; we're
just making a mild DOS attack impractical.

(Obligatory advertisement: if you're in need of
cryptographically-strong random data,
http://forge.ocamlcore.org/projects/cryptokit/
is what you need.)
  

2) New version of standalone ocaml interval library + mpfr/mpfi preliminary 
bindings for ocaml
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00190.html

** Jean-Marc Alliot announced:

Everything is in the title.

Just go to :
http://www.alliot.fr/fbbdet.html.fr
  

3) Arrays and private types
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00203.html

** Pietro Abate asked and Gabriel Scherer replied:

 In my application I'm using arrays all over, and lately I've discovered a
 couple of bugs related to the fact that I was using the index of one array 
 to
 get the element of another array. Since both indexes are int the compiler 
 could
 not help me at all. Using private types it seems I can solve this problem
 without loosing anything (??).

Here is a proposal:
  
https://gitorious.org/gasche-snippets/private-array-keys-type/blobs/master/private_array_key_types.ml

It works by using a functor to generate fresh private types for
keys. Note that the arrays themselves are still polymorphic (no
IntArray FloatArray etc.). The user still has to use the discipline to
produce a new application of ArrayMake each time she wants to use a
different kind of array: if she only does `module A = ArrayMake(struct
end)` and then use `A` for everything, there will be no additional
safety guarantee.
  
** Later on, Pietro Abate asked and Gabriel Scherer replied:

 Thanks Gabriel, very nice solution. If I go this way, I guess there is
 no way to access array elements using the usual a.(i) syntax (where i
 = M.key i)... [...]
 Is this a problem I can solve using a camlp4 decorator ?

I don't think you need -- nor want to use -- a camlp4 extension. a.(i)
is desugared into (Array.get a i) at a purely syntactical level in
OCaml, so you could overload its behavior by changing the Array module
in the typing environment.

With my example you could write, for example:
module A1 = ArrayMake(struct end)
let () =
  let module Array = A1 in
  let k = A1.key in
  assert (A1.make 3 true).(k 2);;

You could even define the ArrayMake functor so that it returns a
structure with an Array submodule. You would then write, using 3.12
local open syntax:

module A1 = ArrayMake(struct end)
let () =
  let open A1 in
  assert (Array.make 3 true).(k 2)

That said, I don't think that the slight readability 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-03-13 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 06 to 13, 2012.

1) TypeRex release 1.0.0 candidate 1
2) OCaml Users and Developers workshop (OUD)
3) oasis packaging questions
4) A js_of_ocaml equivalent for the JVM?
5) Stog: static web site and blog generator
6) TypeRex 1.0.0
7) ocamldoc: Howto crossreference another library?
8) Other Caml News


1) TypeRex release 1.0.0 candidate 1
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00042.html

** Continuing the thread from last week, Stefano Zacchiroli asked and Tiphaine 
Turpin replied:

 At the same time, I'm not thrilled at the idea of having to use a
 different ocamlc just to benefit from TypeRex. Having to do so brings a
 number of disadvantages, the first and foremost being that now the
 programmer needs to worry about having synchronized versions of the
 legacy ocamlc installed on his machine and the version shipped by
 TypeRex.
First, a small precision (which may not be obvious from TypeRex 
documentation): as the ocp-ocamlc, ... commands are only wrappers, they 
are not tied to a particular version of the actual compilers they call. 
In fact the following three components are somehow independent:
- the installed OCaml compilers (currently only 3.12.* is supported, 
because by mistake we forgot to include 3.11 compatibility, will be 
fixed in 1.0.0)
- TypeRex (with ocp-type and ocp-ocamlc, etc.)
- the OCaml compiler used to compile TypeRex (since rc2, =3.11 works)
However, TypeRex won't be able to handle new language constructs that 
are introduced in OCaml after we extract its front-end, which implies that:
- we will have too follow closely the language evolutions and we will 
release a new version of TypeRex for each major release of OCaml.
- using Typerex for developping the OCaml compiler prevents you to use 
the new language constructs that you introduce, until TypeRex is itself 
updated.
   But there are more disadvantages, unfortunately.

 Can you tell us why we can't (or maybe *when* we will be able to :-))
 have the nice features offered by TypeRex on top of the stock ocamlc
 compiler?
We would like to have the binary annotation feature included in the next 
release of OCaml. Before proposing a patch upstream, we wanted to 
stabilize the changes in the compiler and prove them to be generic 
enough. But there are two alternatives to having binary annotations in 
OCaml:
- improve the ease of use of the wrappers (there have been interesting 
suggestions in this direction on the issue tracker)
- integrate with a build system (which would also replace the ad-hoc 
.typerex file)
  

2) OCaml Users and Developers workshop (OUD)
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00117.html

** Didier Remy announced:

  OCAML USERS AND DEVELOPERS WORKSHOP 2012
OUD 2012
  http://oud.ocaml.org
 CALL FOR PRESENTATIONS
   Copenhagen, Denmark
   Fri, Sep 14th
  Co-located with ICFP 2012
Sponsored by SIGPLAN
Talk Proposal Submission Deadline 8th June 2012


In 2012, the OCaml Meeting will be renamed the OCaml Users and Developers
workshop (OUD), and be colocated with ICFP in Copenhagen, Denmark. It
will be held on Friday September 14, after the ML workshop (Thu 13)
and before the Commercial Users of Functional Programming (Sat 15).

The OCaml Users and Developers Workshop will bring together industrial
users of OCaml with academics and hackers who are working on extending the
language, type system and tools. Discussion will focus on the practical
aspects of OCaml programming and the nitty gritty of the tool-chain and
upcoming improvements and changes.  Thus, we aim to solicit talks on
all aspects related to improving the use or development of the language,
including, for example:

- compiler developments; new backends, runtime and architectures.
- practical type system improvements, such as (but not exhaustively)
  GADTs, first-class modules, generic programming, or dependent types.
- new library or application releases, and their design rationales.
- tool enhancements by commercial consultants.
- prominent industrial uses of OCaml, or deployments in unusual
  situations.

It will be an informal meeting, with an online scribe report of the
meeting, but no formal proceedings for this year. Slides of presentations
will be available online from the workshop homepage.

To submit a talk, please register an abstract or outline (1-2 pages) at
http://oud.ocaml.org/talks with as much information as you feel will
support the proposal.  If you wish to 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-03-06 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of February 28 to March 06, 
2012.

1) Release - A multi-process daemon framework
2) OCamlnet-3.5.1
3) Camlp5 6.04 - configurable name
4) TypeRex release 1.0.0 candidate 2
5) application scope for hashtable on weak pointers
6) [community poll for PR#5312] Do some OCaml Windows users still use the 
@responsefile feature?
7) Commercial Users of Functional Programming 2012: Call for Presentations
8) Other Caml News


1) Release - A multi-process daemon framework
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00209.html

** Andre Nathan announced:

I've just created the Release repository on Github:

  https://github.com/andrenth/release

From the README:

  Release is a multi-process Lwt-enabled daemon framework for
  OCaml, providing facilities for type-safe inter-process
  communication and privilege-dropping.

  Its goal is to make it easy to write servers that are
  released from the calling terminal and to release root
  privileges when those are not necessary.

This is not yet a stable release and I'm still working on some features,
but any feedback would be much appreciated.
  

2) OCamlnet-3.5.1
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00221.html

** Gerd Stolpmann released:

There is a patch release available, 3.5.1, fixing a few errors, mostly
build-related:

- Missing symbols on FreeBSD-9
- Missing symbols on Debian Wheezy (probably because of stricter 
  linking)
- posix_spawn is disabled on Mac (for the time being until the problem
  can be further tracked down)
- Mac OS does not like fchmod on shared memory
  

3) Camlp5 6.04 - configurable name
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg2.html

** Daniel de Rauglaudre announced:

New release of Camlp5 (6.04) where:

The *names* of all what are built (executables, library) are now
configurable, allowing to have 'strict' and 'transitional' modes
both installed in the same computer in different places.

Example:
./configure --strict
make world.opt
make install
./configure --transitional name=camlp5t
make world.opt
make install

In that case, executables in transitional mode are camlp5t, camlp5to,
camlp5tr and so on... and the library is installed in a directory
named camlp5t instead of camlp5. No conflict between the two modes.

Download at:
  http://pauillac.inria.fr/~ddr/camlp5/
  

4) TypeRex release 1.0.0 candidate 2
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-03/msg00015.html

** Tiphaine Turpin announced:

This is time for a second release candidate for TypeRex, our new
OCaml development environment for Emacs. We want to thank the many early
adopters, for their useful feedback and encouraging comments.

The new version is available on TypeRex website at:

http://www.typerex.org/

It fixes a number of issues, here is the list of changes:

- Improved performance on large libraries (lazy environments, more cache)
- Fixed encoding bug with 3bytes utf8 characters
- Use line/column positions instead of absolute bytes (fixes windows eol)
- More robust ml/mli switching (contributed by Wojciech Meyer)
- Fixed camlp4 first-class modules
- Compiles with 3.11.2 as claimed (no more 3.12 syntax in the code)
- Made the prefix key customizable (C-o by default)
- Added option --disable-version-check to configure script
- Source extensions customizable (e.g., .eliom), mlp included by default
- Allow to disable syntax coloring completely
- Applied Jun Furuse's indentation patch and changed a few defaults
- Use the caml-mode error regexp instead of tuareg's
- Fixed coloring of constructors in type definitions
- Fixed the crash when starting emacs on several files (=3)
- Fixed wrapper for -a
- Less risky names in lisp code
- Slightly improved documentation (ocamlbuild, libraries, module packing)
- Tuareg actions use TypeRex stdlib path instead of hard-coded default


Summary of TypeRex features:

* Improved syntax coloring
* Auto-completion of identifiers (experimental)
* Browsing of identifiers: show type and comment, go to definition,
  cycle between alternate definitions, and semantic grep;
* Strictly semantic-preserving, local and whole-program refactoring:
  o renaming identifiers and compilation units
  o open elimination and reference simplification
* Robust /w.r.t./ 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-02-28 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of February 21 to 28, 
2012.


1) TypeRex release 1.0.0 candidate 1
2) Ocamlnet-3.5
3) findlib-1.2.8
4) post-doc position available at MSR-INRIA joint lab
5) llpp v11
6) Other Caml News


1) TypeRex release 1.0.0 candidate 1
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00168.html


** Tiphaine Turpin announced:

We are pleased to announce the first release candidate of TypeRex, a new
OCaml development environment, developed by OCamlPro and Inria Saclay.
This version of TypeRex only integrates with Emacs and brings a
collection of new features that programmers expect from a modern IDE.
Next versions will target more editors.

Downloads, screenshots, documentation, support and feedback
instructions are available on TypeRex website at:

http://www.typerex.org/

Summary of TypeRex features:

* Improved syntax coloring
* Auto-completion of identifiers (experimental)
* Browsing of identifiers: show type and comment, go to definition,
  cycle between alternate definitions, and semantic grep;
* Strictly semantic-preserving, local and whole-program 
refactoring:

  o renaming identifiers and compilation units
  o open elimination and reference simplification
* Robust /w.r.t./ not-recompiled, possibly unsaved buffers
* Scalable (used regularly on a few hundreds of source files)

Auto-completion is disabled by default, since more testing is still
needed for this feature.

TypeRex is written in OCaml, communicating through a socket with the
OCaml mode of the editor (currently Tuareg for Emacs, OCAIDE for Eclipse
soon).

All the features of the Tuareg mode are also included, even when we
provide an equivalent for them.


2) Ocamlnet-3.5
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00176.html


** Gerd Stolpmann announced:

it is time for another version of Ocamlnet. The new release 3.5 focuses 
on

the system interface, and includes a long list of smaller improvements.

The system interface, Netsys_posix, is extended by:
 - Support for POSIX clocks and POSIX timers (with nanosecond 
resolution)
 - Netsys_posix.spawn usses now the posix_spawn call if present on the 
OS

 - Adding support for pollable events (as e.g. provided by Linux via
   eventfd). For other OS an emulation is available.
 - Support for epoll on Linux

Note that Netsys_posix covers now large parts of POSIX realtime.

Other improvements:

 - The code generator for XDR has been improved. A new switch -direct 
for
   ocamlrpcgen can be used to generate direct mappings between OCaml 
values

   and binary representation (in many cases). Speedups up to 50% are
   possible for large XDR values.
 - The new module Uq_mt allows it to access an event-driven resource 
from

   several kernel threads (e.g. use an RPC client commonly from several
   threads).
 - The thread-safety of Netplex container functions has been improved.
 - Netmulticore condition variables can now be polled, for better
   integration into event-based programs.
 - Option greedy_accepts for Netplex to support servers that accept
   many connections per second. With this improvement, Netplex can
   now accept more than 5000 connections/s, and assign them to worker
   processes.

Last but not least there is now a new tutorial for Equeue (event systems
and engines). In particular, the section about combining Ocamlnet with 
Lwt

might be interesting.

For the full list of changes (especially bug fixes), see:

https://godirepo.camlcity.org/svn/lib-ocamlnet2/trunk/code/ChangeLog

The download, manual, and other resources:

http://projects.camlcity.org/projects/ocamlnet.html

GODI has been updated.


3) findlib-1.2.8
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00187.html


** Gerd Stolpmann announced:

Findlib-1.2.8, a patch release, is out. It includes a fix for Win32, and
support for ocamlfind ocamlmklib, mostly for completeness.

http://projects.camlcity.org/projects/findlib.html


4) post-doc position available at MSR-INRIA joint lab
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00194.html


** Damien Doligez announced:

Research team: Tools for Proofs, MSR-INRIA Joint Centre
===

The Microsoft Research-INRIA Joint Centre is offering a 2-year
position for a post-doctoral researcher to contribute 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-02-21 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of February 14 to 21, 
2012.


1) interval trees
2) browsing the code while reading the doc
3) Some utilities about camlp4
4) Other Caml News


1) interval trees
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00114.html


** Continuing the thread from last week, Francois Berenger announced:

I did a naive implementation of interval trees for float intervals.

It is available here:
https://github.com/HappyCrow/interval-tree


2) browsing the code while reading the doc
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00116.html


** Francois Berenger asked and bluestorm replied:


It would be really cool when while looking at the HTML doc
it would be possible to click somewhere so that the implementation
code unrolls under the doc text.

Because sometimes the text is not explicit enough,
some other times there is no text.

Hoogle has such feature and it was pretty useful when
I was coding in Haskell (maybe especially useful
because I was a beginner in that language), for example:

http://www.haskell.org/hoogle/?hoogle=map

Just click on map to have a look at the corresponding implementation.


We delegate documentation production to the standard ocamldoc tool,
which doesn't have this feature, so that is not really in the game
zone of batteries developers. That said, it *could* be possible to
make that feature available without changing ocamldoc upstream, by
implementing it as a custom documentation formatter -- ocamldoc has a
flexible architecture in this regard.
  http://caml.inria.fr/pub/docs/manual-ocaml/manual029.html#toc120

Xavier Clerc has some experience tuning ocamldoc (
http://argot.x9c.fr/ ;), maybe he could comment on the feasibility of
this. You could ask on the caml-list, maybe cc-ing him. If you wished
to have a try at it directly, looking at how Argot is implemented
would be a good source of inspiration.

(There used to be a custom documentation generator for Batteries, but
afaik. we mostly ditched it because, while it was nice, it made
documentation generation time impossibly slow...)

** Maxence Guesdon suggested:

If you provide the .ml files to ocamldoc and use the -keep-code option,
generated html pages will give a link on each value to display the
corresponding code.

Another solution would be to adapt the odoc_literate custom generator 
you

can find here:
  https://gitorious.org/ocamldoc-generators
This generator provide an expand/collpase button for each value, useful 
when

writing doc in a literate programming way.

At last, since Dynlink now allows loading native code, ocamldoc now
supports loading custom generators compiled to native code, which may be
fast enough to use the batteries legacy generator.

** Gerd Stolpmann also suggested:

Before you start writing a total new custom formatter (which probably
breaks with every major OCaml version because of new syntactic 
elements),

consider to extend/override the standard formatter. I did that quite
successfully for the PXP documentation. The derived formatter is here:

https://godirepo.camlcity.org/svn/lib-pxp/trunk/tools/src/odoc/chtml.ml

(Note that for current OCaml you need to remove the { from the matched
strings in html_of_custom_text.)

When I developed this, I found the documentation in the OCaml manual as
insufficient. You really need to dive into the sources of ocamldoc,
especially odoc_html.ml (which is lengthy but easy to get). I guess for
the effect you want you have to override
create_fully_qualified_{module_}idents_links. The location of a 
definition

in the source code seems to be in deed available, in the m_loc.loc_impl
values that are stored with the records for the various syntactic
elements. Don't know whether it is easy to do, though.


3) Some utilities about camlp4
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00153.html


** bob zhang announced:

  the meta filter distributed with camlp4 is buggy and unmodular, I
put a modular one here
  http://seas.upenn.edu/~hongboz/meta_filter.zip

 building with syntax extension is really easy provided this file
  http://www.seas.upenn.edu/~hongboz/myocamlbuild.ml
It works with .inferred.mli, .pp.ml as well

** Gabriel Scherer asked and Hongbo Zhang replied:


I had trouble being sure what meta filter you were talking about.
Here's what I found out, in case other people on the list wondered the
same: the meta part of Camlp4 is about turning a value into a piece
of OCaml AST representing the syntax of this value. The meta filter
is 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-02-07 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of January 31 to 
February 07, 2012.


1) Plasma-0.6 (Map/Reduce  distributed filesystem)
2) New ARM backend merged into trunk
3) llpp video
4) Other Caml News


1) Plasma-0.6 (Map/Reduce  distributed filesystem)
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg4.html


** Gerd Stolpmann announced:

I've just released Plasma-0.6, a major update of Plasma with numerous
changes. The most important:

 * For checking map/reduce out, there is now a mode that works without
   distributed filesystem, and that does not require any deployment.
   The files are just stored in the normal filesystem. Of course, the
   job can then only run on a single computer, but at least it can
   take advantage of multiple cores.

 * Added the Mapred_toolkit layer. This layer allows purely functional
   map/reduce programs. Running a job is only a matter of calling
   a function like

   val mapl_sort_fold :
mapl:(mapred_info - 'a - 'b list) rfun -
hash:(mapred_info - 'b - int) rfun -
cmp:(mapred_info - 'b - 'b - int) rfun -
initfold:(mapred_info - int - 'c) rfun -
fold:(mapred_info - 'c - 'b - 'c * 'd list) rfun -
?finfold:(mapred_info - 'c - 'd list) rfun -
partition_of:(mapred_info - 'b - int) rfun -
?initcombine:(mapred_info - 'e) rfun -
?combine:(mapred_info - 'e - 'b - 'e * 'b list) rfun -
?fincombine:(mapred_info - 'e - 'b list) rfun -
'a Place.t -
'd Place.t -
config -
'b Place.codec -
  ('d,[`W]) Seq.seq list result

 * Support for binary file formats

 * The sorting criterion can now be freely defined

 * Support for combiners

 * Map-only jobs are now possible

 * The RPC channels for controlling the job execution are now also
   privacy-protected. Plasma can now be run in a highly secure mode,
   where all network traffic is authenticated, encrypted and integrity-
   protected.

 * Support for counters

 * Enormous performance improvements

 * A number of bug fixes and improvements of the robustness

 * Last but not least, there is now a lot more documentation including
   a quickstart guide, the toolkit howto, various session
   transcripts.


General information about Plasma:

Plasma consists now of three parts, namely PlasmaFS, PlasmaKV, and 
Plasma

Map/Reduce:

  * PlasmaFS is a distributed replicating filesystem. Unlike other
such filesystems, it is transactional and exhibits transactions
to the user. Also, it implements almost all of what is known as
POSIX semantics, and it is mountable.
  * PlasmaKV is a key/value database on top of PlasmaFS. It is
designed for ultra-high read workloads, and offers interesting
properties borrowed from PlasmaFS (e.g. replication and ACID
transactions).
  * Plasma Map/reduce implements a variant of the popular
data processing scheme.

All pieces of software are bundled together in one download. The
project page with further links is

http://projects.camlcity.org/projects/plasma.html

There is now also a homepage at

http://plasma.camlcity.org

THIS IS NOW A BETA RELEASE! I'm searching for testers. Whoever has
access to a cluster please check Plasma out!

Plasma is installable via GODI for Ocaml 3.12.

For discussions on specifics of Plasma there is a separate mailing list:

https://godirepo.camlcity.org/mailman/listinfo/plasma-list


2) New ARM backend merged into trunk
Archive: 
https://sympa-roc.inria.fr/wws/arc/caml-list/2012-02/msg00011.html


** Benedikt Meurer announced:

I just merged the latest patch for my new ARM backend into trunk 
(revision

12124). Compared to the old ARM backend, the new one does the following:

- Support for both software and hardware floating-point (VFPv3).
- Properly supports interworking with Thumb/Thumb-2 code for both OCaml 
and C

code.
- Supports dynamic linking and large memory models (PR#5049).
- Optional support for position-independent code via a command line 
option

-fPIC. This is disabled by default and not required for natdynlink.
- Can emit both ARM and Thumb-2 code, with avg. code size savings of 28% 
for

Thumb-2 (quite close the optimal 30% advertised by ARM Ltd.).
- Supports both AAPCS (armel) as well as extended VFP calling 
conventions

(armhf).
- Supports several special ARM instructions to reduce code size and 
latency.

- Uses standard ARM EABI runtime functions instead of relying on GCC
internals.
- Supports exception backtraces.
- Supports profiling using gprof.

It'd be great to get some early feedback / testing (esp. with the 
upcoming
Debian/Ubuntu armhf port). Note 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2012-01-10 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of January 03 to 10, 2012.

1) On packaging
2) Understanding usage by the runtime
3) Core (and associated libraries) on bitbucket!
4) ocamlbrew
5) Camomile 0.8.4
6) mlvalues.py
7) Camlp5 new rel 6.03 - compat with OCaml trunk
8) OCamlSpotter 1.4.0 for OCaml 3.12.1
9) Other Caml News


1) On packaging
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-01/msg00033.html

** Deep in this thread, Edgar Friendly said:

I have, and the result is odb[1]. It backends with oasis-db[2], meaning if you
upload your oasis package, it will be installable via odb, including
deps. After finding out about barbra[3], a similar project with a different
starting point, I stole many of their good ideas, and now have support for a
local `packages` file that provides metadata for packages not available
through oasis-db. This packages file allows installation of packages available
from arbitrary URLs (anything curl-able), git, svn, cvs, hg, darcs, as well as
local directories.

For a large number of package examples (plus non-examples of packages that
fail to auto-install through make/omake/oasis), look here:
https://github.com/thelema/odb/blob/master/packages

Contributions of additional packages welcome, fixes to the programs that don't
auto-install (See the bottom half of the packages file) are doubly welcome.

E.

[1] https://github.com/thelema/odb
[2] http://oasis.forge.ocamlcore.org/oasis-db.html and
http://oasis.ocamlcore.org/dev/odb/
[3] still in stealth mode, maybe I shouldn't have stolen their thunder by
mentioning them
  

2) Understanding usage by the runtime
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-01/msg00037.html

** Deep in this thread, Richard Jones said and Damien Doligez added:

 Is compaction disabled?  lablgtk disables it unconditionally by
 setting the global Gc max_overhead (see also the Gc documentation):
 
  src/gtkMain.ml:
let () = Gc.set {(Gc.get()) with Gc.max_overhead = 100}

Anyone who disables compaction should seriously consider switching
to the first-fit allocation policy:

  let () = Gc.set {(Gc.get ()) with Gc.allocation_policy = 1}

This may slow down allocations a bit, but the theory tells us that
it completely prevents unbounded fragmentation of the OCaml heap.
  

3) Core (and associated libraries) on bitbucket!
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-01/msg00059.html

** Yaron Minsky announced:

For those who are interested in getting a look at a development version of the
next release of the Core suite of OCaml libraries, Core is now hosted on
bitbucket.

   http://bitbucket.org/yminsky/ocaml-core/wiki/Home

We're still working on making installation smoother and easier, as well as
solving portability problems.  But please take a look.  There's also a
discussion list:

   http://groups.google.com/forum/#!forum/ocaml-core

This represents a new and more open development model for us, and we hope that
as a result we'll be able to better interact with and accept patches from the
community, and that Core will become a base that many people can use for
building OCaml applications.
  

4) ocamlbrew
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2012-01/msg00062.html

** Hezekiah M. Carty announced:

I would like to announce ocamlbrew, a (very simple, very alpha) tool
for automating and managing builds of OCaml, findlib, and other
OCaml-related items under $HOME on Linux.  ocamlbrew takes it name and
a bit of wrapper code from perlbrew[1].  ocamlbrew provides a thin
bash wrapper around the standard OCaml + findlib build procedure,
taking advantage of odb[2] for further library and tool installations.

ocamlbrew currently lives on github:
https://github.com/hcarty/ocamlbrew

With one command[3] ocamlbrew can build OCaml, findlib, oasis, utop,
Batteries, and ocamlscript from source, plus get an easily source-able
file to set up your environment.  Everything will be built and
installed under $HOME/ocamlbrew by default.

ocamlbrew can also be used to build OCaml from any branch on the
official Subversion server.  At this time I recommend using the -f
ocamlbrew flag with builds coming from Subversion due to some
incompatibilities between OCaml development versions and oasis.  The
-f flag tells ocamlbrew to only install OCaml, findlib, and odb.ml,
skipping other tools and libraries.  This will hopefully 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-12-20 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of December 13 to 20, 2011.

1) Some comments on recent discussions
2) how could the community help with Oasis-DB; towards a CPAN for OCaml?
3) New experimental ARM backend
4) Don't forget the user
5) About the mingw port of OCaml
6) OCaml maintenance status / community fork (again)


1) Some comments on recent discussions
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00317.html

** Deep in this thread, Alain Frisch said and Jonathan Protzenko replied:

 A few points:
 
 1. It would be useful to have a completely standalone binary distribution of
 ocaml (with ocamlopt) under Windows. This can be achieved either with little
 development efforts by extracting the minimal needed subset of an mingw
 toolchain (an assembler, a linker, some libraries and object files to link the
 main program); or with a little bit more effort, by avoiding the need for an
 external toolchain altogether. I insist: most users of OCaml under Windows
 won't need a C compiler or Unix-like tools.

I'm considering doing that with the next version of my ocaml installer,
because this has been raised quite a few times on this list already.

 2. Binary packages for OCaml libraries could be simple .zip files to be
 extracted at a precise place (under the hierarchy created by the OCaml binary
 installer itself); or maybe even Windows installers. If installing a library
 only amounts to clicking on a link in a web page and run the installer, it
 already makes the life of the casual user much easier. We don't necessarily
 need a full-blown packaging system, with dependency tracking, versioning,
 automatic download, etc.

Sure. I've discussed including findlib in the installer for windows [1] so
that people can easily install third-party libraries and have them recognized.

Cheers,

jonathan

[1] https://github.com/protz/ocaml-installer/issues/4
  

2) how could the community help with Oasis-DB; towards a CPAN for OCaml?
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00332.html

** Deep in this thread, Gabriel Scherer asked and Sylvain Le Gall replied:

 Edgar, It's excellent to know that you have some knowledge of Oasis-DB.

 I share the common assumption that this is one of the missing bricks
 of the OCaml ecosystem, and I hope the community at large can help
 with it. I asked Sylvain about it a few months ago, but he wasn't sure
 at that time what was the best way to help. With him now having less
 time available, I was afraid things could stall on that front.

Well things is now less stalled than before my new job. I have pushed a
couple of patches in oasis darcs repository and I am working to deliver
a oasis 0.2.1 sooner or later.

 Could you (or Sylvain) make a more precise picture of how exactly the
 community could help in the Oasis-DB effort?

See above.


 Is the priority to upload package (then maybe the warning on the
 webpage advising not to do it seriously should be changed), or are
 there other things we could help with, for example development
 aspects? 

You can upload packages to the server. They won't be lost. The main
point of the dev server DB is for the OCaml community to see if the
service is useful. I won't commit myself into delivering a long term
production server if nobody thinks it is useful.

Helping me to debug by uploading package to oasis-db has 4 good effects:
- you use oasis in you project and you can debug it/help me improve it
- you allow other projects to use your package to test oasis-db (e.g odb.ml)
- you increase the visibility of oasis-db and people gradually thinks it
  is a good solution
- it cheers me (ok seems like dumb, but that motivates)

Concerning the dev. aspect see above.

 Who/where should we ask for advice/help when we have issues?

Either you can create a bug in the BTS (or a feature request), send a
mail to 
oasis-devel AT lists.forge.ocamlcore.org,
 have a
chat on #ocaml IRC on freenode (more and more people are able to answer
your question on OASIS here) or send me an email. This should be the
last option because the discussion won't be public.

 It would really help, I think, if:
 - there was a list somewhere of things other people can contribute

Well there is:
http://oasis.forge.ocamlcore.org/contribute.html

 - you talked more about the progress of the effort (I discovered
 'odb.ml' by absolute chance a few weeks ago, while I follow almost all
 OCaml-related information channels); if people don't know about your
 work, they won't contribute

odb.ml was started by thelema and it remains his project, I let him
communicate on that. But you can see on the home page of oasis-db a link
to odb.ml that directs 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-12-13 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of December 06 to 13, 2011.

1) A busy week on the Caml mailing list
2) OCaml maintenance status / community fork
3) OCaml-rdf
4) Storing ocaml values outside ocaml's heap
5) Generic printer patch
6) LLVM and OCaml status
7) perfect syntax coloring in emacs
8) On packaging
9) About the mingw port of OCaml
10) Other Caml News


1) A busy week on the Caml mailing list

** The editor says:

As there has been a huge spike of traffic on the Caml mailing list
this week, I have had to select just a few messages to reproduce here
to keep this summary short. If you want to read everything that has
been said, here are a some links to the threads. I apologize in
advance if I missed a message that should have been included.

The initial threads, from which I'll quote a few messages below,
were about forking OCaml:
https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00018.html
https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00106.html

They spawned another thread about the community in general:
https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00046.html

Another thread was about whether or not using C as a backend:
https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00141.html
 
Finally, Gabriel Scherer wrote a long email about Camlp4 and Camlp5,
which spawned some discussion about their maintenance status and
possible alternatives:
https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00214.html
  

2) OCaml maintenance status / community fork
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-12/msg00018.html

** Benedikt Meurer said:

During the last year or two it seems that time and interest in OCaml 
maintenance from the official OCaml development team is diminishing. It takes 
several months to get a patch reviewed (if at all), which is quite 
frustrating for OCaml contributors and even worse for OCaml users. I suspect 
that this is one of the top reasons why there are only a few active 
contributors to OCaml (and the number of active users, at least on the 
mailing list, is declining).

I understand that INRIA does not necessarily pay people for full time 
maintenance jobs on OCaml (and Coq), and the official dev team is probably 
already doing as much as possible to maintain OCaml. Given that OCaml is such 
a nice language with a lot of useful frameworks available, it is too sad to 
see it loosing ground just because of it's closed development process and 
lack of time of the official team.

I'd therefore propose to open up OCaml development to a wider range of 
developers / contributors, to ensure that OCaml will be ready for the 
(functional programming) future. There are already various OCaml forks in 
the wild, with different goals and patch sets, so simply starting another 
fork would be rather useless. Instead I'd suggest to bundle efforts in a new 
OCaml community fork, which is always based on the most recent upstream 
OCaml release (starting point would be 3.12.1 for now), and takes care to 
review and integrate pending patches as well as developing and testing new 
features. Let's say we'd name the fork OCaml-ng, then we'd try to release a 
new patch set every month or two, based on the official OCaml release, i.e. 
ocaml-3.12.1+ng201112 and so on, to get early testing and feedback (should 
work together closely with the Debian/Ubuntu/etc. OCaml maintainers).

With this process, OCaml upstream could merge (tested) patches from OCaml-ng 
once they proved working in the wild, and thereby

1. maintenance overhead for INRIA people is reduced,
2. maintenance status of OCaml would be way better,
3. there would be a lot less frustration for possible contributors, and
4. users benefit from a better and more up to date OCaml.

Now that does of course raise a few questions:

1. What is the opinion of the official development team / INRIA on this?
2. Who would help with the community fork?
3. What about infrastructure?
  
** Xavier Leroy replied:

 Maybe we can get back to my original proposal and restart on the
 right foot this time?

All right.  I have a number of concerns about your proposal, most of
which have already been mentioned by others.  Whether you call it a
fork or not, the mere fact of having two separate code bases for
exactly the same software components raises more issues than it solves:

- It complicates the lives of OCaml users, packagers, and 3rd-party
  library developers: what version should they use?  what will be the
  basis for the packagers's distribution-specific patches?  what
  happens if a library is compatible with one version but not the
  other?  what if the community effort runs out of steam in a 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-10-25 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 18 to 25, 2011.

1) MP3 Tag Editing
2) How to write an efficient interpreter
3) Research Engineer at Monoidics, London, UK
4) Other Caml News


1) MP3 Tag Editing
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00101.html

** David Allsopp asked and Maxence Guesdon suggested:

 I have a slightly strange piece of re-tagging to do to some MP3s and was
 having a quick look to see if there were any OCaml libraries/bindings for
 reading and writing ID3v1 and ID3v2 tags.
 
 A cursory glance revealed MP3tags on the hump but its dependencies seem to
 be out of date and it wasn't clear that I'd be able to build it in a newer
 ocaml because of camlp4 problems...
 
 Can anyone recommend a library?

You can give a try to mp3tag:
  http://www.nongnu.org/mp3tag/
I just commited a compilation fix to use lablgtk-extras library[1]. You
must checkout the CVS trunk:
  cvs -z3 -d:pserver:anonymous AT cvs.savannah.nongnu.org:/sources/mp3tag
 co mp3tag
  
** Romain Beauxis also suggested:

For not too particular id3 uses, ocaml-taglib is up-to date and functional:
  http://savonet.sourceforge.net/modules/ocaml-taglib/Taglib.html
  

2) How to write an efficient interpreter
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00107.html

** Diego Olivier Fernandez Pons asked:

I have to write an interpreter for a datatype rich purely applicative
language. I have already written a naive interpreter (like in
programming languages class) and was wondering what where the options
for writing something that would perform better while keeping it
maintainable by a single person  5% dedicated and preferably only in
core-ML (no C code or fancy ML extensions).

The language could be described as a rich datastructure typed SQL with
a programming language syntax
- first class sets, arrays, dictionaries, lists and their
corresponding comprehensions
- tuples and records merged into a single concept (accessible per
position like in (x, y) = ... or per label like in for t in tupleSet
if t.label == 3 then)
- only applicative functions (no lambda operator, no partial
application)
- simple types are int, double and string
- only user declared types are tuples-records

It is mainly used for data transformation : take a list of countries,
extract from an database the international airports of those
countries, geolocalize them using city/location table, generate a
distance table using a great-circle distance, assign to each size of
plane the legs they can do based on their maximum fight range, etc.

The language has a _javascript_ inline capability

execute _javascript_ { 
//write your _javascript_ code here 
}

that's typically used to define functions, unroll comprehensions to
make them more efficient and to call external libraries (_javascript_
has full visibility on all the language objects and can read/write
directly inside, probably the existing interpreter was written in
_javascript_), so I am considering allowing those features in the core
language and only supporting a very slow _javascript_ deprecated
compatibility mode.
  
** Gabriel Scherer suggested and Gerd Stolpmann added:

 Even staying at the interpreter stage, you can probably improve your
 performance seriously by being careful about your implementation : use
 efficient data structure (what is your implementation of variable
 lookup?), avoid unnecessary allocation, use tail-recursive functions
 where possible, etc. Try to find a time-consuming script example that
 exercise the type of computations you'll usually perform, and profile
 your interpreter with gprof (compiled natively), try to optimize the
 parts that show high in the profile, rinse and repeat.
 
 The natural next step is to use a bytecode instead of interpreting an
 AST directly. You can probably find something relatively simple and
 yet have a net efficiency gain over direct interpretation, because the
 bytecode structure is more linear and can be interpreted more
 efficiently; in a way, you compiled away the tree traversal. 

Well, I wouldn't be too optimistic that this also works for an
interpreter written in Ocaml. Bytecode profits a lot from cache
locality, i.e. all bytecode instructions in a single cache line are
loaded at once from RAM. Cache lines are short, though, usually only 64
bytes. If the bytecode is an int array, this translates to 8 or 16 array
elements (64/32 bit platforms). If you stick to the int array, you
probably get the performance benefit, but you have to live with the
integer representation, which will make other parts of the interpreter
difficult (e.g. representation of values). If you 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-10-18 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 11 to 18, 2011.

1) Plasma MapReduce, PlasmaFS, version 0.4
2) msvc ocaml 3.12.1 installer
3) PG'OCaml now hosted at the OCaml Forge
4) Other Caml News


1) Plasma MapReduce, PlasmaFS, version 0.4
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00061.html

** Gerd Stolpmann announced:

I've just released Plasma-0.4. Plasma consists of two parts (for now),
namely Plasma MapReduce, a map/reduce compute framework, and PlasmaFS,
the underlying distributed filesystem.

Major changes in version 0.4:

  * Added a security system (including strong authentication, and
authorization). This is a quite big change, and makes PlasmaFS a
highly secure DFS.
  * Datanodes are now monitored, and failed nodes are automatically
considered as unavailable. The monitoring system uses multicast
messaging.
  * The namenode can now profit from multi-processing, removing a
potential bottleneck.
  * Improved the caching subsystem.
  * Better management of file buffers in map/reduce jobs.

Of course, there are also numerous bug fixes and performance
improvements.

Plasma MapReduce is a distributed implementation of the map/reduce
algorithm scheme. In a sentence, map/reduce performs a parallel List.map
on an input file, sorts and splits the output by some criterion into
partitions, and runs a List.fold_left on each partition. Only that it
does not do that sequentially, but in a distributed way, and chunk by
chunk. Because of this Plasma MapReduce can process very large files,
and if run on enough computers, this also will work in reasonable time.
Of course, map and reduce are Ocaml functions here.

This all works on top of a distributed filesystem, PlasmaFS. This is a
user-space filesystem that is primarily accessed over RPC (but it is
also mountable as NFS volume). Actually, most of the effort went here.
PlasmaFS focuses on reliability and speed for big blocksizes. To get
this, it implements ACID transactions, replicates data and metadata with
two-phase commit, uses a shared memory data channel if possible, and
monitors itself. Unlike other filesystems for map/reduce, PlasmaFS
implements the complete set of usual file operations, including random
reads and writes. It can also be used as unspecialized global
filesystem.

Both pieces of software are bundled together in one download. The
project page with further links is

http://projects.camlcity.org/projects/plasma.html

There is now also a homepage at

http://plasma.camlcity.org

This is an early alpha release (0.4). A lot of things work already, and
you can already run distributed map/reduce jobs. However, it is in no
way complete.

Plasma is installable via GODI for Ocaml 3.12.

There is now a chart comparing Plasma with Hadoop. In one sentence,
PlasmaFS bases on a superior filesystem design, and has now to prove
that the implementation is really working. Plasma map/reduce generalizes
the algorithm scheme compared with Hadoop, but has still some
shortcomings in the implementation:

http://plasma.camlcity.org/plasma/dl/plasma-0.4/doc/html/Plasmafs_and_hdfs.html

http://plasma.camlcity.org/plasma/dl/plasma-0.4/doc/html/Plasmamr_and_hadoop.html


For discussions on specifics of Plasma there is a separate mailing list:

https://godirepo.camlcity.org/mailman/listinfo/plasma-list
  
** He later added:

There is now even plasma-0.4.1, fixing some performance bugs.

Also, there are now some simple performance numbers:

http://plasma.camlcity.org/plasma/perf.html
  

2) msvc ocaml 3.12.1 installer
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00064.html

** Karl Moerder asked and Jonathan Protzenko replied:

 There is a link on the ocaml download page that points to
 
 http://caml.inria.fr/pub/distrib/ocaml-3.12/ocaml-3.12.1-win-msvc.exe
 
 but the file is not there. When will it be available?

Last time Xavier and I discussed this, there were no plans to provide
an official installer for the MSVC toolchain. There's already an
official installer for the MingW32 toolchain
http://yquem.inria.fr/~protzenk/caml-installer.html, so you are
encouraged to use that one. If you really have to use the MSVC one,
I'd be interested in hearing why.

If you or anyone else is interested in maintaining an MSVC build, feel
free to reuse my installer script
(https://github.com/protz/ocaml-installer).
  

3) PG'OCaml now hosted at the OCaml Forge
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00071.html

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-10-11 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of October 04 to 11, 2011.

1) Pycaml
2) Native toplevel test release 3.12.1+ocamlnatjit2
3) FPish - bridging FP communities
4) Frama-C Nitrogen-20111001
5) Other Caml News


1) Pycaml
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00026.html

** Thomas Fischbacher announced:

I've just made updated Pycaml packages available under:

http://www.soton.ac.uk/~doctom/software/pycaml/index.html

Note that this now contains a module Pycaml.Nicerpy which is
intended to export only functionality that comes with
interfaces we feel reasonably good about. (Parts of the
Pycaml module - unfortunately some which may actually
be used by third parties - actually feel quite a bit
weedy.)

The web page shows some examples demonstrating the use
of Pycaml.Nicerpy.
  

2) Native toplevel test release 3.12.1+ocamlnatjit2
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00029.html

** Benedikt Meurer announced:

After some more testing and bug fixing, we're happy to announce another test 
release of OCaml with our new native code toplevel. The test release includes 
a fully featured OCaml 3.12.1 distribution plus our new toplevel ocamlnat, 
which is up to 100 times faster than the byte code toplevel. See the website 
for installation instructions and additional information.

Website:
http://benediktmeurer.de/ocaml-experimental

Download:
http://benediktmeurer.de/files/source/ocaml-3.12.1+ocamlnatjit2.tar.bz2

Git repository:
https://github.com/bmeurer/ocaml-experimental

Suggestions, comments and bug reports are welcome.
  

3) FPish - bridging FP communities
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-10/msg00041.html

** Adam Granicz announced:

FPish (http://fpish.net) is a brand new community site for functional
programmers, just launched this week with over 1500 users and growing
fast.  It aims to provide a wealth of information, and to collect and make
easily searchable any FP events (conferences, webcasts, trainings, etc.),
courses, blogs, user groups, companies, developers, jobs, questions and
answers, basically everything we functional programmers and those who are
looking to become functional programmers might be interested in.  There
are a ton of additional features in development - professional networking,
a fast blog engine, community trends based on tweets and blogs, a jobs and
careers section, just to name a few - these are rolled out continually.
 
We have just started to populate the event and group catalogs, and are now
inviting all of you to contribute what you can.  In particular, we are
inviting you to use FPish to share content in the forums (under Answers)
that might help others learning OCaml.  Feel free to post your projects,
or share what you are working on, or simply ask or answer questions -
anything you contribute will help someone.  Be sure to tag your content
with OCaml (case insensitive) and any other tag you may find appropriate
- so that others can find it more easily.  Doing so will ensure that your
contributions show up in the OCaml zone - basically, a subspace of FPish
dedicated to OCaml.
 
Once you register, you can not only post forum content, you can also
create OCaml user groups that others can join or follow (a good
alternative to meetup.com), organize events such as webcasts or meetups
(you can soon be able to charge and collect money for them too if you need
sponsorship), add and manage conferences (with everything from talk
proposals to adding/scheduling speakers and talks), and add your companies
(with a bit of manual help from us) to gain more visibility.  You can also
create your developer profile, and others will be able to find you under
Developers - this is a brand new feature just released.
 
If you would like to get involved as a FPish OCaml community leader or
moderator please drop me a message directly.  Community leaders shape the
public facing of their communities, and have complete control over the
markup on the OCaml zone (and can use building blocks such as forums,
event listings, etc.) and are in charge of reflecting all the happenings
(events, groups, conferences, etc.) in the community.
 
Your comments and ideas are very welcome.  There will also be an API
available shortly for doing searches and adding new content.  One
intriguing project would be to catalog the full caml-list archives, making
it readily searchable and accessible via the API - anyone interested in
helping out please get in touch.
  

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-09-27 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of September 20 to 27, 2011.

1) Ocsigen 2.0
2) lablqt = OCaml + qt
3) Job opportunities at Citrix Systems (Cambridge, UK)
4) Other Caml News


1) Ocsigen 2.0
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-09/msg00170.html

** Vincent Balat announced:

We are very happy to announce the release of the version 2.0 of the
Ocsigen framework. After more than 6 years of development, we achieved
our goal to provide a complete framework to program Web sites and
client/server Web applications fully in OCaml.

More information and download from http://ocsigen.org

Main features:
 - Powerful mechanisms to implement traditional Web interaction very easily
(links, forms, bookmarks, back button ...).
 - A compiler from OCaml to Javascript to write the client side parts
of your programs in OCaml.
 - Integrated client/server programming in one single program, with
automatic communication between server and client.
 - Validation of HTML at compile time.
 - Powerful session mechanism
 - Persistant client side programs: you can mix client side features
with traditional Web interaction. The program does not stop when you press
a link!

The documentation is now mostly complete. We are currently working on
adding the few missing parts and proof reading everything. Current
version is available online and a more polished version will be released
as a PDF book in a few weeks. The good starting point for learning
Ocsigen is the tutorial: http://ocsigen.org/tutorial/

Please report any problem with current version or in documentation
through the bug tracking system, the mailing list or the IRC channel.

The Ocsigen framework combines many software projects (all open source),
that can be used independently:
 - Ocsigen server: an extensible Web server
 - Eliom: a framework for Web programming in OCaml
 - Js_of_ocaml: a compiler from OCaml bytecode to Javascript
 - Lwt: a cooperative threading library
 - Macaque: a library for type safe database queries
 - O'Closure: a binding for the Google closure widget library
 - etc. The full list of our projects is available here:
http://ocsigen.org/projects

Ocsigen is a research project of the PPS laboratory (CNRS, université 
Paris-Diderot) (http://www.pps.jussieu.fr), hosted at IRILL 
(http://www.irill.org). It receives funding from the ANR (PWD project)
(http://www.agence-nationale-recherche.fr).

We hope that you'll enjoy this version!
  

2) lablqt = OCaml + qt
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-09/msg00174.html

** Kakadu announced:

I'm working on Qt bindings for OCaml. You can browse my code at
https://github.com/Kakadu/lablqt

Now qtjambi parses Qt's header files and generates an XML
representation of API. Then binding generator generates OCaml and C++
code of bindings.

Now a big part of Qt's API is stored in aaa.xml, so you don't need to
install qtjambi's generator. Big part of QtCore É QtGui is
incapsulated in this xml file.

You can use build.ml script to compile lablqt. Btw, lablqt depends on
janestreet's core_extended library.

You can see test examples in test_gen/test* directories. For examle:
https://github.com/Kakadu/lablqt/blob/master/test_gen/test5/main.ml

I've implemented almost type-safe connections from signals to
slots. Also I've created tool
(https://github.com/Kakadu/lablqt/tree/master/moc) to simplify
creating of user-defined slots: you can connect them like here
(https://github.com/Kakadu/lablqt/blob/master/test_gen/test4/main.ml#L27)
and write your code separately
(https://github.com/Kakadu/lablqt/blob/master/test_gen/test4/UserSlots.ml#L2).

Lablqt is compilable only on a few number of machines, so I'll be glad
if you test it on your computer.

It's difficult to me to decide in what direction Qt bindings should be
developed. I you have any ideas or recommendations, I'll be glad to
read them.
  

3) Job opportunities at Citrix Systems (Cambridge, UK)
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-09/msg00186.html

** Mike McClurg announced:

I just wanted to let everyone know that Citrix is hiring developers to
work on the OCaml-based XenAPI toolstack.

We are looking to recruit top-class engineers to work on the toolstack;
applicants must have a good knowledge of data structures and algorithms,
experience of programming in the context of large systems and general
aesthetic good taste when it comes to code and architecture.

Our code base is significant and varied: over 130,000 lines of OCaml,
solving problems ranging from the 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-09-06 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of August 30 to September 06, 
2011.

1) Ocaml and the Fragile Base Class Problem
2) Jane street's core (et al.) post-hurricane code release
3) Esterel Technologies recrute un Ingénieur en développement Ocaml
4) MediaWiki welcomes OCaml coders  reviewers - help Wikipedia display math 
better
5) Conditionally boxed 32 bit integers?
6) ocaml munin plugin example
7) Job offer: OCaml research engineer
8) Other Caml News


1) Ocaml and the Fragile Base Class Problem
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-08/msg00245.html

** Continuing the thread from last week, Alain Frisch replied to Jacques 
Garrigue:

 If you want just to structure your program, modules are better in most cases.
 There are still situations where classes are stronger than modules for 
 structuring:
 * when you have a default for some operation, but want to be able to change it
 * when you want to mix components, using multiple inheritance and virtual 
 methods and instance variables

I second that. We are moving some parts of our code base to a mixin
style implemented with multiple inheritance, virtual methods,
constraints, very rare overridding (and no instance variables). This
results in drastic reduction of code size compared to our previous
approach where code sharing between components was implemented with
simple function calls. The code is also easier to evolve.

We create objects (without state) to represent bags of properties
computed from parameters; each method represents a property. An object
is created by assembling reusable mixins (inheritance) and
implementing remaining virtual methods. Once the object is created, we
observe a few properties and throw the object away. In effect, we use
objects to describe purely functional computation graphs, with
reusable sub-graphs. (Most methods don't take argument; in order to
avoid repeated evaluation, we have a special hack which rewrites an
object's method table so as to give its methods a lazy behavior.)

The nice thing with this approach is that the object layer does all
the plumbing automatically. Combining several reusable components does
not require to pass data around from one component to another
explicitly. The old style with functions required to pass many
arguments, deconstruct the result (a component typically computes
several things), organize reusable components to avoid mutual
recursions, and define many data types (records to represent the
result of components). In some cases, a large amount of the code was
caused by such plumbing.

 Also, for various reasons, objects are not beginner friendly.
 I think the main problem is that they don't fit that well with type inference:
 both subtyping and polymorphic methods require explicit type annotations.

Time to advertise the implicit-subtyping branch?
  
** Jacques Garrigue then replied:

Indeed the implicit-subtyping branch helps: if the compiler knows all
the types, it doesn't force you to write a coercion by hand.  On the
other hand, this is only a partial solution, as my comment was on the
lack of principality: you still need type annotations in many cases.
Constraint-based type inference might recover this principality, but
since the types inferred get even worse than with structural object
types, I'm afraid this is not really practical. (It might work better
with nominal subtyping.)
  

2) Jane street's core (et al.) post-hurricane code release
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-09/msg2.html

** Till Varoquaux announced:

This release comes right after an earthquake and a hurricane so you
know this is going to be strong stuff!
This is our latest and greatest release of Jane street Core and
supporting libraries. For this release we've decided to move towards a
versioning scheme that is more coherent to our internal system so
everything is version 107.01.
With this release Sexplib Typeconv and Bin-prot are no longer
included. This is because we've merged back with Markus's version and
now release them from ocamlforge. They are packaged with oasis thus
bringing you the easiest to build, most portable release yet.
Sexplib and Bin-prot have had version bumps to fix compatibility
issues found while packaging Core. You should grab the latest version
while they are hot at:

_Sexplib (7.0.2) : https://forge.ocamlcore.org/projects/sexplib/
_Bin-prot (2.0.3): https://forge.ocamlcore.org/projects/bin-prot/
This release of bin-prot also includes contributions by Stéphane
Glondu to make it portable on all the architectures that debian is
compiled for. Thank you Stéphane!

All the other libraries are download-able from our own webpage

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-08-02 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 26 to August 02, 2011.

1) Hashtbl performance
2) utop 1.0 released
3) Great Renaming
4) Time to register for CUFP
5) Linear Scan Register Allocator for ocamlopt/ocamlnat
6) ocaml puzzles
7) Other Caml News


1) Hashtbl performance
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-07/msg00117.html

** Toby Kelsey asked and Fabrice Le Fessant replied:

 I have written two versions of a small program, one using an (int list) 
 data structure and the other an ((int*int) list); and I tested using 
 Hashtbl, Set and (Jean-Christophe Filliatre's) Trie to cache these elements 
 in each version.
 The relative run times of the programs turns out to be:
 
  Hashtbl  Set  Trie
 (int list) 1  2.1  2.0
 ((int*int) list)  34.72.6  2.1
 
 
 There is a slight inherent speed difference between the 2 versions but the 
 major effect is the cache type (in fact the caching difference must be 
 larger than these ratios due to non-cache computations). I expected Hashtbl 
 might be a bit slower than more specialised data structures, but the large 
 speed difference with different data structures was unexpected. Presumably 
 the slow-down is due to excessive hash collisions.
 
 I had expected that the generic Hashtbl would be written to give adequate 
 speed for all types of data and when I look at OCaml code on the web 
 Hashtbl is usually used, so it seems most OCaml programmers believe the 
 standard Hashtbl is a reasonable choice for most data types as well.
 
 I haven't tested the Batteries or OCaml-Core hash tables so these may be 
 more consistent, but if not, my question is can you predict how well 
 Hashtbl will work for different types of data and so what to use it with, 
 or it is just not reliable enough for general-purpose caching/memoization?
 
 If anyone wants to look at the code, the (int list) Hashtbl version is at 
 http://rosettacode.org/wiki/Sokoban#OCaml and the other versions are in 
 http://pastebin.com/hGn1AL9L temporarily. Apart from the caching and the 
 int/int pair changes they should be identical.
 I think it is a well known bug of the hash function:

let list = ref [];;
for i = 1 to 30 do
  list := i :: !list;
  Printf.printf %d  (Hashtbl.hash !list)
done;;

1 65601 8392706 797307010 578301955 797307010 8392706 65601 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

As you can see, long lists all have the same hash value. It is due to
the fact that the hash function does a depth-first traversal of the
datastructure, starting with the last field, instead of a breadth-first
traversal, and, as it only visits 10 nodes, they are always the same
ones for all lists of length  10.

Thus, you should consider using your own hash function, probably only
considering the ints in the list and its length. Then, use the functor
in the Hashtbl module.
  
** Nicolas Barnier then said:

You could also use the hash_param : int - int - 'a - int
function in the functor which allows to specify the number
of nodes traversed to compute the key :

# let list = ref [];;
  for i = 1 to 30 do
  list := i :: !list;
  Printf.printf %d  (Hashtbl.hash_param 50 50 !list)
done  ;;
1 65601 8392706 797307010 578301955 731304131 182476804 222011652
582000645 696017221 383840262 291574150 409554951 301052359 474071048
875971080 459423753 1026998857 314757130 771437194 56324107 59478731
841228300 921690892 921690892 841228300 59478731 56324107 771437194
314757130 - : unit = ()
  
** Xavier Leroy then added:

Both Fabrice's and Nicolas's suggestions are excellent.

Let me just add that this problem with lists as hashtable keys is one
of the known issues with OCaml's current generic hash function: the
other is that the mixing functions used are simplistic and exhibit
some statistical bias, even for strings.

The SVN trunk for OCaml contains a complete reimplementation of the
generic hash function that addresses both issues: lists and other
complex keys are traversed breadth-first in a more cautious manner
than before, and the mixing functions are based on MurmurHash 3, which
exhibits very good statistical properties.  All this should go in the
next major release 3.13.  So, everyone with an interest in efficient
hash tables is welcome to try the trunk sources and let me know of any
problems encountered.
  

2) utop 1.0 released
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-07/msg00128.html

** Jérémie Dimino announced:

I am pleased to announce the first release of utop, a new toplevel for
OCaml.

utop has two modes; in can run in a terminal or in emacs. In the
terminal it supports real-time completion, colors, parenthesis matching
and 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-07-26 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 19 to 26, 2011.

1) Sawja release 1.3
2) GODI News: 3.12.1 released, new website
3) Other Caml News


1) Sawja release 1.3
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-07/msg00097.html

** Vincent Monfort announced:

We have the pleasure to announce a new release of Sawja, the Static
Analysis Workshop for JAva.

Sawja is a library written in OCaml, relying on the Javalib library,
and providing a high level representation of Java bytecode
programs. Whereas Javalib is dedicated to isolated classes, Sawja
handles bytecode programs with their class hierarchy and control flow
algorithms. Sawja also provides some stackless intermediate
representations of code and static analysis tools that makes analyses
easier.

The main new feature of this release is an Eclipse plugin for analyses
developed with Sawja, which can be integrated into the IDE without
requiring any additional Java code generation. By having these tools
readily available in the leading environment for Java programmers, we
aim at promoting the adoption of advanced static analysis tools in
industrial settings, and at providing a solid basis for
upstream/academic analysis debugging and demonstration.

More information, examples, and a series of tutorials are available at
http://sawja.inria.fr. The Sawja devteam is looking forward to your
questions and feedback on the library.
  

2) GODI News: 3.12.1 released, new website
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-07/msg00104.html

** Gerd Stolpmann announced:

the GODI project just updated the release line for Ocaml-3.12 which
bases now on version 3.12.1. We have done extensive tests, and found
only some minor incompatibilities for ocamlbuild (which is a bit pickier
now and chokes sometimes when it sees extra files it does not know
about). These could be resolved. At the same time, the 3.12 release
loses its beta status (which had it for quite a long time), and is now
the recommended Ocaml version.

GODI also gets a newly designed web site: http://godi.camlcity.org is
now much more illustrative and informative. As a special bonus, a news
feed is included with the newest package releases (right now only as
HTML, RSS will follow later). Also the list of packages has been
reworked and is now fully dynamic (instead of generated).

The new bootstrap for GODI is now available as
http://www.camlcity.org:81/download/godi-rocketboost-20110717.tar.gz
It also got a bit of developers' attention, and is now more intuitive.
(For example, the stage 2 of the bootstrap is now automatically started.
The bootstrap is now interactive by default.) If you do not want to run
another bootstrap, you can also upgrade your existing GODI installation:

* If you already have a 3.12 installation, just follow the normal
upgrade path for packages in godi_console. Ocaml 3.12.1 is a normal
package upgrade here.

* If you still use a 3.11 installation, just edit godi.conf, and replace
the line setting GODI_SECTION, and set this variable to 3.12. Then
perform a package upgrade using godi_console (as above).

There are a few remaining issues with the new version:

- Batteries: It is reported that there is an incompatibility with the
  new Hashtbl signature. It is being worked on this. Currently the
  package is broken. It is recommended that users wait until the
  problems have been resolved.
- Ocamlduce is still unavailable for 3.12.1. This also affects
  dependencies like godi-tyxml.
- After installing GODI on a newly set up system, I found problems
  for godi-mlgmp, godi-fftw, and godi-lablgtk(1), because they
  are out of sync with current C libraries, or the C libraries have
  become unavailable (like gtk1).
- There are a few applications which are still broken:
  apps-felix, apps-nurpawiki, apps-pkglab, apps-regstab. The
  package maintainers are notified.

The documentation archive docs.camlcity.org is still switching to 3.12
as default source for documentation. This means not all package docs are
available yet (but an impressive subset is already). I hope this will be
fixed until tomorrow.

A final word about GODI and OASIS. Sylvain is very interested in
providing the OASIS packages in a format that GODI understands. There is
now the plan that GODI extracts the required information from its
package db, and OASIS uses this to wrap its packages so these can be
included as package source into godi_console. We are now working on
this.
  

3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-07-12 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 05 to 12, 2011.

1) Priority queues, reloaded
2) Atdgen 1.2.0 + tutorial, OMake/Make support
3) Other Caml News


1) Priority queues, reloaded
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-07/msg00064.html

** Deep in this thread, Jon Harrop asked about heaps and priority queues in 
Ocaml and James Woodyatt replied:

I released this years ago.  It's stable, meaning I use it all the
time, and I never touch it.

   https://bitbucket.org/jhw/oni

From the README in the Cf library:

 Highlighted features include:
 
 - Functional streams and stream processors (extended).
 - Functional bootstrapped skew-binomial heap.
 ***
 - Functional red-black binary tree (associative array).
 - Functional sets based on red-black binary tree.
 - Functional real-time catenable deque.
 - Functional LL(x) parsing using state-exception monad.
 - Functional lazy deterministic finite automaton (DFA).
 - Functional lexical analyzer (using lazy DFA and monadic parser).
 - Functional substring list manipulation (message buffer chains).
 - Gregorian calendar date manipulation.
 - Standard time manipulation.
 - System time in Temps Atomique International (TAI).
 - Unicode transcoding.
 - Universal resource identifier (URI) manipulation.
 - Extended socket interface (supports more options, and UDP w/multicast).
 - I/O event multiplexing (with Unix.select).
 - Functional XML stream parsing and generation
 - Functional MIME stream parsing and generation

Among other treasures, it has priority queues built with the bootstrapped 
skew-binomial heaps.

  https://bitbucket.org/jhw/oni/src/ef09a44a61ea/cf/cf_pqueue.mli
  https://bitbucket.org/jhw/oni/src/ef09a44a61ea/cf/cf_sbheap.mli

Nobody knows about my Oni project because I rarely put any effort into 
promoting it, but its Cf library is an excellent alternative to the OCaml 
standard library in many ways.  There is a GODI package for it, of course, 
but the OCaml With Batteries people settled on a more popular alternative 
(and who can blame them) so again nobody knows about it.  Nevertheless, if 
you need the complete array of functional data structures in OCaml, you 
should look at the Cf library I wrote.  It's pretty good.
  

2) Atdgen 1.2.0 + tutorial, OMake/Make support
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-07/msg00050.html

** Martin Jambon announced:

I have the pleasure to officially announce this new release of Atdgen.
Atdgen is a tool that generates optimized OCaml code from type
definitions, primarily for data serialization:

  http://oss.wink.com/atdgen/

Atdgen supports one text format, JSON, and one binary format, Biniou,
which retains most properties of JSON.

  JSON specification: http://json.org
  Biniou specification: http://martin.jambon.free.fr/biniou-format.txt


What's new
--

* a tutorial: http://mylifelabs.github.com/atdgen-tutorial.html

* new command-line modes (-t, -b, -j, -v) and new conventions that make
it easier to split groups of type definitions into multiple files and
OCaml modules. Existing users of Atdgen are encouraged to switch to this
new model, described in the tutorial.

* a validator mode (-v) which produces code that calls user-specified
validators on the nodes of data structures to validate.

* OMake support: https://github.com/MyLifeLabs/atdgen-omake

* GNU Make support: https://github.com/MyLifeLabs/atdgen-make


Development status
--

Atdgen is being developed at MyLife (http://www.mylife.com) where we use
it routinely to process and serve terabytes of rich data.

The source repository is publicly hosted on GitHub:

  https://github.com/MyLifeLabs/atdgen


Technology used
---

* type definition parsing (atd package): ocamllex + menhir
* JSON parsing (yojson package): ocamllex, some Obj
* Biniou parsing (biniou package): handwritten OCaml, some Obj
* pretty-printing (atd, yojson, biniou): easy-format, relying on Format
* not-too-ugly-printing OCaml code (atdgen) uses simple technique
implemented here:
https://github.com/MyLifeLabs/atd/blob/master/atd_indent.mli
https://github.com/MyLifeLabs/atd/blob/master/atd_indent.ml

(Atdgen does not use Camlp4)
  

3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

Stacks and other stuff:
  

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-06-14 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of June 07 to 14, 2011.

1) OCaml cheat sheets
2) ocaml-data-notation v0.0.5: Store data using OCaml notation
3) Call for Participation: Mancoosi International Solver Competition
4) Deadline June 17: ACM SIGPLAN Workshop on ML
5) Ocamlnet-3.3.1
6) OCaml on iPhone/iPad Simulator
7) Other Caml News


1) OCaml cheat sheets
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00035.html

** Continuing the thread from last week, Stefano Zacchiroli asked and Fabrice 
Le Fessant replied:

 Any chance you can specify a license for the cheatsheets? At present,
 they only say (C) ... meaning that one can do very little with them,
 e.g. printing them for persona use and little more.  An interesting
 usage pattern which is forbidden in present form is distributing them to
 students of a university class which on OCaml.

The files have been updated to display a Creative Common icon, BY+SA,
allowing free distribution for any usage.

We cannot really release the sources yet, as the formatting is pretty
simple, and we want to use better formatting/coloration tools for the
next versions.
  

2) ocaml-data-notation v0.0.5: Store data using OCaml notation
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00039.html

** Sylvain Le Gall announced:

This library uses `type-conv` to dump OCaml data structures using OCaml data
notation.

This kind of data dumping helps to write OCaml code generator, like OASIS.

This release compiles with latest type-conv version (2.3.0).

Homepage:
http://forge.ocamlcore.org/projects/odn

Get source code:
$ darcs get http://darcs.ocamlcore.org/repos/ocaml-data-notation

Browse source code:
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=ocaml-data-notation;a=summary
  

3) Call for Participation: Mancoosi International Solver Competition
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00048.html

** Ralf Treinen announced:

   The Mancoosi International Solver Competition (MISC)
  http://www.mancoosi.org/misc-2011/
   Call for Participation


The Mancoosi project (http://www.mancoosi.org) calls for the second
international competition of solvers for package/component
installation and upgrade problems. Instances of these problems are
given by a set of currently installed or available software packages,
with complex relations between them like dependencies, conflicts, and
features. The problem instances used in the competition are expressed
in a language called CUDF that allows to express relationships between
components like they are known for instance in GNU/Linux
distributions, or for Eclipse plugins. We are not only interested in
finding some solution to such a problem, but in finding the best
solution according to different optimization criteria. For a detailed
description please look at the competition web page

http://www.mancoosi.org/misc-2011/

Participating solvers will be judged by the correctness of the
solution, the quality of the solution according to the respective
optimization criteria, and speed. The results of the competition will
be announced on September, 12, at the LoCoCo workshop at CP 2011
(http://lococo.irill.org/2011).


Timeline:
- August, 1: Registration of participants by email to
  
misc-committee AT sympa.mancoosi.univ-paris-diderot.fr
- August, 12: Submission of solvers
- September, 12: announcement of the results


Organization Committee:
Pietro Abate, University Paris-Diderot, France
Roberto Di Cosmo, University Paris-Diderot, France (co-chair)
Ralf Treinen, University Paris-Diderot, France (co-chair)
Stefano Zacchiroli, University Paris-Diderot, France
  

4) Deadline June 17: ACM SIGPLAN Workshop on ML
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00049.html

** Chung-chieh Shan announced:

ACM SIGPLAN Workshop on ML
Sunday, 18 September 2011, Tokyo, Japan (co-located with ICFP)
http://conway.rutgers.edu/ml2011/

CALL FOR CONTENT

The ML family of programming languages includes dialects known as
Standard ML, Objective Caml, and F#.  These languages have inspired
a large amount of computer-science research, both practical and
theoretical.  This workshop aims to provide a forum for discussion and
research on ML and related technology (higher-order, typed, or strict
languages).

The format of ML 2011 will 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-06-07 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 31 to June 07, 2011.

1) ICFP Programming Contest starting in two weeks
2) Constrain module type to reuse a sum type
3) OCaml cheat sheets
4) OCaml web programming in San Francisco
5) PhD Scholarships in Semantics, Analysis, Verification
6) Other Caml News


1) ICFP Programming Contest starting in two weeks
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg6.html

** Eijiro Sumii announced:

This is a reminder that the ICFP Programming Contest 2011 will be
starting in two weeks.  See:
http://www.icfpcontest.org/2011/05/contest-announcement.html

Participants would need to prepare some virtual (or physical) machine
running Debian squeeze.  See:
http://www.icfpcontest.org/2011/05/judges-machine-and-system-environment.html
 (You would only need an environment compatible with the guest, not
the host.  There exists various virtual machine software such as
VirtualBox and VMware Player.)

We look forward to your participation!

ICFPC 2011 Oraganizers
  

2) Constrain module type to reuse a sum type
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00014.html

** Dawid Toton asked and Jacques Garrigue replied:

 I have a functor F which itself applies its own arguments to some other 
 functors. Results R of these applications contain sum types. These R are 
 exposed in the outcome of F in two ways: as types carried by the functions 
 defined by F and all R packed into a wrapper module. I'd like to tell the 
 compiler that each sum type is equal in both contexts.
 
 The problem boils down to the following:
 
 B.ml:
 
 module type A = sig type a = A end
 module A = struct type a = A end
 
 module E = A
 
 type want_equal = A.a as 'a constraint 'a = E.a
 
 B.mli:
 
 module type A = sig type a = A end
 module A : A
 
 module type E = A (*with type a = A.a*)
 module E : E
 
 type want_equal = A.a as 'a constraint 'a = E.a
 
 
 There are no problems with the module implementation. I can see right types 
 in the output of ocamlc -i .
 But the interface is wrong, since it is forgotten that the sum types in E 
 and A are the same.
 
 I have put a constraint in a comment - this is what I'm trying to achieve.

Your constraint (in comment) is the right one.
Unfortunately,  it was not allowed up to 3.12.0 (a full definition, including 
constructors, was required).
The upcoming 3.12.1 will allow it.
  

3) OCaml cheat sheets
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00018.html

** Fabrice LE FESSANT announced:

  We have published some cheat sheets on OCaml on OCamlPro's website:

http://www.ocamlpro.com/code/2011-06-03-cheatsheets.html

  These cheat sheets are supposed to help developers to learn and to use
OCaml by providing a condensed view of its documentation. Feel free to
use them, distribute them to your students, and to tell us how we could
improve them, what you think is important and should be added, etc.
  

4) OCaml web programming in San Francisco
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00029.html

** William Le Ferrand announced:

Be Sport is a newborn, freshly funded company based in San
Francisco. We're designing the first platform that turns the sport
experience into a worldwide social game, providing a unique
opportunity to challenge peers and build a real sport networking
identity.

Our platform is almost entirely written in OCaml (using the Ocsigen
framework on the frontend, and a lot of magic in the backend :)).

We're looking for one or two OCaml enthusiasts to join our team in SF
and work on our scalable, resilient, space-rocket social graph engine,
as well as developing breathtaking interfaces by leveraging the
ocaml_to_js compiler and some fancy ocsigen 2.0 features.

If you ever dreamt of writing applications for millions of users and
if you are willing to join a dynamic team in San Francisco, let's get
in touch!
  

5) PhD Scholarships in Semantics, Analysis, Verification
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-06/msg00033.html

** Flemming Nielson announced:

We are looking for enthusiastic students with a strong background in
semantics, analysis and verification that would like to become part of
our 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-05-24 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 17 to 24, 2011.

1) ragel 6.7
2) ocaml, objects, classes, type ascription, virtual methods
3) ocaml-xdg-basedir v0.0.1: XDG basedir location for data/cache/configuration 
files
4) Camomile 0.8.3
5) Other Caml News


1) ragel 6.7
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00126.html

** ygrek announced:

 I am glad to announce that fresh release of Ragel (state machine compiler)
 includes ocaml codegen. Ragel is convenient to generate lexers or sometimes 
even  parsers for simple formats.

 See http://www.complang.org/ragel/ChangeLog
  

2) ocaml, objects, classes, type ascription, virtual methods
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00128.html

** Dmitry Grebeniuk asked and Jacques Garrigue replied:

  I have a base class with virtual methods and an extended classes
 where these methods are implemented.
  When I'm ascribing type base to class ext, I get an error:
 
 =
OCaml version 3.13.0+dev3 (2011-03-07)
 
 # class virtual base = object method virtual m : unit end;;
 class virtual base : object method virtual m : unit end
 # class ext : base = object method m = () end;;
 Characters 6-43:
  class ext : base = object method m = () end;;
^
 Error: This class should be virtual. The following methods are undefined : m
 #
 =
 
  Is it the expected behaviour?

It is indeed the expected behaviour.
Like a module signature, a class signature provides complete information.
If you declare a method as virtual in the signature, it will be made virtual 
by
the ascription (this is allowed, since virtual is a supertype of concrete).

In such a case you should rather use a class type:

  class type base = object method m : unit end

As suggested by others, if you don't want to suggest such a class
type you can also use the derived object type:

  class ext = object (_ : #base) method m = () end

These different approaches are described in the manual.
  

3) ocaml-xdg-basedir v0.0.1: XDG basedir location for data/cache/configuration 
files
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00136.html

** Sylvain Le Gall announced:

This library implements the xdg-basedir specification. It helps to define
standard locations for configuration, cache and data files in the user
directory and on the system.

It is a straightforward implementation on UNIX platform and try to apply
consistent policies with regard to Windows directories.

It is inspired by the Haskell implementation of this specification, and it
follows the same choices for Windows directories.

The xdg-basedir specification:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

The Haskell implementation:
http://github.com/willdonnelly/xdg-basedir


The API of this implementation:
http://xdg-basedir.forge.ocamlcore.org/api

Get source code:
$ darcs get 
https://forge.ocamlcore.org/anonscm/darcs/xdg-basedir/ocaml-xdg-basedir/

Browse source code:
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=xdg-basedir/ocaml-xdg-basedir;a=summary
  

4) Camomile 0.8.3
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00140.html

** Yoriyuki Yamagata announced:

I'm pleased to announce Camomile 0.8.3, a Unicode library for OCaml.
This is a bug fix release which fixes a bug concerning casefolding (a
function removing case from the string) abd compare_caseless
(comparison of strings ignoring lower and upper cases).

You can download the new version from
http://prdownloads.sourceforge.net/camomile/camomile-0.8.3.tar.bz2
You can find the general information about the project from the
project page http://camomile.sourceforge.net/
  

5) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

Zarith: arbitrary-precision integers:
  https://forge.ocamlcore.org/projects/zarith/

Unbreaking Scalable Web Development, One Loc at a Time:
  
http://dutherenverseauborddelatable.wordpress.com/2011/05/23/unbreaking-scalable-web-development-one-loc-at-a-time/

OCaml Meeting 2011:
  

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-05-17 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 10 to 17, 2011.

1) NYU's Center for Genomics and Systems Biology seeks OCaml programmer
2) Difference between [ `A ] and [ `A ]
3) ODisco, for large-scale data processing in OCaml
4) Other Caml News


1) NYU's Center for Genomics and Systems Biology seeks OCaml programmer
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00067.html

** Ashish Agarwal announced:

I am excited to tell you about a new opportunity to develop OCaml
software at The Center for Genomics and Systems Biology (CGSB) at New
York University (NYU), located in the heart of Manhattan. The
position's main function will be to develop software in the OCaml
language to manage, analyze, and display the vast amounts of data
generated by next-generation sequencing technologies. NYU's strong
commitment to this field is represented by its $100M investment in the
brand new CGSB building, which houses the latest sequencing platforms
and excellent high performance computing facilities.

You will support the computational needs of several experimental labs
by contributing to the following infrastructure:

o A database for tracking samples, very large quantities of raw data
and analysis results
o A website for users to submit new samples, monitor progress of their
workflow, and visualize data
o A system for distributing batch jobs to a cluster, accounting for
dependencies between jobs and cached results

The ideal candidate will be an experienced functional programmer with
knowledge of many OCaml libraries and tools, such as database
bindings, ocsigen, ocamlnet, batteries, janestreet-core,
etc. Experience in the following areas is a plus but not required:
bioinformatics, statistics, type theory, distributed computing, and
UNIX systems administration.

NYU researchers are using sequencing technologies to investigate basic
questions about the nature of life and to address fundamental problems
in human health. The very large datasets generated by these
technologies pose significant computational challenges for which the
robust principles of functional programming are ideally suited.

Please contact me to discuss this position further. Thank you.
  

2) Difference between [ `A ] and [ `A ]
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00069.html

** Dario Teixeira asked and Jacques Garrigue replied:

 I've seen OCaml code in the wild where both of the following signatures
 are present: (the type parameter for 't' is a phantom type)
 
  val foo: [ `A ] t - unit
  val bar: [ `A ] t - unit
 
 But is there any practical difference between [ `A ] and [ `A ] given
 that there is only one element in the set?

In this particular case the two types are almost equivalent.
The only counterexample I could find is unifying with the following
private row type:

  type leA = private [ `A]

leA is unifiable with [ `A] but not with [`A].

The difference becomes more significant when there is an argument.
For instance, [  `A of int] and [ `A of bool] are unifiable, giving [ `A 
of int  bool],
but [`A of int] cannot be unified with [`A of bool].

Note that some old versions of OCaml did some singleton promotion, i.e.
[ `A of int] was automatically converted to [`A of int].
This was removed as an unnecessary complication, and also because you
might actually want to distinguish the two for private row types.
  

3) ODisco, for large-scale data processing in OCaml
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00075.html

** Prashanth Mundkur:

The Disco team is pleased to announce the possibility of doing
large-scale data analysis (ala map-reduce) in OCaml.

Disco [1] is an open-source distributed computing framework inspired
by the map-reduce paradigm.  It includes a distributed replicating
tag-based filesystem that allows you to store your datasets in a
fault-tolerant manner.  Disco comes with additional tools: DiscoDB [2]
for implementing efficient mapping objects and Discodex [3] for
distributed indices for querying large datasets.

Disco has been in production use at Nokia for two years, and is used
to process terabytes of data daily [4].

The core job scheduling, cluster monitoring and filesystem logic of
Disco is written in Erlang, leveraging the strengths of Erlang in
concurrency and distribution.  The primary language for writing
compute jobs is currently Python; however, the latest Disco 0.4
release [5] has opened up the Disco worker interface, allowing jobs
written to be written in any language.

ODisco is the first 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-05-10 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of May 03 to 10, 2011.

1) Survey on OCaml usage/needs in the industry
2) ICFP Programming Contest 2011
3) Fdinfo 0.1 released
4) An update on ICFP'11 in Tokyo (September 18-24, 2011)
5) Other Caml News


1) Survey on OCaml usage/needs in the industry
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00036.html

** Fabrice Le Fessant announced:

  As OCamlPro is starting its activity, one of our main concern is to
drag new industrial companies towards OCaml in the medium term. To
better understand how to convince them that they should use OCaml, we
are conducting a short survey on the main benefits of using OCaml, from
outside of the academic world, and on the main needs/obstacles that we
should target, to make OCaml more appealing for industrial users.

  If your company uses OCaml at a large scale, i.e. if you are among a
team (at least two ;-) ) of OCaml developers, we would be interested to
hear about the reasons why your company chose OCaml for developing
software, and about the problems you meet using OCaml, so that we can
work on it. Here is the link to the survey:

http://www.surveymonkey.com/s/R7BB6PL
  
** David MENTRE asked and Fabrice Le Fessant replied:

 Will you share the results of this survey?

Yes, of course, but I don't know yet at which level of details, as going
into details might require to anonymize the responses.
  
** rixed asked and Fabrice Le Fessant replied:

 What about a survey about why our companies chose _not_ to use OCaml ?
 Wouldn't be useful as well ?

Actually, it is part of the survey, but the question is about the
needs of those who chose it, but it can also be seen as the reasons
why your company chose not to use it, because those needs were not filled.

Anyway, of course, if anybody is part of a company where a discussion
happened about using or not OCaml, feel free to reply to the survey, as
the questions are opened, so that you can add comments wherever you want.
  

2) ICFP Programming Contest 2011
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00046.html

** Eijiro Sumii announced:

We have published the following announcement at:

  http://www.icfpcontest.org/

Please enjoy,

  Eijiro Sumii (2011 Contest Chair)

--
ICFP Programming Contest 2011

 http://www.icfpcontest.org/

The ICFP Programming Contest 2011 is the 14th instance of the annual
programming contest series sponsored by The ACM SIGPLAN International
Conference on Functional Programming.  This year, the contest starts
at 00:00 June 17 Friday UTC (= 24:00 June 16 Thursday UTC) and ends at
00:00 June 20 Monday UTC (= 24:00 June 19 Sunday UTC).  Unlike in
previous years, there is no 24-hour lightning division.

The task description will be published in this blog when the contest
starts.  Solutions to the task must be submitted online before the
contest ends.  Details of the submission procedure will be announced
along with the contest task.

This is an open contest.  Anybody may participate except for the
contest organizers and members of the same laboratory as the the
contest chair's.  No advance registration or entry fee is required.

Participants may form teams.  A team consists of every person who
contributes ideas and/or code towards a submission.  Teams may have
any number of members.  Individuals may only be members of a single
team and teams may not divide or collaborate with each other once the
contest has begun.

Any programming language(s) may be used as long as the submitted
program can be run by the judges on a standard Linux environment with
no network connection.  Details of the judges' environment will be
announced later.

There will be prizes for the first (US$1,000) and second ($500) place
teams as well as a discretionary judges' prize ($500).  There will
also be a total of $6,000 travel support.  (The prizes and travel
support are subject to the budget plan of ICFP 2011 pending approval
by ACM.)

In addition, the organizers will declare during the conference that:

- the first place team's language is the programming language of
  choice for discriminating hackers,

- the second place team's language is a fine tool for many
  applications,

- and the team winning the judges' prize is an extremely cool bunch
  of hackers.

Additional announcements about the contest will be made at
http://www.icfpcontest.org/.  Questions can be posted as comments to
the blog or e-mailed to icfpc2011-blogger AT kb.ecei.tohoku.ac.jp
(please replace AT with @).

We look forward to your participation!

The contest 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-05-03 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 26 to May 03, 2011.

1) Efficient OCaml multicore -- roadmap?
2) Dynamic contract checking for OCaml
3) Small openGL program example ...
4) Pros and cons of different GL bindings ?
5) Other Caml News


1) Efficient OCaml multicore -- roadmap?
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-04/msg00264.html

** orbitz said:

Hey everyone, I wrote up a short review of the paper Efficient
Parallel Programming in Poly/ML and Isabelle/ML which discusses how
multicore support was added to Poly/ML. I am not an expert so if I got
details wrong please correct me but the hope is Poly/ML's story might
be helpful for Ocaml.

http://functional-orbitz.blogspot.com/2011/04/jc-efficient-parallel-programming-in.html
  

2) Dynamic contract checking for OCaml
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-04/msg00281.html

** Dana announced:

I have implemented a prototype that does dynamic contract checking for
OCaml code. The prototype is built upon the source code of
ocamlc-3.11.2. Please see a tutorial for the details:

http://gallium.inria.fr/~naxu/research/camlcontract.pdf

This document also describes where to access the source code.

If you are interested in co-improving it or have any comments, please
feel free to drop me an email.
  

3) Small openGL program example ...
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-04/msg00282.html

** Christophe Raffalli announced:

I just wrote in two days a small openGL game (~500 lines in one file),
with fun options:

- anaglyph 3D (yet to tune, I have not received my cyan/red glasses yet)
- game replay
- register game and high-score on a web site.

Please visit http://lama.univ-savoie.fr/~raffalli/spheres.php

Many possibilities for this code:
- have fun and have the best high-score on the web site ;-)
- use the fun factor for teaching ... please inform me if you have any
succes failure ... There are FIXME in the code
   which could be good idea ... This is how this game started after all ...
- write program that play the game.
- find a way to check that game on the website are real game played by
human at normal speed (hard research ?)
- port to other openGL bindings for OCaml (send me your file, I will put
it on the website)
  

4) Pros and cons of different GL bindings ?
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-04/msg00242.html

** Thomas Braibant asked and Ethan Burns replied:

 There exists at least 3 different bindings for openGL in OCaml (and maybe 
 more).
  
 For the untrained eye, it is difficult to pick one. Could someone sum
 up the pros and cons of each of these libs ?

I have only really tried glMLite (and even then I only used it to draw simple 
rectangles using vertex buffers) but I did also look into the others a tiny 
bit.  Here is what I found:

 - LablGL http://www.math.nagoya-u.ac.jp/~garrigue/soft/olabl/lablgl.html

This appears to be the 'default' OpenGL for OCaml.  It is suppose to work 
with lablgtk (I don't know if the others do) but it does not seem to have 
support for shaders and some later OpenGL funtionality.

 - glMLite http://www.linux-nantes.org/~fmonnier/ocaml/GL/

Supports the newer OpenGL functionality (GLSL shaders and vertex buffers).  
My friend had a difficult time getting it to compile/work on OSX but with 
some minor changes I believe that he eventually got it working. 

 - glcaml http://glcaml.sourceforge.net/

glcaml seems to be a set of automatically generated stubs.  It seems to 
support some of the latest OpenGL but the interface is automatically 
generated so it doesn't have a very OCaml-ish feel to it.
  
** Anthony Tavener then added:

Ethan's summary is good. I'll elaborate a bit on glcaml...

I use glcaml, but don't recommend it in general. There are two reasons
I chose it: 1. It looks like OpenGL, so my familiarity with it
directly translates... the only differences are lowecase GL constants
and no parentheses around arguments. 2. It (kind-of) supports features
like shaders.

What I mean by kind-of is that the bindings are broken for a lot of
lesser-used features. I've been maintaining my own modifications to
support features I need (same with sdlcaml)... though I recently
decided I should follow OpenGL 4 (basically the same as OpenGL ES 2),
which strips the interface down to a minimal set heavily reliant on
shaders. This 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-04-26 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 19 to 26, 2011.

1) Other Caml News


1) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

Core Gems: many happy returns:
  http://ocaml.janestcapital.com/?q=node/91

And while I'm on the subject:
  http://gaiustech.wordpress.com/2011/04/25/and-while-im-on-the-subject/

3rd Asian-Pacific Summer School on Formal Methods:
  http://coq.inria.fr/3rd-asian-pacific-summer-school-on-formal-methods

Coq Workshop 2011:
  http://coq.inria.fr/coq-workshop-2011

OCaml HDF4 bindings:
  https://forge.ocamlcore.org/projects/ocaml-hdf/

Netmulticore and the n-queens puzzle:
  http://blog.camlcity.org/blog/multicore3.html

Syntax extensions without Camlp4:
  http://www.lexifi.com/blog/syntax-extensions-without-camlp4

Making a similar message system as rails' flash with Ocsigen:
  http://blog.dbpatterson.com/post/4761858824

OCaml Web Portal:
  https://forge.ocamlcore.org/projects/ocamlweb/
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .



PGP.sig
Description: This is a digitally signed message part
___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-04-12 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of April 05 to 12, 2011.

1) mcmc-ocaml: A Library for Markov-Chain Monte Carlo Computations in OCaml
2) OCaml/Xen google summer of code
3) Other Caml News


1) mcmc-ocaml: A Library for Markov-Chain Monte Carlo Computations in OCaml
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-04/msg00028.html

** Will M Farr announced:

I'd like to announce mcmc-ocaml, a library for Markov-chain Monte
Carlo computations in OCaml. You can obtain the library from github at

https://github.com/farr/mcmc-ocaml

It is released under the GPL, version 3.0. For more information on
MCMC, see http://en.wikipedia.org/wiki/Markov_chain_Monte_Carlo .

Some highlights of the mcmc-ocaml library:

* mcmc-ocaml provides code to perform MCMC analysis in arbitrary
parameter spaces. Parameter values need not be numerical, but can
instead be any OCaml value: algebraic data types, classes, etc.

* mcmc-ocaml provides useful higher-order functions to combine
multiple jump proposals with arbitrary weights into a single proposal
for Metropolis-Hastings sampling, making it easy to have many special
jump proposals tuned to your specific parameter space structure.

* mcmc-ocaml provides code to read and write MCMC samples from/to
files; this can be combined with the library of statistical functions
or user-written code to perform post-processing of MCMC output either
in a stand-alone program or from the REPL.

* mcmc-ocaml provides many utility functions for performing model
selection via Reversible-Jump MCMC, either between two models or among
a larger set of models. This includes an implementation of the method
described in http://arxiv.org/abs/1104.0984 for facilitating
inter-model jumps by interpolating posteriors using single model
parameter samples.

* mcmc-ocaml provides several different algorithms for computing the
Bayesian evidence for a model using MCMC samples from its posterior
distribution, including the direct integration algorithms described
in http://arxiv.org/abs/0911.1777 .

* mcmc-ocaml comes with complete ocamldoc documentation for its
functions and types.

mcmc-ocaml is extensively tested, and has been used to constrain the
mass distribution of stellar-mass black holes in our galaxy
(http://arxiv.org/abs/1011.1459 ---including the 10-way RJMCMC
comparisons among the models in that paper), among other research
projects. Please direct bug reports, feature requests, and comments to
this address (w-farr AT northwestern.edu).
  

2) OCaml/Xen google summer of code
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-04/msg00036.html

** Anil Madhavapeddy announced:

Xen.org was accepted to the Google Summer of Code 2011, and I snuck in an 
OCaml-related project [1]. I haven't received any good applications for this, 
so if you are interested and eligible, I would encourage you to apply before 
the deadline tomorrow.  Please get in touch with me asap by email if you do 
plan to put a proposal in.

The SSL idea is just a template; pretty much anything interesting (especially 
profiling-related) to running OCaml stub domains on Xen would be relevant.

cheers
Anil

[1] http://wiki.xensource.com/xenwiki/GSoC_2011_ideas
  

3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

OCaml Bitcask:
  https://forge.ocamlcore.org/projects/bitcask/

OCaml is smarter than I thought:
  http://ocaml.janestcapital.com/?q=node/90

Sebib 1.1.0 released:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=785

SPL: Shakespeare Programming Language:
  https://forge.ocamlcore.org/projects/shakespeare/

performances tweaking - dose3:
  https://mancoosi.org/~abate/performances-tweaking-dose3

What does this function do?:
  http://www.lexifi.com/blog/what-does-function-do

OCaml Meeting 2011, last day of registration:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=784

Logic programming in Scala, part 1:
  
http://ambassadortothecomputers.blogspot.com/2011/04/logic-programming-in-scala-part-1.html

OCamlPro and the future of OCaml:
  http://ocaml.janestcapital.com/?q=node/89
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-03-15 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of March 08 to 15, 2011.

1) GSoC: call for students
2) Hoogle for your language (i.e. F#, Scala, ML, Clean...)
3) Other Caml News


1) GSoC: call for students

** Christophe TROESTLER announced:

The OCaml community application to the Google summer of code has
been sent.  In about a week we will know whether we are accepted or
not.

On behalf of the Admin team, I would like to thank everybody who as
accepted to become a possible mentor.  The call is still open, if you
think you would be a good mentor, please create an account and add
your name on http://gsoc-team.forge.ocamlcore.org/

More ideas can also be added to
http://gsoc-team.forge.ocamlcore.org/GSoC2011/Applying

To all of you who are in contact with students, please let them know
about the opportunity to have fun coding OCaml during their holidays!
Encourage them to add their name on
http://gsoc-team.forge.ocamlcore.org/ and to look at the ideas page
http://gsoc-team.forge.ocamlcore.org/GSoC2011/Applying

Now is a good time for the students to start interacting with the
community.

Best, Christophe

--- 
P.S.  For any question, do not hesitate to contact the Admin team
at gsoc-team-admin @nospam@ ocamlcore.org
  

2) Hoogle for your language (i.e. F#, Scala, ML, Clean...)
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-03/msg00088.html

** Daniel Bünzli announced:

Just wanted to relay this call  :

http://neilmitchell.blogspot.com/2011/03/hoogle-for-your-language-ie-f-scala-ml.html

to the members of this list.
  

3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

AnsiTerminal 0.5:
  http://caml.inria.fr/cgi-bin/hump.cgi?contrib=333

ANSITerminal 0.5 released:
  https://forge.ocamlcore.org/forum/forum.php?forum_id=776

Mesh:
  https://forge.ocamlcore.org/projects/mesh/

Literate programming: where we are and where we should aim at:
  
http://bentobako.org/david/blog/index.php?post/2010/09/08/Literate-programming%3A-where-we-are-and-where-we-should-aim

Introduction pratique à OCaml 20100129:
  http://caml.inria.fr/cgi-bin/hump.cgi?contrib=760

Effective ML Revisited:
  http://ocaml.janestcapital.com/?q=node/85

OCaml-ODBC:
  https://forge.ocamlcore.org/projects/ocamlodbc/

OCaml User Meeting, April 2011:
  http://rwmj.wordpress.com/2011/03/08/ocaml-user-meeting-april-2011/
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .




___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-02-22 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of February 15 to 22, 2011.

1) Encoding objects using recursive first-class modules
2) LablGLES for Android
3) Kaputt 1.1 release
4) Compiling Windows native code
5) Other Caml News


1) Encoding objects using recursive first-class modules
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg00101.html

** Jacques Garrigue explained:

There has been some excitement about the possibilities of first-class
modules.
One application is to use them as objects, as is already done in the
amthing project (using interesting syntactic sugar).
This may interest some people that the relation to objects doesn't
stop at the concrete object level: combining them with recursive
modules, one can also easily encode classes, with virtual methods and
inheritance.
The basic idea is to turn classes (or rather traits) into functors
from the final object to a list of methods.
Here is a bit of code demonstrating this.
This code is rather verbose, but using 3.13 features and amthing
syntax it can be made much lighter.

Jacques Garrigue

(* Signature for points, all methods must be functions *)
module type Point = sig
  val get_x : unit - int
  val move : int - unit
end

(* The Point class, with state x *)
(* Needs to be a functor, to allow creating new state *)
module PointF(X : sig end) = struct
  let x = ref 0
  let get_x () = !x
  let move d = x := !x + d
end

(* Create a new point *)
let new_point () = (module PointF(struct end) : Point)

(* Signature for the Show trait *)
module type Show = sig
  val show : unit - string
end

(* Implementation for the Show trait *)
module ShowF(P : Point) = struct
  let show () = Printf.sprintf x = %i (P.get_x ())
end

(* Signature for the ShowPoint class *)
module type ShowPoint = sig include Point include Show end

(* ShowPoint class *)
module ShowPointF(P : ShowPoint) = struct
  include PointF(P)
  include ShowF(P)
end

(* Create a new ShowPoint object, by tying the knot *)
let new_showpoint () =
  let module M = struct
module rec SP : ShowPoint = ShowPointF(SP)
  end in (module M.SP : ShowPoint)

(* Play with it *)
let sp = new_showpoint ()
let a =
  let module SP = (val sp : ShowPoint) in
  SP.move 2; SP.show ()

(* One can coerce to a supertype *)
let sp_as_p = (module (val sp : ShowPoint) : Point)
  

2) LablGLES for Android
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg00116.html

** Jeffrey Scofield announced:

For those interested in using OpenGL ES from OCaml, I've just made a
small update to my LablGLES patches so that they compile and link under
the NDK on Android.  Thanks to Paul Snively for contributing the Android
modifications.

Instructions for downloading and building LablGLES are here:

http://psellos.com/ocaml/lablgles-build.html

Glossary:

LablGL is an OCaml interface to OpenGL, created by Jacques Garrigue and
others.

LablGLES is a set of patches that change LablGL into an interface to
OpenGLES rather than OpenGL.

OpenGLES is a subset of OpenGL intended for embedded use (in cell phones
and the like).  Notably, it is supported by iPhone, iPad, and Android
devices.
  

3) Kaputt 1.1 release
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg00118.html

** Xavier Clerc announced:

This post announces the 1.1 release of the Kaputt project, whose goal is to 
provide
a comprehensive testing framework for the Objective Caml language.

Home page: http://kaputt.x9c.fr

Main changes since 1.0:
  - update for Objective Caml 3.12.0
  - new build system (ocamlbuild-based)
  - assertion builders for data containers
  - generators for functions (both total and partial)
  - enumerators for file contents (chars, bytes, lines, and marshalled values)
  - additional shell commands, and possibility to configure shell syntax
  - enhanced big array, and big num support
  - fix for possible non-termination on unsatisfiable precondition
  - implementation of reduction (to try to produce smaller counterexamples)
  - bug #51: unportable use of 'which'
  - bug #57: tests fail on 64-bit platform
  

4) Compiling Windows native code
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg00124.html

** Deep in this thread, Vu Ngoc San said:

incidentally, I've just installed ocaml+SDL on windows Vista and XP,
using Mingw and flexlink, and I can compile both bytecode and nativecode.

I put up a blog post 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2011-02-08 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of February 01 to 08, 2011.

1) Plasma MapReduce, PlasmaFS, version 0.3
2) Example iPhone apps in OCaml
3) LDA or SVM
4) Marionnet 0.90.6
5) ODNS 0.2: DNS library for Objective Caml
6) Bolt 1.1 release
7) Other Caml News


1) Plasma MapReduce, PlasmaFS, version 0.3
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg0.html

** Gerd Stolpmann:

I've just released Plasma-0.3. Plasma consists of two parts (for now),
namely Plasma MapReduce, a map/reduce compute framework, and PlasmaFS,
the underlying distributed filesystem.

Major changes in version 0.3 :

  * Optimized blocklist representation (extent-based)
  * Improved block allocator to minimize disk seeks
  * Allocating datanode access tickets in advance
  * Sophisticated RAM management
  * The command-line utility plasma supports wildcards

Of course, there are also numerous bug fixes and performance
improvements.

Plasma MapReduce is a distributed implementation of the map/reduce
algorithm scheme. In a sentence, map/reduce performs a parallel List.map
on an input file, sorts and splits the output by some criterion into
partitions, and runs a List.fold_left on each partition. Only that it
does not do that sequentially, but in a distributed way, and chunk by
chunk. Because of this Plasma MapReduce can process very large files,
and if run on enough computers, this also will work in reasonable time.
Of course, map and reduce are Ocaml functions here.

This all works on top of a distributed filesystem, PlasmaFS. This is a
user-space filesystem that is primarily accessed over RPC (but it is
also mountable as NFS volume). Actually, most of the effort went here.
PlasmaFS focuses on reliability and speed for big blocksizes. To get
this, it implements ACID transactions, replicates data and metadata with
two-phase commit, uses a shared memory data channel if possible, and
monitors itself. Unlike other filesystems for map/reduce, PlasmaFS
implements the complete set of usual file operations, including random
reads and writes. It can also be used as unspecialized global
filesystem.

Both pieces of software are bundled together in one download. The
project page with further links is

http://projects.camlcity.org/projects/plasma.html

There is now also a homepage at

http://plasma.camlcity.org

This is an early alpha release (0.3). A lot of things work already, and
you can already run distributed map/reduce jobs. However, it is in no
way complete.

Plasma is installable via GODI for Ocaml 3.12.

For discussions on specifics of Plasma there is a separate mailing list:

https://godirepo.camlcity.org/mailman/listinfo/plasma-list
  

2) Example iPhone apps in OCaml
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg4.html

** Jeffrey Scofield:

For anyone interested in writing iPhone apps in OCaml, I've
written up two examples.  You can get the sources and build
instructions here:

   http://psellos.com/ocaml/example-app-portland.html
   http://psellos.com/ocaml/example-app-slide24.html

The first is very simple, just to test the basic compiling,
linking and packaging.  When you run it, it shows you which side
of your iPhone is facing up.

The second implements the 5 x 5 sliding tile puzzle.  If you're
pressed for time it will solve the puzzle for you using the A*
heuristic search algorithm, then animate the solution.

Hopefully they'll be useful to some fellow OCaml/iPhone coders.
I'm very happy to receive comments, questions, and corrections.
  

3) LDA or SVM
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg6.html

** Joel Reymont Daniel Bünzli:

 Has anyone implemented Latent Dirichlet Allocation (LDA), Pachinko Allocation 
 [1] or Support Vector Machine (SVM) in OCaml?
 
 Thanks, Joel
 
 [1] http://en.wikipedia.org/wiki/Pachinko_allocation

There's this :

http://www.umiacs.umd.edu/~hal/SVMsequel/index.html

and regarding machine learning Markus Mottl has gpr :

http://www.ocaml.info/home/ocaml_sources.html#toc15
  

4) Marionnet 0.90.6
Archive: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg00012.html

** Luca Saiu:

After an intense development period, today we are happy to officially
announce Marionnet 0.90.6, the first public release in the stable
0.90.x series.

Marionnet is a virtual network laboratory: it allows users to define,

[cwn] Attn: Development Editor, Latest Caml Weekly News

2010-12-14 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of December 07 to 14, 2010.



1) Define parser and printer consistently
2) Lwt 2.2.0 released
3) Js_of_ocaml version 1.0
4) OBus 1.1
5) Other Caml News


1) Define parser and printer consistently
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/c3123defe9be7a46#

** Dawid Toton asked:

I'm going to define a parser and a printer for a simple grammar. 
Is there a way to define both of them in a single construct using some 
existing OCaml tool? 

For example, I have a keyword function. The usual parser would contain 
a mapping like: 
function - `Function 
and the straightforward printer would do: 
`Function - function 

What is the best way to combine these definitions, so that duplication 
would be minimized? 
To be precise, avoiding duplication is not exactly what I need. I'm 
looking for something that would prevent making inconsistent changes to 
the parser and the printer. 
  
** Ashish Agarwal suggested:

Maybe you will find Pickler Combinators useful:
http://research.microsoft.com/en-us/um/people/akenn/fun/picklercombinators.pdf
  
** Pascal Cuoq also suggested:

Take a look at Boomerang: http://www.seas.upenn.edu/~harmony/

From the overview:

Boomerang is a programming language for writing lenses?well-behaved
bidirectional transformations?that operate on ad-hoc, textual data formats.
Every lens program, when read from left to right, describes a function that
maps an input to an output; when read from right to left, the very same
program describes a backwards function that maps a modified output, together
with the original input, back to a modified input.

Lenses have been used to solve problems across a wide range of areas in
computing including: [...] in parsers and pretty printers
  
** Romain Bardou also suggested:

I'm writing a tool called Parsini which, maybe, does what you're looking 
for. Parsini stands either for parsing is not interesting (i.e.: let's 
have a tool which does it quickly for us and move on to interesting 
things such as code generation) or for parser houdini or something :p

 From a simple grammar, the tool :
- infers and produces an AST ;
- produces an ocamlyacc source ;
- produces an ocamllex source (optional - you can use your own lexer) ;
- produces a main file with :
   * functions to read your main entries easily from a channel, a file, 
a string...
   * functions to pretty-print your AST.
Your AST is pretty-printed with the Ocaml syntax, not the syntax of your 
own language, which I do not know how to do.

I have not released the tool yet, so nothing is official nor documented 
but you might want to take a look. License will be BSD. I've copied the 
darcs repository on my website :

http://romain.bardou.fr/parsini

So you should be able to download it easily with :

darcs get http://romain.bardou.fr/parsini
  
** Yitzhak Mandelbaum also suggested:

PADS/ML can do that for you, and more. You can find information about the PADS
languages and tools here:

http://www.padsproj.org

including papers and a manual. The website doesn't have the most recent
release of PADS/ML -- i plan to put it up on Github shortly -- but if you're
interested, i'm happy to send you a tarball.

The basic idea is that you specify your grammar as a type-like declaration.
Then, pads/ml generates an AST, parser, printer and some more stuff for you.
The generated parser is like a PEG parser, but with support context-sensitive
parsing. That is, it is deterministic, with ordered choice; and, it is
scannerless. So, the grammars-writing style has some significant differences
from ocamllex and ocamlyacc.

PADS/ML has an Eclipse license.
  

2) Lwt 2.2.0 released
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/d7005e9ae47d0155#

** Jérémie Dimino announced:

The Lwt team is pleased to announce the release of Lwt 2.2.0. You can
download it at:

 http://ocsigen.org/lwt/install

Here is a list of changes from the previous version (2.1.1):

 * Bugfixes:
   ** Fix a bug with cancellable threads causing {{{Canceled}}}
  exceptions to be raised randomly
   ** Fix a fd-leak in Lwt_io.open_connection
 * {{{Lwt_unix}}} now use libev instead of select
 * Add thread local storage support to {{{Lwt}}}
 * Add backtrace support to {{{Lwt}}}. Now {{{Lwt}}} exceptions can
   be recored by using the syntax extension with the {{{-lwt-debug}}}
   command line switch.
 * Allow blocking system calls to be executed in parallels
 * Change the type of many functions of {{{Lwt_unix}}}, which now
   return a {{{Lwt}}} thread
 * Add functions {{{Lwt_unix.readable}}} and {{{Lwt_unix.writable}}}
 * Add function 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2010-11-23 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of November 16 to 23, 2010.



1) SMP multithreading
2) ledit release 2.02
3) Looking for stubs for sendmsg/recvmsg
4) OCamlJit 2.0
5) Other Caml News


1) SMP multithreading
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/8652e1563fcfdc01#

** In this very long thread, Wolfgang Draxinger asked and Sylvain Le Gall 
suggested:

 So, what're the developments regarding SMP multithreading OCaml?

There are various development regarding this subject (most recent
first):
- Plasma (MapReduce in OCaml)
  http://plasma.camlcity.org/plasma/index.html
- OC4MC (OCaml for MultiCore)
  http://www.algo-prog.info/ocmc/web/
- ocamlp3l
  http://camlp3l.inria.fr/eng.htm
- jocaml 
  http://jocaml.inria.fr/
- ocamlmpi
  http://forge.ocamlcore.org/projects/ocamlmpi/

All these projects try to tackle the challenge of SMP from different
point of view. Maybe you'll find what your answer in one of them.
  

2) ledit release 2.02
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/a3f3d9ee6deb7344#

** Daniel de Rauglaudre announced:

New release of ledit : 2.02.

Ledit is a line editor to be used before an interactive command,
allowing you to edit input lines (cut, paste, move cursor forward
and backward and in history, balance parentheses and so on).
Examples:
   $ ledit ocaml
   $ ledit ocamldebug
   $ ledit ed
   and so on...

New feature : TAB for 'complete-file-name'

When you type 'tab', ledit tries to complete what is before the cursor
considered as a path, and displays the possible files if there are
several of them, just like common shells do.

Useful when you have forgotten the file name you want to specify.
  

3) Looking for stubs for sendmsg/recvmsg
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/437242c094e335c3#

** Goswin von Brederlow asked and Jérémie Dimino replied:

 I'm looking for stubs for
 
ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags);
ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
 
 Specifically I need those to send (among normal messages) an
 Unix.file_descr over a Unix Domain Socket.
 
 Does anyone know of a module that has them?

The Lwt_unix module has them [1].

Cheers,
Jérémie

  [1] http://ocsigen.org/lwt/doc/api/Lwt_unix.html#VALrecv_msg
  
** Dave Scott also replied:

We have some bindings for those:

https://github.com/xen-org/xen-api-libs/blob/master/stdext/unixext.mli

external send_fd : Unix.file_descr - string - int - int - Unix.msg_flag
list - Unix.file_descr - int = stub_unix_send_fd_bytecode
stub_unix_send_fd
external recv_fd : Unix.file_descr - string - int - int - Unix.msg_flag
list - int * Unix.sockaddr * Unix.file_descr = stub_unix_recv_fd

You might prefer to extract the relevant functions from the code -- there's a
lot of other misc stuff in that repo which you're probably not interested in.

We use those functions quite a lot so hopefully they'll work for you.
  

4) OCamlJit 2.0
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/a8b3d15a3cba60f0#

** Benedikt Meurer announced:

OCamlJit 2.0 is a new Just-In-Time engine for Objective Caml 3.12.0 on desktop
processors (x86/x86-64). It translates the OCaml byte-code used by the
interpreter (ocamlrun and ocaml) to x86/x86-64 native code on-demand and runs
the generated native code instead of interpreting the byte-code. It is
designed to run with minimal compilation overhead (translating only what is
being executed, avoiding costly code generation and optimization techniques),
while being 100% compatible with the byte-code runtime (including
serialization and hashing of closures, etc.).

OCamlJit 2.0 was specifically designed for desktop processors and is not
really portable to anything else in its current shape, because the target
audience are people using the interactive top-level and the byte-code
interpreter for rapid prototyping/development (which is unlikely to happen on
anything else but x86/x86-64). The implementation currently requires a system
that adheres to the SysV ABI, which includes Linux, BSD, OS X, but excludes
Win32/Win64 (patches/ideas are welcome). It was tested on Linux/x86 (Debian),
Linux/amd64 (CentOS) and Mac OS X 10.6 (64bit). The x86 implementation
requires SSE2 capable processors (otherwise it falls back to the 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2010-11-16 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of November 09 to 16, 2010.



1) Type Safety comes to the iPad
2) MLbrot: Mandelbrot Set in OCaml
3) ocamlclean : an OCaml bytecode cleaner
4) Generalized Algebraic Datatypes branch is ready for testing
5) F# open sourced
6) Other Caml News


1) Type Safety comes to the iPad
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/9404941e97c077b2#

** Jonathan Kimmitt announced:

I thought you might be interested to know that my new OCAML App for the iPad
was published on the iTunes Store yesterday. I believe this is a significant
achievement given the notorious reluctance of Apple to embrace languages other
than C/obj-C/C++ and I would hope it would promote wider dissemination of type
safety.

The real win would be if the new paradigm was accepted for teaching the new
generation of students etc, which would require greater acceptance by
potential employers which is a bit of a chicken/egg scenario.

Anyway I am inordinately proud of my new publication and if you know anybody
who has an iPad, please let them know about it.

http://itunes.apple.com/app/ocamlexample/id396515573?mt=8#
  
** Later on, Jonathan Kimmitt added:

Perhaps a further explanation is necessary. What I have done is ported the
interpreter ocamlrun to the iPad and added a gui based on Graphics.cma and
bound ancillary libraries such as Num.cma into the executable. The ocaml
interpreter itself is written in ocaml and is identical to the workstation
version of the same release. This means you can drop a compiled library into
iTunes and then load it immediately in iPad (provided it does not use shared
objects which are not bound into the signed app.

So you could say the app is written in ocaml. I have called it 'OcamlExample'
with the intention that users will substitute their own code making use of
#use or #load statements

The alternative option to use ocaml's own native code generator seems to me a
bit pointless because the app is then hard-wired to a given function. But if
anyone wants to write a type-safe game or something, this would be an
interesting. You could use the standalone codesign function of xcode perhaps

The other thing you will have gathered is it allows creative activity on the
iPad, without becoming a developer.

With this version you cannot compile to a file on the iPad, but you can #use
source files which then get compiled into memory in a sense. But the ability
to exchange compiled bytecode with the host running iTunes means this is not
too much of a limitation in my view.
  
** Later on, Jonathan Kimmitt added again:

The application itself is written in Xcode. You need to be a member of the
development program at £59/$99 or equivalent per year to get access to the
signing keys if you need to modify 'extern' functions (native C code of the
interpreter)

You don't need anything apart from iTunes to download (using document sharing)
source code in .ml files to the iPad and execute in the App

Or you can type in ocaml statements directly into the interpreter for example
draw_rect 100 100 200 200;; will draw a box immediately because the default
startup open the graphics library.

There are some irritations, for example itunes does not allow a document with
the name .ocamlinit to be selected for download, so I provide an 'ocamlinit'
instead to execute if it exists. If it doesn't exist then the default startup
is executed that comes with the App

The built-in keyboard is not ideal for ocaml with its dearth of easily
accessible symbols. An external keyboard is recommended if you want to do real
work. Another issue is the lack of a decent editor suited to programming -
perhaps someone could port chamo to the iPad ?

I envisage a typical program would be developed on the workstation, compiled
to a .cma file and then downloaded to the iPad. However I have not tried this
route to see if it works. you need to make sure the ocaml version is
identical.

There is no dynamic loading allowed - all the standard library that was
relevant is linked in statically
  
** Daniel Bünzli then added:

There are a few instructions here [1].

Best,

Daniel

[1] http://web.yl.is.s.u-tokyo.ac.jp/~tosh/ocaml-on-iphone/
  

2) MLbrot: Mandelbrot Set in OCaml
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/85623ba9e467dfda#

** Continuing the thread from last week, Goswin von Brederlow asked and Daniel 
de Rauglaudre replied:

 Only looked at the pictures so far but they do look good. I'm missing
 some screenshots though. How does the interface look like? I assume you
 have some way to select a part of the image to zoom?

When clicking with left button, you 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2010-07-20 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 13 to 20, 2010.

The Caml Weekly News will be on a summer hiatus till August 31st.

1) Other Caml News


1) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

LLVM Backend : Milestone #1.:
  http://www.mega-nerd.com/erikd/Blog/CodeHacking/DDC/llvm_milestone1.html

Ensuring that a function is polymorphic in Ocaml 3.12:
  http://ocaml.janestcapital.com/?q=node/79

Making something out of nothing (or, why None is better than NaN and NULL):
  http://ocaml.janestcapital.com/?q=node/78

OASIS-DB: a CPAN for OCaml:
  http://www.ocamlcore.com/wp/?p=79

OLast.FM:
  https://forge.ocamlcore.org/projects/lastfm/

Project children has forked:
  
http://le-gall.net/sylvain+violaine/blog/index.php?2010/07/14/61-project-children-has-forked
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .






___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2010-07-13 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of July 06 to 13, 2010.

1) Camomile-0.8.1

2) Announce: the Piqi project
3) Other Caml News


1) Camomile-0.8.1

Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/860c5378a1c1c46b#

** Yoriyuki Yamagata announced:

I'm pleased to announce the release of Camomile-0.8.1. a comprehensive 
Unicode library for OCaml. 

http://prdownloads.sourceforge.net/camomile/camomile-0.8.1.tar.bz2 

This release 

* reorganizes the module structure : Make CamomileLibrary.Default to 
the new top-level module CamomileLibraryDefault, so that linking 
CamomileLibrary does not automatically cause to load the data files 
from hard-coded location. Also, adding new CamomileLibraryDyn module, 
which is configured by environmental variables (See 
camomileDynConfig.mli). 

* adds StringPrep module: String preparation according to RFC3454, 
contributed by Pierre Chambart. 

* fixes Avl-Tree balanced bug, pointed out by Stanis?aw T. Findeisen. 

* fixes bugs affecting UMap.remove and USet.fold_range, pointed out by 
Chris Kuklewicz 

For more information, see our web page http://camomile.sourceforge.net/ 
  

2) Announce: the Piqi project
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/b1d98a6b6a2855e4#

** Anton Lavrik annouced:

It is my pleasure to announce the Piqi project.


Piqi is a set of languages and tools for working with structured data.
It includes:

- High-level data representation and data definition languages.

- Binary encoding for compact and portable data representation.

- Tools for validating, pretty-printing and converting data between
  different formats.

- Mappings to various programing languages allowing programs to
  serialize and deserialize data in a portable manner.

- Open-source implementation licensed under the terms of Apache v2.0.


Piqi implements native mapping for OCaml. Mappings for other languages (C++,
Python, Java, Go, etc.) are supported through Google Protocol Buffers.


Here are some details.


1. Data representation language (Piq)

Piq is a text-based language that allows humans to conveniently read,
write and edit structured data.

Piq has a concise and powerful syntax:
- No syntax noise compared to XML.
- Reasonable amount of parenthesis compared to S-expressions.
- Comments.

Piq supports the following data literals:
- Unicode strings, booleans, integer and floating point numbers
  (including infinity and NaN);
- binary strings (byte arrays);
- verbatim text.


2. Data definition language (Piqi)

Piqi is a data definition language for Piq and its encodings. It stands
for Piq Interfaces.

Piqi supports definition of records, variants (similar to OCaml's
polymorphic variants), lists and type aliases on top of a rich set of
built-in data types.

Piqi modules can reuse definitions from other modules using OCaml-like
imports and includes.

Piqi type definitions are extensible that allows data schema evolution
while maintaining backward and forward compatibility.


3. Piqi-OCaml mapping

Piqi implements mapping of Piqi modules to OCaml modules and Piqi type
definitions to OCaml type definitions using `piqic` -- Piq interface
compiler. 

`piqic ocaml` command takes a Piqi module and produces `.ml` file
containing:
- OCaml module which corresponds to the source Piqi module;
- OCaml type definitions;
- functions for serializing and de-serializing OCaml values.

Piqi types are naturally mapped to OCaml types:
- bool, string, float are mapped to correspondent OCaml types
- various integer types are mapped to OCaml's int, int32 or int64
- binaries are mapped to strings
- variants are mapped to OCaml's polymorphic variants
- records are mapped to OCaml's records where each OCaml record is
  put it its own recursive sub-module. Such mapping method provides a
  workaround for OCaml's flat record label namespace and it is actually
  very convenient when used with special CamlP4 macros.

Piqi allows to add custom type mappings. For example, it is easy to add
support for OCaml's nativeint, bigint or any other OCaml type (not sure
about parametric types, though).

To get a feeling how it all looks like, here is a couple of examples:

- Piqi type specification written in Piqi (i.e. self-specification):

  http://github.com/alavrik/piqi/blob/master/piqi.org/piqtype.piqi

- This is how the above specification is mapped to OCaml (NOTE: this is
  a hand-written spec which is used during the bootstrapping 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2010-06-29 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of June 22 to 29, 2010.



1) Plasma MapReduce, PlasmaFS
2) Symbol type
3) Other Caml News


1) Plasma MapReduce, PlasmaFS
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/348dabaeb60a6709#

** Gerd Stolpmann announced:

I'm very proud to announce the public availability of Plasma MapReduce,
a map/reduce compute framework, and PlasmaFS, the underlying distributed
filesystem.

Plasma MapReduce is a distributed implementation of the map/reduce
algorithm scheme. In a sentence, map/reduce performs a parallel List.map
on an input file, sorts and splits the output by some criterion into
partitions, and runs a List.fold_left on each partition. Only that it
does not do that sequentially, but in a distributed way, and chunk by
chunk. Because of this Plasma MapReduce can process very large files,
and if run on enough computers, this also will work in reasonable time.
Of course, map and reduce are Ocaml functions here.

This all works on top of a distributed filesystem, PlasmaFS. This is a
user-space filesystem that is primarily accessed over RPC (but it is
also mountable as NFS volume). Actually, most of the effort went here.
PlasmaFS focuses on reliability and speed for big blocksizes. To get
this, it implements ACID transactions, replicates data and metadata with
two-phase commit, uses a shared memory data channel if possible, and
monitors itself. Unlike other filesystems for map/reduce, PlasmaFS
implements the complete set of usual file operations, including random
reads and writes. It can also be used as unspecialized global
filesystem.

Both pieces of software are bundled together in one download. The
project page is

http://projects.camlcity.org/projects/plasma.html

This is an early alpha release (0.1). A lot of things work already, and
you can already run map/reduce jobs. However, it is in no way complete.

For discussions on specifics of Plasma there is a separate mailing list:

https://godirepo.camlcity.org/mailman/listinfo/plasma-list
  

2) Symbol type
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/475408faa9427aaa#

** José Romildo Malaquias asked, Michael Ekstrand said, and Nicholas Kidd 
suggested:

  Is there a symbol type in OCaml, with a constant time comparison
  function? Something like symbols from Scheme and LISP or atoms from
  Prolog. Useful in compiler construction.

 Not directly.  As I see it, you have two decent options:

 - Use/write a symbol table which interns symbols to integers.  The
 resulting integers can be compared.
 - Use/write a symbol table which interns symbols to unique string
 instances, so SymTbl.intern foo returns the existing string object if
 one already exists, and the string object passed in if it's never been
 seen before.  The resulting strings can be compared with == rather than
 = in constant time.

 Either of these options would be fairly similar to how symbols work
 under the hood in a Lisp implementation, I believe.
Use the Ocaml hash-consing library.

http://gallium.inria.fr/ml2006/accepted/5.html
http://www.lri.fr/~filliatr/ftp/publis/hash-consing2.pdf
  
** bluestorm also suggested:

If your set of symbol is closed, you can use a variant type (sum type). 

type symbols = 
| A 
| B 

If you really need open symbols, you can use [polymorphic variants]. 
Let tag_a foo = (`A, foo) 

 [polymorphic variants] 
http://caml.inria.fr/pub/docs/manual-ocaml/manual006.html#toc36 

However, you won't have convenience functions such as string_of_symbol; you 
would have to define them yourself. 
  

3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

LLVM Backend for DDC.:
  http://www.mega-nerd.com/erikd/Blog/CodeHacking/DDC/llvm_backend.html

Post-OWASP AppSec Research:
  
http://dutherenverseauborddelatable.wordpress.com/2010/06/28/post-owasp-appsec-research/

FP-Syd #25.:
  http://www.mega-nerd.com/erikd/Blog/FP-Syd/fp-syd-25.html

Plasma: Map/Reduce for Ocaml:
  http://blog.camlcity.org/blog/plasma1.html
  

Old cwn


If you happen to miss a CWN, you can send me a message
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a look at
the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-09-15 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of September 08 to 15,
2009.

1) ocaml-fileutils v0.4.0
2) ocamlfind and GODI packaging sprint summary
3) Partially hiding modules in packages
4) polymorphic method.
5) A kind of syslog functionality
6) Ocamldoc and multiple packages
7) Other Caml News


1) ocaml-fileutils v0.4.0
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/e0e342415b599e51#


** Sylvain Le Gall announced:

Ocaml fileutils is aimed to be a platform independent library to perform
operation on file like:
- mv
- cp
- rm
- mkdir
- touch
- which...

Comes also with a module to manipulate abstract filename:
- classification
- make_relative: made a filename relative to another
- make_absolute

This new release simplify module structure (nested modules are not
required anymore) and comes with a more clear documentation. It also
removes parser/lexer for path which was little bit overkilling. Some
operations have been optimized for speed (like find) -- coming close in
term of performance to standard POSIX commands.

Link:
http://le-gall.net/sylvain+violaine/ocaml-fileutils.html


2) ocamlfind and GODI packaging sprint summary
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/eddb07cf52acb357#


** Hezekiah M. Carty announced:

The OCaml packaging sprint is now complete.  It was quite a success!

In total, seven packages were worked on today as part of this effort:

- cairo-ocaml
- bitstring
- mlpost
- ocamlgsl
- Deriving
- coThreads
- Uuidm

Out of these seven packages, the packaging efforts are in several states.

New package available in GODI:
- ocamlgsl

Ready for GODI, pending upload:
- bitstring
- Uuidm

Almost ready, requiring a bit more testing/tweaking:
- Cairo-OCaml
- mlpost

In progress:
- Deriving
- coThreads

So ocamlgsl is out there now and installable in GODI, with the other
packages hopefully following in the next few days.

You can read more, and find some ideas for libraries to package if you
are interested, at the wiki page:

http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging

Thanks to everyone who was involved in the packaging effort today!


3) Partially hiding modules in packages
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/3984117e6bb6129f#


** Alexey Rodriguez asked:

My question is about how to hide modules (or parts thereof) in
an ocaml package from the outside world (users of the package).

I am trying to build an ocaml package with internal functionality
(types and functions)
that I do not want to expose. I have two modules in the package implemented
by
foo.ml and bar.ml. The structure of each .mli looks like this:

 module Foo = sig
   type t
   val make : t
   val change : t - t

   (* Internal, not to be exposed. *)
   val unsafe_change : t - t
 end

 module Bar = sig
   type t
   val combine : t - Foo.t - t (* uses unsafe_change *)
 end

As you see Foo exports unsafe_change because Bar needs it.
I compile both modules using -for-pack Foobar and build them using
the -pack option.
However, now I want to hide Foo.unsafe_change from the package
export list (if there
is such a thing) so that main.ml cannot call it. I see the following
options:

* Merge foo.ml and bar.ml so that unsafe_change does not need to be exposed.
 I don't like this, the modules could be very large.
* Split Foo into Foo_internal and Foo, and somehow keep Foo_internal
 invisible. I don't know how to do this. I would use exposed-modules in
 Cabal which is a package manager for Haskell.
* Add the file foobar.mli which contains the signatures of Foo and Bar
but hiding
 Foo.unsafe_change. I think it could work, but I would have to repeat
much of the Foo
 and Bar interfaces. I tried this but it didn't work, ocaml complains
as follows:

 Error: The implementation (obtained by packing)
does not match the interface foobar.mli:
The field `Foo' is required but not provided

 I am attaching a tarball of this attempt in case someone knows what
went wrong.
 The example is a bit different from the example in the email.

So the question is:

 What solution do you follow when you want to hide (part of) a module
in a package?
 Keep in mind that the hidden parts should still be exposed to the
modules inside
 the package.

A related question is how to expose the representation Foo.t so that
Bar can manipulate it
directly, but at the same time keep it hidden from users of the
package. The following easy
hack works. Create foo_type.mli with the definition of the type t:

 type t = int

and redefine 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-09-08 Thread Alan Schmitt
Hello,

Here is the latest Caml Weekly News, for the week of September 01 to 08,
2009.

1) Dynamic loading of native code : what about librairies and packs ?
2) Windows Vista/7 specific functions
3) Documentation to start
4) Camomile library tutorial/examples?
5) OCaml on Android
6) ocamlfind and GODI packaging sprint this Wednesday, 9/9
7) Other Caml News


1) Dynamic loading of native code : what about librairies and packs ?
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/cf68c5465cda89ed/9c767ce0eec07e0b


** Continuing this old thread, Pierre-Loïc Garoche asked:

I am still having some problems with the dynamic loading of native code.
Allow
me to give you an extremely simple example to illustrate my problem. I hope
you can clarify my understanding of it.

My problem concerns the dynamic loading of native code where the dynamic
code
loaded depends on another library.

Basically there are three files:
- main.ml, dynamically loading the plugin
- plugin.ml, the loaded code that depends on the external lib
- mylib.ml, the external lib

///
main.ml:
let _ = print_string main\n
let _ = Dynlink.loadfile MyPlugin.cmxs

compiled with ocamlopt -o MyProg dynlink.cmxa main.ml

///
mylib.ml:
let _ = print_string mylib\n
let myval : (int , int) Hashtbl.t = Hashtbl.create 13

compiled with ocamlopt -a -linkall -o mylib.cmxa mylib.ml

//
plugin.ml:
let _ = print_string plugin\n
let cst = Mylib.myval

compiled and linked to build a shared library with
ocamlopt -shared -linkall -o MyPlugin.cmxs mylib.cmxa plugin.ml

Running it gives me the following error
error loading shared library: blabla/MyPlugin.cmxs: undefined symbol:
camlHashtbl__create_79


Remark1 : Of course, building a standalone plugin works:
ocamlopt -o PluginSelf mylib.cmxa plugin.cmx

Remark2: If I don't rely on an external module and replace myval by an
integer
or any other self defined type value, it works as well.

Remark3: The linkall option does not seems to have an impact on such simple
example.


Question: How should I link it to rely on external libraries and produce a
valid MyPlugin.cmxs ?

Any hint or comment will be greatly appreciated !

** Christophe Troestler suggested:

You should reference « Hashtbl » in your main program :

 main.ml:
 module ForLinking_1 = Hashtbl
 let () = print_string main\n
 let () = Dynlink.loadfile MyPlugin.cmxs

BTW, if you want your program to work in both bytecode and native
code, you should use:

 Dynlink.loadfile (Dynlink.adapt_filename MyPlugin.cmo)

** Alain Frisch also added:

You need to ensure that the main program is linked with all the modules that
are needed by the dynamically loaded modules (including the modules from the
standard library). Linking the main program with -linkall should solve your
problem.


2) Windows Vista/7 specific functions
Archive: 
http://groups.google.com/group/fa.caml/browse_thread/thread/0f878746f238e961#


** Reed Wilson asked:

I am going to be writing a native-code 64-bit program which takes advantage
of
some Windows Vista-only features (transactional NTFS), and I was wondering
how
to get it working in OCaml. I have made numerous interfaces to Windows XP
functions, but the problem is that the NTFS transactional functions are only
available through MSVS 2008 and the Vista/7 SDKs, which OCaml seems to not
compile with. I tried using the new Windows 7 SDK tools to compile the
program
to native code, but it kept giving me errors with not being able to find
bufferoverflowu.lib.

Does anybody know if there is any way to compile a 64-bit OCaml with the
newer
Windows SDKs, or failing that, to at least tell OCaml how to properly link
things with them?

** David Allsopp replied:

Having hacked away with the Win64 port before I thought I?d have a go. The
first thing I noticed is that Microsoft have finally released the x86 and
x64
compilers in the same package (this was a pain if you wanted to build MSVC
and
MSVC64 ports as you needed two SDKs to do it...) ? though I haven?t tried
building the 32-bit MSVC port from this SDK yet.

Here?s what I did (you?ll have to excuse my idiosyncratic way of copying
binary files into the OCaml tree ? these can be replaced with PATH changes
if
you want. I copy things around so that ocamlopt always works without needing
a
special build environment or vast compiler suites permanently in my PATH).

The build is slightly complicated because you need to build flexdll
directly.

Make sure you have Cygwin base with with Devel\make and Devel\subversion
added

I installed the Win7 SDK to C:\Dev\WinSDK (though it still irritatingly puts
the compilers in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC). I
didn?t bother installing 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-06-16 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of June 09 to 16,  
2009.


1) PhD position in Nottingham
2) Offre d'emploi INRIA Saclay
3) JOB: post-doc at MSR-INRIA Joint Centre
4) distribution.ml, a poor's man MapReduce for OCaml using MPI
5) syncweb, literate programming meets unison
6) OCaml 3.11.1 released
7) Other Caml News


1) PhD position in Nottingham
Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/0977ec89bb1d8c0e89c28ce32fcfcee3.en.html 



** Venanzio Capretta announced:

PhD position in Type Theory at Nottingham
-

A new PhD position is available in the Functional Programming  
Laboratory at

the University of Nottingham. The topic of research for the project is
Programming and Reasoning with Infinite Structures: it consists in the
theoretical study and development of software tools for coinductive  
types

and structured corecursion.

The candidate must be a UK resident with an excellent degree in Computer
Science or Mathematics at MSc (preferred) or BSc level (first class or
equivalent). The applicant should have a good background in mathematical
logic, theoretical computer science or functional programming. (S)he  
should

be interested doing research in type theory, constructive mathematics,
category theory and foundations of formal reasoning.

We offer: PhD place with living expenses (standard UK level) for 3  
years.

The grants also provide laptops and travel expenses for conference and
workshop visits. Nottingham University provides a vibrant research
environment in the Functional Programming Laboratory.

Deadline for applications: 20 June 2009.
Send a cover letter and your CV to Venanzio Capretta  
(v...@cs.nott.ac.uk).

Please contact me for any additional information that you need.


2) Offre d'emploi INRIA Saclay
Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/e11553d5273f4782ad247ef9dbf7366b.en.html 



** Sylvain Conchon announced:

Offre d'emploi: Ingénieur de développement


Dans le cadre d'une action de développement technologique (ADT), le
centre de recherche INRIA Saclay souhaite recruter un programmeur
OCaml en tant qu'ingénieur de développement pour une durée d'un an
(renouvelable une fois) à partir de l'automne 2009.

Mots clés: vérification de programmes, démonstration automatique, OCaml


Lieu de travail:


Centre de recherche INRIA Saclay - Ile de France
Parc Orsay Université
ZAC des vignes
32, rue Jean Rostand - Bât K
91893 Orsay Cedex France  Cedex


Contexte:
-

L'équipe de recherche ProVal propose des méthodes et outils de
développement logiciel faisant une large place à la preuve de
programmes assistée par ordinateurs. Des applications logicielles
critiques dans les domaines du transport, des transactions bancaires
ou des télécommunications sont mises rapidement sur le marché. Pour
garantir aux utilisateurs un comportement acceptable, il est
nécessaire qu'une large part de vérification soit réalisée de manière
mécanique. Nous développons des environnements qui à partir d'une
description formelle du comportement attendu du programme, exprimée
par le développeur dans un langage adapté à son problème, engendre des
formules logiques (obligations de preuve) suffisantes pour garantir la
correction du programme. Ces formules peuvent ensuite être traitées
par des démonstrateurs adaptés tel que Alt-ergo[1].

Ces activités de l'équipe se déroulent dans le cadre de contrats ANR
Decert (Déduction certifiée) et U3CAT (Unification de techniques
d'analyse statique de codes C critiques). Ce dernier associant en
particulier les partenaires industriels Airbus France et Dassault
aviation.


Activité:
-

L'ingénieur réalisera des outils et des expérimentations scientifiques
autour du démonstrateur Alt-Ergo afin d'améliorer son efficacité dans
le domaine de la certification de codes critiques.

 * Améliorations des performances d'Alt-Ergo comme prouveur de la
   plate-forme de certification Caveat/Frama-C/Why[2]

 * Traitement des cas d'échecs par génération de contre-exemples et
   traitement semi-interactif

 * Augmentation de la visibilité d'Alt-Ergo (e.g participation à la
   compétition internationale SMT-Comp)


Compétences:


 * Formation en informatique et connaissances du développement
   logiciel et des outils associés (cvs/svn, Makefile, documentation,
   tests, débogage,...) ;

 * Langages de programmation : Ocaml;

 * Connaissances appréciées (non obligatoires): logique,
   démonstration automatique, compilation;

 * Maîtrise de l'anglais technique et scientifique;

 * Bonnes aptitudes rédactionnelles.


Contacts:
-

Sylvain Conchon et Evelyne 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-05-26 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of May 19 to 26, 2009.

1) OCaml version 3.11.1+rc0
2) camlp5 5.12 compatible with ocaml 3.11.1
3) Other Caml News


1) OCaml version 3.11.1+rc0
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/57738498a2510adc# 



** Damien Doligez announced:

It is our pleasure to announce that release 3.11.1 is imminent.  We have
uploaded a release candidate at this address:

http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-3.11.1+rc0.tar.gz

See the list of changes below.


We need you to test this on as many system types as possible.  Please
report success or failure to damien.doli...@inria.fr as usual.

-- Damien


Objective Caml 3.11.1:
--

Bug fixes:
- PR#4095: ocamldebug: strange behaviour of control-C
- PR#4403: ocamldebug: improved handling of packed modules
- PR#4650: Str.regexp_case_fold mis-handling complemented character  
sets [^a]

- PR#4660: Scanf.format_from_string: handling of double quote
- PR#4666: Unix.exec* failure in multithread programs under MacOS X  
and FreeBSD

- PR#4667: debugger out of sync with dynlink changes
- PR#4678: random out of memory error with systhreads
- PR#4690: issue with dynamic loading under MacOS 10.5
- PR#4692: wrong error message with options -i and -pack passed to  
ocamlc

- PR#4699: in otherlibs/dbm, fixed construction of dlldbm.so.
- PR#4704: error in caml_modify_generational_global_root()
- PR#4708: (ocamldoc) improved printing of infix identifiers such as  
lor.

- PR#4722: typo in configure script
- PR#4729: documented the fact that PF_INET6 is not available on all  
platforms

- PR#4730: incorrect typing involving abbreviation type 'a t = 'a
- PR#4731: incorrect quoting of arguments passed to the assembler on  
x86-64

- PR#4735: Unix.LargeFile.fstat cannot report size over 32bits on Win32
- PR#4740: guard against possible processor error in
  {Int32,Int64,Nativeint}.{div,rem}
- PR#4745: type inference wrongly produced non-generalizable type  
variables.

- PR#4749: better pipe size for win32unix
- PR#4756: printf: no error reported for wrong format '%_s'
- PR#4758: scanf: handling of \newline by format '%S'
- PR#4766: incorrect simplification of some type abbreviations.
- PR#4768: printf: %F does not respect width and precision  
specifications

- PR#4769: Format.bprintf fails to flush
- PR#4775: compiler crash on crazy types (temporary fix)
- PR#4776: bad interaction between exceptions and classes
- PR#4780: labltk build problem under Windows.
- PR#4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix  
error.

- PR#4792: bug in Big_int.big_int_of_int64 on 32-bit platforms.
- Module Parsing: improved computation of locations when an ocamlyacc  
rule

 starts with an empty nonterminal
- Type-checker: fixed wrong variance computation for private types
- x86-32 code generator, MSVC port: wrong fld instruction generated.
- ocamlbuild: incorrectly using the compile-time value of $OCAMLLIB
- Makefile problem when configured with -no-shared-libs
- ocamldoc: use dynamic loading in native code

Other changes:
- Improved wording of various error messages
 (contributed by Jonathan Davies, Citrix).
- Support for 64-bit mode in Solaris/x86 (PR#4670).


2) camlp5 5.12 compatible with ocaml 3.11.1
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/57738498a2510adc# 



** Daniel de Rauglaudre announced:

Camlp5 5.12 has been released, compatible with ocaml version 3.11.1.
Download at:
 http://pauillac.inria.fr/~ddr/camlp5/


3) Other Caml News

** From the ocamlcore planet blog:

Thanks to Alp Mestan, we now include in the Caml Weekly News the links  
to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/ 
.


Is Immutable Data Slow?:
  http://alaska-kamtchatka.blogspot.com/2009/05/is-immutable-data-slow.html 



FP-Syd #15.:
  http://www.mega-nerd.com/erikd/Blog/FP-Syd/fp-syd-15.html

Looking for a message broker; semantics of the RabbitMQ STOMP adapter:
  http://eigenclass.org/R2/writings/rabbitmq-STOMP-semantics


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}$'?'1':1
zM
If you know of a better way, 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-05-12 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of May 05 to 12, 2009.

1) arm backend
2) memory profiling
3) OCaml 3.10.2 on iPhone unified patch
4) Custom blocks and finalization
5) Ocamlopt x86-32 and SSE2
6) Call for translators of the Unix system programming course
7) Other Caml News


1) arm backend
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/0e411d2051ead4b4# 



** Deep in this thread, Joel Reymont asked and Xavier Leroy answered:

 Is the ARM backend (ocamlopt) usable and actively maintained?

In brief: yes modulo ABI issues; yes.

In more details:

In OCaml 3.11 and earlier, the ARM port uses an old ABI (software
conventions on using registers, etc).  This ABI corresponds to the
arm port of Debian; I don't know about other Linux distros.
OCaml/ARM works like a charm on platforms supported by Debian/arm.
I use it on a Linksys NSLU2.

However, most embedded Linux/ARM platforms use a more recent,
incompatible ABI called EABI.  In Debian Lenny, it's available under
the name armel.

I recently revised the OCaml/ARM port to adapt it to EABI and to
software floating-point emulation.  You can find it in the CVS trunk,
and testing and feedback is most welcome.  It works fine under Debian
Lenny armel.

Floating-point performance is better than with the old port, because
the latter used floating-point instructions that are no longer
available on contemporary ARM processors and therefore had to be
trapped and emulated by the kernel.  In contrast, with soft
floating-point, emulation is performed in user land by C library
functions, which can also take advantage of vector float
instructions if the processor supports them.

Concerning the iPhone, it is not supported out of the box by 3.11 nor
by the CVS trunk code.  For 3.11, several patches have been mentioned
on this list; it would be great if someone with iPhone development
experience could combine them and publish a unified patch.

For the CVS trunk code, it seems we are getting close: as far as I
could see, MacOSX/ARM uses EABI plus Apple's signature approach to
dynamic linking.  However, I haven't yet succeeded in running Apple's
iPhone SDK compilers from the command-line.  (It looks like one of
those Microsoft SDK's that assume everyone is developing from the
vendor-supplied IDE...)  Again, I welcome feedback and patches from
iPhone development experts.


2) memory profiling
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/370d07b9c2a71cb5# 



** Christoph Bauer asked and Dmitry Grebeniuk answered:

 what is the best option to do memory profiling with ocaml?
 Is there a patch of ocaml-memprof for 3.11.0? What about
 objsize?

 If you want to use objsize with ocaml 3.11, you should get
the new version of objsize -- 0.12:
http://forge.ocamlcore.org/projects/objsize/
 OCaml has new heap since 3.11, and old versions won't work.

 objsize has an unresolved make-related problem with building
on msvc/win32 (object/library file extensions, to be specific), so
one should build objsize manually on msvc (not a hard thing.
but I'll fix it in near future).

** Sylvain Le Gall also replied:

I use a more simple approach (though I have used objsize to estimate
some datastructure size, but only in the toplevel): GC allocation rate.

You can override a little ocaml-benchmark to measure the allocation rate
of the GC. This gives you a pretty good understanding on the fact you
are allocating too much or not.

Regards,
Sylvain Le Gall

ps: here is a part of my benchmarkExt.ml file


(** Benchmark extension
   @author Sylvain Le Gall
 *)

open Benchmark;;

type t =
   {
 benchmark: Benchmark.t;
 memory_used: float;
   }
;;

let gc_wrap f x =
 (* Extend sample to add GC stat *)
 let add_gc_stat memory_used samples =
   List.map
 (fun (name, lst) -
name,
List.map
  (fun bt -
 {
   benchmark = bt;
   memory_used = memory_used;
 }
  )
  lst
 )
 samples
 in

 (* Call throughput1 and add GC stat *)
 let () =
   print_string Cleaning memory before benchmark; print_newline ();
   Gc.full_major ()
 in
 let allocated_before =
   Gc.allocated_bytes ()
 in
 let samples =
   f x
 in
 let () =
   print_string Cleaning memory after benchmark; print_newline ();
   Gc.full_major ()
 in
 let memory_used =
   ((Gc.allocated_bytes ()) -. allocated_before)
 in
   add_gc_stat memory_used samples
;;

let throughput1
 ?min_count ?style
 ?fwidth?fdigits
 ?repeat?name
 seconds
 f x =

 (* Benchmark throughput1 as it should be called *)
 gc_wrap
   (throughput1
  ?min_count 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-03-31 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of March 24 to 31,  
2009.


1) First release of focalize, a development environment for high  
integrity programs.

2) OSpec - BDD for OCaml
3) ocaml cross-compiler
4) PowerPC 405
5) Google summer of Code proposal


1) First release of focalize, a development environment for high  
integrity programs.
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/c69ec89f1a928509# 



** Pierre Weis announced:

Hi to all of you careful bug hunters and happy hackers reading this  
message!


It is my pleasure to announce the first public release for FoCaLize, a  
purely
functional language and environment to express and formally prove  
algorithms

and their implementation.

(0) What is it ?


FoCaLize is an integrated development environment to write high  
integrity
programs and systems. It provides a purely functional language to  
formally
express specifications, describe the design and code the algorithms.   
Within
the functional language, FoCaLize provides a logical framework to  
express the
properties of the code. A simple declarative language provides the  
natural
expression of proofs of those properties from within the program  
source code.


The FoCaLize compiler extracts statements and proof scripts from the  
source
file, to pass them to the Zenon proof generator that produces in turn  
the Coq

proof terms that are formally verified.

The FoCaLize compiler also generates the code corresponding to the
program as an Objective Caml source file. This way, programs  
developped in
FoCaLize can be efficiently compiled to native code on a large variety  
of

architectures.

Last but not least, FoCaLize automatically generates the documentation
corresponding to the development, a requirement for high evaluation
assurance.

The FoCaLize system provides means for the developers to formally  
express
their specifications and to go step by step (in an incremental  
approach) to

design and implementation, while proving that such an implementation
meets its specification or design requirements. The FoCaLize language  
offers

high level mechanisms such as inheritance, late binding, redefinition,
parametrization, etc.  Confidence in proofs submitted by developers or
automatically done relies on Coq formal proof verification.

FoCaLize is a son of the previous Focal system. However, it is a  
completely

new implementation with vastly revised syntax and semantics, featuring a
rock-solid infrastructure and greatly improved capabilities.

(1) Where to find it ?
--
FoCaLize home page is http://FoCaLize.inria.fr/
FoCaLize source files can be found at
http://FoCaLize.inria.fr/download/focalize-0.1.0.tgz

(2) How to install it ?
---
Uncompress, extract, then read the INSTALL file in the newly created
directory focalize.0.1.0 and follow the simple instructions written  
there.



2) OSpec - BDD for OCaml
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/13b63aa5afc13a61# 



** Andre Nathan announced:

I would like to announce the availability of OSpec, an RSpec-inspired
Behavior-Driven Development library for OCaml using a Camlp4 syntax
extension. It is available at

 http://github.com/andrenth/ospec/tree/master

Here's a simple example of OSpec's syntax:

 describe An even number do
   it should be divisible by two do
 let divisible_by_two x = x mod 2 = 0 in
 42 should be divisible_by_two
   done;

   (* or simply: *)
   it should be divisible by two do
 (42 mod 2) should = 0
   done
 done

I must say that this is the first time I use Camlp4 (in fact I started
writing this to learn about it), so there are probably better ways to
accomplish the functionality that OSpec provides. The code is horrible
and it will make your eyes bleed. However, since there was a question
about the availability of such a library recently on the list, I decided
to make it public. Maybe I can get some contributions to this :)


3) ocaml cross-compiler
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/c8b919211170f402# 



** Joel Reymont asked and Richard Jones replied:

 Is there a ready-made Fedora package for the OCaml cross-compiler?

Note that we _only_ support Fedora Rawhide (the development version of
OCaml) and future Fedora 11 and above.  To find out about Rawhide, see:

http://fedoraproject.org/wiki/Releases/Rawhide

If you have F-10, I believe that you can upgrade it to Rawhide 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-03-24 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of March 17 to 24,  
2009.


1) XML output
2) ocaml-http is looking for a new maintainer
3) Google summer of Code proposal


1) XML output
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/165323537f036e34# 



** Rémi Dewitte asked and Gerd Stolpmann answered:

 I have used pxp to parse xml and I am happy with it. I'd like now to
 produce xml and wonder what are the options to do so (possibly the
 simpliest).

Maybe not the simplest: Use the PXP preprocessor to create the output
tree, and print the tree:

http://projects.camlcity.org/projects/dl/pxp-1.2.1/doc/manual/html/ref/Intro_preprocessor.html 

http://projects.camlcity.org/projects/dl/pxp-1.2.1/doc/manual/html/ref/Pxp_document.document.html#2_WritingdocumentsasXMLtext 





 I think I am going to start with the Printf module. I wonder how well
 it handles utf8 for example.

UTF-8 are just bytes for printf.

 And I'll have to write a kind of xml_encode function. I am pretty  
sure

 it has already be done somewhere !

let xml_encode =
  Netencoding.Html.encode
~in_enc:`Enc_utf8
~out_enc:`Enc_usascii
~prefer_names:false
()

That would assume the input is UTF-8 encoded, and the output is
ASCII-encoded. You can control which ASCII characters get the special
XML representation ...; with the unsafe_chars optional argument.
Docs are at
http://projects.camlcity.org/projects/dl/ocamlnet-2.2.9/doc/html-main/Netencoding.Html.html 



** Sylvain Le Gall also replied:

Maybe it is a bit overkilling, but there is also ocamlduce.

See there:
http://www.cduce.org/ocaml
(dev for ocaml 3.11:)
http://ocamlduce.forge.ocamlcore.org/
http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=ocamlduce/ocamlduce.git;a=summary 



OCamlduce can also be used with Eliom/OCsigen.

AFAIK, using ocamlduce can help you to type check your output tree
directly within OCaml compiler...

** Matthieu Wipliez also replied:

Yet another solution is Xmlm by Daniel Bünzli.

http://erratique.ch/software/xmlm

This is probably the easiest and lightweight solution: Xmlm comes as a  
single
module and its interface, and it's BSD so you can just copy/paste it  
into your

project.

** Michael Ekstrand then added:

I second the xmlm suggestion.  Polling event-based parsing is very slick
and maps well into the functional paradigm, and its XML writing support
(generating a stream of events identical to those you read) makes
generation quite intuitive and reliable.


2) ocaml-http is looking for a new maintainer
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/3e99820fd9b65b57# 



** Stefano Zacchiroli announced:

Hi all, ocaml-http [1] is looking for a new maintainer.
More details have been written on my blog [2].

If you are interested in taking over the maintenance, please mail me
in private.

Cheers.

[1] http://upsilon.cc/~zack/hacking/software/ocaml-http/
[2] http://upsilon.cc/~zack/blog/posts/2009/03/ocaml-http_is_looking_for_a_new_maintainer/ 




3) Google summer of Code proposal
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/3249f410fe061579# 



** In this long thread full of technical posts, Andrey Riabushenko  
said and Xavier Leroy replied:


 I would like to develop LLVM frontend to Ocaml language. LLVM does  
participate
 in GSoC. LLVM do not mind to developed a ocaml frontend as LLVM  
GSoC project.
 I want to discuss details with you before I will make an official  
proposal to

 LLVM. [...]

Do authors of ocaml has something to say about the idea?

Da. A number of things, actually.

1- I know of at least 3, maybe 4 other projects that want to do
something with OCaml and LLVM.  Clearly, some coordination between
these efforts is needed.

2- If you're applying for funding through a summer of code project,
you need to articulate good reasons why you want to combine OCaml and
LLVM.  Ocaml is cool, LLVM is cool, so OCaml+LLVM would be extra
cool is not enough.  It will generate PIC-16 code isn't either.
Run-time code generation could be a good enough reason, but you still
need to weigh the development cost of the LLVM approach against, for
example, hacking the current OCaml code generator so that it emits
machine code in memory instead of assembly code.

3- A language implementation like OCaml breaks down in four big parts:
  1- Front-end compiler
  2- Back-end compiler and code emitter
  3- Run-time system

[cwn] Attn: Development Editor, Latest Caml Weekly News

2009-02-17 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of February 10 to  
17, 2009.


1) XML data binder for Ocaml
2) findlib-1.2.4 (for ocaml-3.11)


1) XML data binder for Ocaml
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/c26df9a185e9afe8# 



** O'Leary, John W asked and Sylvain Le Gall answered:

 Hi all,

 I'm looking for a tool that will take an XML data schema (.xsd) and
 generate data bindings in Ocaml. In other words, I am seeking an  
Ocaml

 equivalent to XSD (for C and C++) and JAXB (for Java).

 Googling didn't immediately turn up anything meeting the above
 description. I'd very much appreciate any pointers.

I think you can try taking a look at two project:
http://www.galaxquery.org/
http://www.cduce.org/ocaml

I think they implement something close to what you want (I mean close,
not what you want unfortunately). At least there is some code in it,
that deal with xsd.

** Richard Jones also replied:

XSD as in the crazy-complicated quasi-standard used in SOAP, WSDL etc?
I'm not sure you'll find any implementations in OCaml - it's hard
enough to implement when you have a large team of people available to
you.

I did a very very partial implementation using CDuce as part of my
SOAP client code for the Google AdWords API.  It's not directly
usable, but maybe you can have a look at it for inspiration anyway:

  http://merjis.com/developers/oc-soap


2) findlib-1.2.4 (for ocaml-3.11)
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/8273ad37caf6aa97# 



** Gerd Stolpmann announced:

I've just uploaded findlib-1.2.4. This is a bugfix release:

 * For ocaml-3.11 some camlp4 libs no longer include dynlink.
   Findlib has a fixed META definition.
 * Bigarray needs unix: This has been fixed in the META file, too.
 * Attempt to fix some space path issues for Win32. It is
   untested, however.

Get findlib from its homepage
(http://projects.camlcity.org/projects/findlib.html). The GODI package
is already updated.


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}$'?'1':1
zM
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
(alan.schm...@polytechnique.org) and I'll mail it to you, or go take a  
look at

the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .



--
Alan Schmitt http://alan.petitepomme.net/

The hacker: someone who figured things out and made something cool  
happen.

 .O.
 ..O
 OOO




PGP.sig
Description: This is a digitally signed message part
___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-06-10 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of June 03 to 10,  
2008.


1) OCaml NAE release cf-0.10, nx-0.0 and iom-0.4
2) Ocamlbuild: could help embedding Ocaml code into shared object?
3) ocamlopt generates binaries with executable stacks


1) OCaml NAE release cf-0.10, nx-0.0 and iom-0.4
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/14abc2c0900cee63# 



** James Woodyatt announced:

My OCaml Network Application Environment project is not abandoned.  
I'm just

not as fast as we would like at producing maintenance releases when the
compiler system changes break my code. Sorry about that. Anyway, I  
have made
some minor updates and pushed out a new set of release files. Here are  
the

highlights...

http://sourceforge.net/projects/ocnae

There's lots more unreleased in CVS, in case anyone wants to go  
peeking at it.

I've just released the relatively stable stuff.

= OCaml NAE Core Foundation (cf) library =

This distribution is the Objective Caml Network Application  
Environment (NAE)
Core Foundation library, which is a collection of miscellaneous  
extensions to

the Objective Caml standard library.

Highlighted features include:

- Functional streams and stream processors (extended).
- Functional bootstrapped skew-binomial heap.
- Functional red-black binary tree (associative array).
- Functional sets based on red-black binary tree.
- Functional real-time catenable deque.
- Functional LL(x) parsing using state-exception monad.
- Functional lazy deterministic finite automaton (DFA).
- Functional lexical analyzer (using lazy DFA and monadic parser).
- Functional substring list manipulation (message buffer chains).
- Gregorian calendar date manipulation.
- Standard time manipulation.
- System time in Temps Atomique International (TAI).
- Unicode transcoding.
- Universal resource identifier (URI) manipulation.

= OCaml NAE Network Extensions (nx) library =

This distribution is the Objective Caml Network Application  
Environment (NAE)
Network Extensions library, which is a set of low-level interfaces  
designed

for advanced network programming.

Highlights include...

- Extended socket interface (supports more options, and UDP w/ 
multicast).

- I/O event multiplexing (with Unix.select).

= OCaml NAE Reactive I/O Monad (iom) library =

This distribution is the Objective Caml Network Application  
Environment (NAE)
Reactive I/O Monad library, which implements I/O monad functions  
designed to

facilitate writing of concurrent, reactive, single-threaded network
application services in a functional style.

Note: see the ISSUES file for a list of open problems in this release.

= Required Components =

This library requires the following external components:

- Objective Caml (v3.10.0 or newer)
- Findlib (tested with v1.1.2p1)


2) Ocamlbuild: could help embedding Ocaml code into shared object?
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/b6d68f592c6e3569# 



** Matthieu Dubuget asked and Romain Bardou answered:

 I often deliver my work as shared objects (DLL, in fact, because I'm
 stuck with Windows at work).

 I would like to have ocamlbuild take care of this, but I don't know
 exactly how to do it?

 The idea would be to split the work in two separate rules.

 The first rule generates a shared object from the Objective Caml  
code:


 rule mloo  cmx* - native.oo.o
 ~dep:%.mloo
 ~prod:%.native.oo.o
 action_for_nativecode

 rule mloo  cmo* - byte.oo.o
 ~dep:%.mloo
 ~prod:%.byte.oo.o
 action_for_bytecode

 The actions should return commands with A -output-obj. But I do not
 know how to write them. It would need a mechanism similar to the one
 used for mlpack. For example, one .mloo file listing the ocaml  
files to

 link into the output object. Dynamic dependencies are to be generated
 from the content of the .mloo file.

 Unfortunately, I have no idea how to write that?

 The second rule would generate a shared object from the .o files.
 Maybe the current clib is enough? I have to add a flag to link
 the runtime engine by adding -lasmrun -lm -ldl (-lm and -ldl being
 deduced from the output of ocaml* -config).

 Am I looking in the right direction?

I know nothing about DLLs and OCaml but if I understand correctly, you  
need

the following.

1) How to parse a file similar to a .mllib file in a plug-in. There is  
an

example in the Ocamlfind plug-in on the wiki:

http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild#Source 



You want to look at the find_packages function.

2) How to generate dynamic dependencies. This is done by calling the  
second

[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-06-03 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of May 27 to June  
03, 2008.


1) Release date for 3.11?
2) First release of Oug: reference graph from ocaml code


1) Release date for 3.11?
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/15126f960406e056# 



** Richard Jones asked and Xavier Leroy answered:

 I'm sure the answer will be 'when it's ready', but is there a release
 date (month / year / ...) for 3.11 or release candidates of 3.11?

I'd like to release by late August, provided no show-stopping problems
show up by then.


2) First release of Oug: reference graph from ocaml code
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/e3a6adf33854ac4d# 



** Maxence Guesdon announced:

I'm glad to announce the first release of Oug (0.1).

Oug is a code analysis tool building reference graphs from OCaml code,  
that
is graphs representing which elements (value, module, class, ...)  
reference

which elements.

It comes with the Ouglib library to be able to embed the analyzer in  
other

OCaml applications.

From the graph, various outputs can be obtained: list of elements not
referenced anywhere (dead code), various graphiz graphs, ...

Oug does not compute the call graph of the given OCaml code; this would
require data flow analysis. For this reason, the dead code dump always
consider that every method is referenced.

The homepage is here:
 http://pauillac.inria.fr/~guesdon/oug.en.html


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}$'?'1':1
zM
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
([EMAIL PROTECTED]) and I'll mail it to you, or go take a  
look at

the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .



--
Alan Schmitt http://alan.petitepomme.net/

The hacker: someone who figured things out and made something cool  
happen.

 .O.
 ..O
 OOO




PGP.sig
Description: This is a digitally signed message part
___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-04-22 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of April 15 to 22,  
2008.


1) Non-tail return
2) unsigned 64-bit integer library
3) forge.OCamlCore.org is now ready to serve the OCaml community
4) OCaml Summer Project decisions are in
5) xsetxmap, unfunctorized, Sexp-lib aware versions of Set and Map
6) Help needed for benchmarking OCaml on AMD64
7) GODI Search


1) Non-tail return
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/8eb3da70eef2d4ff# 



** Seo Sanghyeon announced:

Richard Jones suggested that type-safe return statement which
immediately returns from the innermost function would be useful. So I
developed an implementation. His sample code (from Extlib) works
as-is.

http://sparcs.kaist.ac.kr/~tinuviel/devel/ocaml/

Some notes:
* This depends on nontail exit patch I did as a part of break/continue
patch. break-continue-v2 was broken to break-continue-v3 and
nontail-exit-v1.
* A stack of function's return type is maintained. return e causes
unification of e and return type on the top of the stack. return e
itself is typed as unit.
* Function is translated with implicit catch around body, and return
is translated to raise. Simplification removes implicit catch when no
return is used, so existing codes should compile same.


2) unsigned 64-bit integer library
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/8f7514a44bffe815# 



** Jeff Shaw announced:

If you would like to use C's unsigned long long type in ocaml, please  
try my
library. I've tested it only on Mac OS X ppc32, ocaml 3.10.x. Please  
let me
know about any modifications I should make; for instance, I don't know  
how to
make the library work in windows. Also I haven't tested storing  
UInt64.t in

hashtables much yet.

http://www.msu.edu/~shawjef3/uint64lib.zip

Quick instructions:
unzip uint64lib.zip
cd uint64lib
ocaml compile.ml
ocaml uInt64.cma
#install_printer UInt64.printer16;;
UInt64.of_string 0x123456789abcdef;;


3) forge.OCamlCore.org is now ready to serve the OCaml community
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/8b37e68756ea2669# 



** Stefano Zacchiroli announced:

**OCamlCore.org is ready!**

During the last few weeks, the OCamlCore.org Team, with the help of  
many other
members of the community, worked hard to fix a number of problems on  
the site.

Now we think it is ready for prime time. Therefore, following from the
previous announcement [1][2] of the availability of an OCaml planet  
and the
OCaml forge beta testing, we are now ready to allow full public access  
to

OCaml forge.

 [1] http://groups.google.com/group/fa.caml/msg/6faedd72f77fd0df
 [2] http://groups.google.com/group/fa.caml/msg/f8342697120413fd

A forge is a set of services for software projects, including version
control systems (CVS, SVN, ...), mailing lists, download areas, bug
tracking systems, ... Well known examples are sourceforge.net, GNA, and
Savannah. The forge for the OCaml community [3] will be specifically
aimed at hosting software projects related to the OCaml programming
language.

 [3] http://forge.ocamlcore.org/

This new forge has been beta tested, but you could still found some  
bugs.  In

this case, don't hesitate to submit bug to the Site Admin project [4]

[4] http://forge.ocamlcore.org/projects/siteadmin/

So if you want to start an ocaml project on forge.ocamlcore.org, sign-up
for an account on: http://forge.ocamlcore.org

We want to limit the use of this forge to OCaml related project. This  
include
software or library written in OCaml, but also projects around OCaml,  
using
derived languages (JoCaml, OCamlDuce, ...) or providing service for  
OCaml

community (tools for conference organization...).

Help needed
---

At the moment, we have set up an hosting service for git and darcs
(git.ocamlcore.org and darcs.ocamlcore.org). We are looking for
experienced forge administrator that can allow us to manage this two SCM
through GForge.  Contact us if you are interested.

We are also looking for talented web designer to make the look of
ocamlcore.org nicer. Join the project ocamlcore-theme and read the
README file to know how to proceed...
http://forge.ocamlcore.org/projects/ocamlcore-theme/
http://forge.ocamlcore.org/plugins/scmsvn/viewcvs.php/trunk/README.txt?root=ocamlcore-themeview=markup 



Regards,
the OCamlCore.org Team.
(Sylvain Le Gall, Romain Beauxis, Stefano Zacchiroli, Pietro Abate)

PS: you will find the classical LGPL with static linking exception
License 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-04-08 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of April 01 to 08,  
2008.


1) CamlPy 0.1
2) ocaml bitmatch (Erlang-style bitstrings for OCaml)
3) Ocsigen 1.0.0
4) DEFUN08: Call for Talks  Tutorials (co-located w/ ICFP08)
5) tophide 1.0.0 announcement


1) CamlPy 0.1
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/38e1b7cccdff6e96# 



** John Whitington announced:

I've just uploaded the first version of a library for communicating  
between

python and OCaml, together with a little proof-of-concept interface to
WxPython, as a first step towards a better GUI tool for OCaml.

These two blog posts explain:

Background:
http://coherentgraphics.blogspot.com/2008/03/proper-gui-for-ocaml-part-one.html 



Release:
http://coherentgraphics.blogspot.com/2008/04/proper-gui-for-ocaml-part-two.html 




2) ocaml bitmatch (Erlang-style bitstrings for OCaml)
Archive: http://groups.google.com/group/fa.caml/browse_thread/thread/c72e028d0248aada# 



** Richard Jones:

In the finest tradition of version 0.1 announcements, this is the
first announcement of a highly experimental camlp4 syntax extension
which implements Erlang-style bitstrings, matching over bitstrings,
and construction of bitstrings.

 Source:  http://www.annexia.org/tmp/ocaml-bitmatch-0.1.tar.gz
 License: LGPLv2+ with OCaml linking exception

Erlang has a byte-oriented data type which can be treated as a
stream of bits, and provides rather elegant features for creating and
matching over such streams.  This is a key feature of Erlang and was
developed because of its history in telecommunications.  (More about
the feature in this paper:
http://user.it.uu.se/~kostis/Papers/padl07.pdf)

I have written a camlp4 syntax extension which does much the same in
OCaml.  For example, you can now effortlessly parse IP packets:

 let display pkt =
   bitmatch pkt with
   (* IPv4 packet header from RFC 791:
   0   1   2   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |Version|  IHL  |Type of Service|  Total Length |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | Identification|Flags|  Fragment Offset|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Time to Live |Protocol   | Header Checksum   |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Source Address  |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |Destination Address|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |Options|Padding|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *)
   | 4 : 4; hdrlen : 4; tos : 8; length : 16; (* same as above in  
OCaml *)

 identification : 16; flags : 3; fragoffset : 13;
 ttl : 8; protocol : 8; checksum : 16;
 source : 32;
 dest : 32;
 options : (hdrlen-5)*32 : bitstring; (* NB computed length *)
 payload : -1 : bitstring -

 printf IPv4:\n;
 printf   header length: %d * 32 bit words\n hdrlen;
 printf   type of service: %d\n tos;
 printf   packet length: %d bytes\n length;
 (* etc *)

   (* IPv6 packet header *)
   | 6 : 4; tclass : 8; flow : 20;
 length : 16; nexthdr : 8; ttl : 8;
 source : 128 : bitstring;
 dest : 128 : bitstring;
 payload : -1 : bitstring -

 printf IPv6:\n;
 printf   traffic class: %d\n tclass;
 printf   flow label: %d\n flow;
 printf   packet (payload) length: %d bytes\n length;
 printf   next header: %d\n nexthdr;
 printf   ttl: %d\n ttl;
 (* etc *)

   | version : 4 -
 eprintf unknown IP version %d\n version;
 exit 1

   | _ as pkt -
 eprintf data is smaller than one nibble:\n;
 Bitmatch.hexdump_bitstring stderr pkt;
 exit 1

Or filesystems, as in this parser for Linux EXT3 superblocks:

 let bits = Bitmatch.bitstring_of_file tests/ext3_sb

 let () =
   bitmatch bits with
   | s_inodes_count : 32 : littleendian;(* Inodes count *)
 s_blocks_count : 32 : littleendian;(* Blocks count *)
 s_r_blocks_count : 32 : littleendian;  (* Reserved blocks count *)
 s_free_blocks_count : 32 : littleendian;   (* Free blocks count *)
 s_free_inodes_count : 32 : littleendian;   (* Free inodes count *)
 s_first_data_block : 32 : littleendian;(* First Data Block *)
 s_log_block_size : 32 : littleendian;  (* 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-04-01 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of March 25 to April  
01, 2008.


1) Looking for full-fledged C++ Parser with OCAML interface
2) CDuce is now in Fedora
3) CUFP Call for Presentations


1) Looking for full-fledged C++ Parser with OCAML interface
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/502c419510ffc36f/dd7dad5533647220#dd7dad5533647220 



** Answering this very old thread, Hendrik Tews said:

Soonho Kong writes:

 Olmar(http://www.cs.ru.nl/~tews/olmar/) was the best candidate  
among

 them. I have two questions about it.

If you try Olmar I would be interested in your experience!
Further, as the documentation is inexistent (there are almost no
Olmar users), if you hit a problem, don't hesitate to ask me.

For documenting the Olmar ast see the Elsa ast nodes pages in the
Mozilla wiki (http://wiki.mozilla.org/Elsa_ast_nodes). There is
not much additional information in there, but at least you can
click through the interfaces and add your own findings. We know a
bit more than what's in the wiki, so don't hesitate to ask on the
oink-devel mailing list.

If you try Olmar I would suggest that you use the cvs version,
there have been lots of changes/improvements since the last
release.

  2. If anyone have used Olmar before, I'd like to listen to your
 experience with it. I'm curious of its tolerance with various C++
 dialects, robustness, and efficiency on the code used in real world.

Olmar relies on Elsa for parsing, so this is really a question
about the capabilities of Elsa. The current Elsa version can't
parse all new gcc headers, through I never run into this problem
and use whatever header are installed on my system. For Mozilla
this was a real problem, but Taras Glek's blog seems to indicate
that they fixed most of those in their Elsa branch in the pork
repository. A problem with Elsa is that the current maintainer
makes it really difficult to contribute something back. Therefore
everybody has there own (incompatible) Elsa branch. A problem
with Olmar is that you cannot simply use it with a different Elsa
branch. But I am working in that direction...

However, my current contract ends this April and I might not have
any time left for Olmar then. If you decide for Olmar you must be
prepared to take over maintenance.


David Teller writes:

 I personally haven't used it, but I'm pretty sure it's what Mozilla  
is
 using to rewrite their code for automatic exception rewriting.  
Which is

 a good sign.

I am not completely sure, but I would be surprised, if Mozilla
already uses Olmar.


2) CDuce is now in Fedora
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/1e913d05d9b4b745/1314cf48d3d5e7d9#1314cf48d3d5e7d9 



** Richard Jones announced:

It took us a little while, but CDuce and all its dependencies are now
part of Fedora.  It will appear in a few weeks as an update to Fedora
8, and is a standard package from Fedora 9 onwards.

This is a pretty complete build which should include every feature
including the OCaml syntax extension.  The only part we couldn't get
working in time was 64 bit PowerPC platform support which is down to
an unrelated bug in our port of the OCaml compiler to Linux/ppc64.

I would really like members of the CDuce community to try it out.
Even if you don't run Fedora now, you can install Fedora under
virtualization using QEmu[1], or run Fedora from a Live CD[2].  After
installing Fedora, you should be able to get CDuce and its
dependencies by running this command as root:

 Fedora 8:
   yum --enablerepo=development install cduce

 Fedora 9:
   yum install cduce

Any problems with installation, please contact me.  If you find any
bugs related to the Fedora port of CDuce, please report them through
https://bugzilla.redhat.com/

Thanks to Xavier Lamien and Giuseppe Castagna for their invaluable
help with this release.

Rich.

[1] http://fabrice.bellard.free.fr/qemu/
[2] http://fedoraproject.org/en/get-fedora,
   http://fedoraproject.org/en/get-prerelease


3) CUFP Call for Presentations
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/062d14d73f652f41/5dc8965aebb38da7#5dc8965aebb38da7 



** Grundy, Jim D announced:

  Commercial Users of Functional Programming Workshop (CUFP) 2008

   Functional Programming As a Means, Not an End

   Call for Presentations

  Sponsored by SIGPLAN
Co-located with ICFP 2008
 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-03-18 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of March 11 to 18,  
2008.


1) Oregon Programming Languages Summer School
2) BDDs in ocaml
3) is there a Roman Numeral library
4) Xmlm 1.0.0


1) Oregon Programming Languages Summer School
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/0629d51e21b69395/2db1d82dee0c3832#2db1d82dee0c3832 



** Yannis Smaragdakis announced:

The Oregon PL Summer School will run July 22-30, 2008 with the topic  
Logic
and Theorem Proving in Programming Languages. This is a very exciting  
topic,
and we've put together a great collection of speakers. The school has  
a long
tradition and is sponsored by the NSF, ACM SIGPLAN, and Microsoft  
Research.

The full Call for Participation may be found below.

Thanks,
Matthew Fluet  Yannis Smaragdakis (OPLSS'08 Organizers)

= 
= 
= 

= 
= 
= 



 Call for Participation:
Summer School on Logic and Theorem Proving in Programming Languages
 July 22-30, 2008
  University of Oregon (Eugene, Oregon)
http://www.cs.uoregon.edu/research/summerschool/summer08/
   [EMAIL PROTECTED]

This Summer School will cover current research focused on integrating
expressive logical systems and powerful theorem-proving assistants
into the design, definition, and implementation of programming
languages. Speakers will present material covering foundational
theory, advanced techniques, and applications.

Material will be presented at a tutorial level that will help graduate
students and researchers from academia or industry understand the
critical issues and open problems confronting the field. The course is
open to anyone interested. Prerequisites are an elementary knowledge
of logic and mathematics that is usually covered in undergraduate
classes on discrete mathematics. Some knowledge of programming
languages at the level provided by an undergraduate survey course will
also be expected. Our primary target group is PhD students. We also
expect attendance by faculty members who would like to conduct
research on this topic or introduce new courses at their universities.

The program consists of more than twenty-five, 80 minute lectures
presented by internationally recognized leaders in programming
languages and formal reasoning research. Topics include:

SMT Solvers - Theory, Implementation and Applications
   Leonardo de Moura, Microsoft Research
Mechanization of Metatheory using LF and Twelf
   Robert Harper, Carnegie Mellon University
Compiler Construction in Formal Logical Frameworks
   Jason Hickey, California Institute of Technology
Specification and Verification of Programs with Pointers
   Rustan Leino, Microsoft Research
Leveraging Domain-Specific Languages for Reasoning
   Sorin Lerner, University of California - San Diego
Reasoning About Programs with ACL2
   Pete Manolios, Northeastern University
Putting the Curry-Howard Isomorphism to Work
   Tim Sheard, Portland State University
Nominal Techniques
   Christian Urban, TU Munich
Coq for Programming Language Metatheory
   Stephanie Weirich, University of Pennsylvania

Venue
~
The summer school will be held at the University of Oregon, located in
the southern Willamette Valley city of Eugene, close to some of the
world's most spectacular beaches, mountains, lakes and forests. On
Sunday, July 27, students will have the option of participating in a
group activity in Oregon's countryside.

Registration

The cost for registration is $175.00 (USD) for graduate students, and
$275.00 (USD) for other participants. Registration must be paid upon
acceptance to the summer school, and is non-refundable. There are a
limited number of grants available to fund part of the cost of student
participation. If you are a graduate student and want to apply for
grant money to cover your expenses, please also include a statement of
your needs with your registration.
Additional information about the program, registration, venue, and
housing options is available on the web site. Or, you may request more
information by email.
To register for the Summer School, send a CV that includes a short
description of your educational background and one letter of
reference, unless you have already been granted a Ph.D. Please include
your name, address and current academic status.
Send all registration materials to [EMAIL PROTECTED] All
registration materials should be delivered to the program by April
11, 2008. Materials received after the closing date will be evaluated
on a space available basis. Non U.S. citizens should begin immediately
to obtain travel documents.

Housing
~~~
The school will provide on-campus housing and meals. 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2008-02-19 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of February 12 to  
19, 2008.


1) Sydney (Australia) Functional Programming Group
2) New release of moca
3) GLCaml version 20080215 available


1) Sydney (Australia) Functional Programming Group
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/74a593636ce833e0/57665f9bfaf8de8e#57665f9bfaf8de8e 



** Erik de Castro Lopo announced:

I'd like to announce the FP-SYD, the Sydney (Australia) Functional
Programming group. The intro page is here:

   http://groups.google.com/group/fp-syd

To subscribe to the mailing list (mainly for meeting organisation,
meeting announcements, and Sydney job offers) either go to the URL
above of send mail to:

  fp-syd-subscribe at googlegroups dot com


2) New release of moca
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/2367110884582c64/931dab1123c26e16#931dab1123c26e16 



** Pierre Weis and Frédéric Blanqui announced:

Relational types in Caml

We are pleased to announce the 0.5.0 version of Moca, a general  
construction

functions generator for relational types in Objective Caml.

In short:
=
 Moca allows the high-level definition and automatic management of
complex invariants for data types; Moca also supports the automatic  
generation

of maximally shared values, independantly or in conjunction with the
declared invariants.

Moca's home page is http://moca.inria.fr/
Moca's source files can be found at
  ftp://ftp.inria.fr/INRIA/caml-light/bazar-ocaml/moca-0.5.0.tgz

Moca is developped by Pierre Weis and Frédéric Blanqui, Richard  
Bonichon and

Laura Lowenthal (see the file AUTHORS in the main directory of the
distribution).

In long:


 A relational type is a concrete type that declares invariants or  
relations
that are verified by its constructors. For each relational type  
definition,

Moca compiles a set of Caml construction functions that implements the
declared relations.

Moca supports two kinds of relations:
- algebraic relations (such as associativity or commutativity of a  
binary

 constructor),
- general rewrite rules that map some pattern of constructors and  
variables to

 some arbitrary user's defined expression.

Algebraic relations are primitive, so that Moca ensures the  
correctness of

their treatment. By contrast, the general rewrite rules are under the
programmer's responsability, so that the desired properties must be  
verified

by a programmer's proof before compilation (including for completeness,
termination, and confluence of the resulting term rewriting system).

What's new in this release ?


* Lot of work on the documentation: a research paper has been  
published to
 described the framework at ESOP'07, talks about relational types and  
the

 internal of the compiler are included in the distribution.

* An automatic test generation facility has been developped to test the
 specifications written in Moca.

* Arbitrary Caml code can be written in the .mlm files (any sequence  
of Caml

 signature items are allowed as extra algebraic properties of
 generators). This ``external'' code is included as is in the resulting
 module.

* Commutativity relation gets an extra argument which gives the order  
used to

 sort the combs (or lists in case of a vary-adic generator).

* Source code of the compiler has been documented.

* No more shell scripts: the compiler is entirely written in Caml.

* User's defined rules have been generalized from pattern - pattern
 to pattern - expr.

An example
==

The Moca compiler (named mocac) takes as input a file with  
extension .mlm
that contains the definition of a relational type (a type with  
``private''
constructors, each constructor possibly decorated with a set of  
invariants or

algebraic relations).

For instance, consider peano.mlm, that defines the type peano with a  
binary
constructor Plus that is associative, treats the nullary constructor  
Zero as
its neutral element, and such that the rewrite rule Plus (Succ n, p) - 
 Succ

(Plus (n, p)) should be used whenever an instance of its left hand side
appears in a peano value:

type peano = private
   | Zero
   | Succ of peano
   | Plus of peano * peano
   begin
 associative
 neutral (Zero)
 rule Plus (Succ n, p) - Succ (Plus (n, p))
   end;;

From this relational type definition, mocac will generate a regular  
Objective

Caml data type implementation, as a usual two files module.

From peano.mlm, mocac produces the following peano.mli interface file:

type peano = private
   | Zero
   | Succ of peano
   | Plus of 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2007-12-11 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of December 04 to  
December 11, 2007.


1) Job announcement -- Ocaml  C hacker
2) The Caml vs. the Leopard
3) Ocaml code for Okasaki's Purely Functional Data Structures
4) Questions on replacing finalizers and memory footprints
5) PLplot library bindings
6) LablGL 1.03


1) Job announcement -- Ocaml  C hacker
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/a967497d00894c5f#0b2af984b97b1c2b 



** Berke Durak announced:

Exalead is a French software editor based in central Paris and
developing enterprise search solutions and a web search engine
(http://exalead.fr/).  Our young teams include web, natural language,
indexing, database and network specialists.  We count a good number of
C hackers.

We develop an important part of our software in Exascript, our
extension of Java.  Currently, we are rewriting our compiler in Ocaml
(it was originally written in C) and targeting the Java virtual
machine (instead of our in-house virtual machine).

To help with this task, Exalead is looking for a good hacker fluent in
Ocaml and C.  Having some familiarity with Java and its virtual
machine is a plus.

We are looking for someone who:

- has an excellent grasp of low-level systems programming in C,
- has been hacking Ocaml for some time,
- has an understanding of garbage-collected virtual machines, and the
   way they interact with native code,
- is familiar with compilation techniques,
- and likes to work in small teams and without formal specifications.

Tasks to be expected are as follows.

- Participate in the development of the Exascript compiler in a small
   team of two to four people.
- Ensure that existing native C and C++ application-level code works
   smoothly on the JVM.
- Examine the code base to detect parts that can be difficult to port,
   possibly by developing automated analysis tools.
- Devise, run and interpret benchmarks, deduce possible optimizations
   and implement them.
- Adapt and rewrite the base libraries to run under the JVM, using
   existing Java components if possible.
- Adapt developer tools to work smoothly with Exascript (such as Emacs
   modes or Eclipse plug-ins).

This is a permanent position for a full-time job.

If you are interested, write to [EMAIL PROTECTED]


2) The Caml vs. the Leopard
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/92e8f5867182417a#2c18da30c9a031bc 



** Gordon Henriksen announced:

Good news for Mac users and early adopters! Ocaml versions in CVS now  
compile
cleanly on Leopard with or without setenv MACOSX_DEPLOYMENT_TARGET  
10.4. To

get the code:

# HEAD branch
cvs -d :pserver:[EMAIL PROTECTED]:/caml co ocaml -d ocaml-3.11.x

# release310 branch
cvs -d :pserver:[EMAIL PROTECTED]:/caml co -r release310 ocaml - 
d ocaml-3.10.x


This isn't a release yet, so run at your own risk. Thanks for hacking  
that

patch into shape, Xavier.


3) Ocaml code for Okasaki's Purely Functional Data Structures
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/a374fa6c9d9a7917#842ac97335a24ec6 



** Erik de Castro Lopo asked and Paolo Donadeo answered:

 I'm currently reading Okasaki's book and a bit of googling told me
 that Markus Mottl translated the code examples into Ocaml.
 Unfortunately the links to the code are all dead. Does anybody have
 this code somewhere or know where it might be available?

Try here, it's the OCaml page of Markus Mottl:
http://ocaml.info/home/ocaml_sources.html

** Ashish Agarwal then asked and Maxence Guesdon answered:

 How do items on the Hump get updated? Markus Mottl's libraries are  
obviously
 a valuable resource, but the Hump's information for at least a few  
of his
 libraries are out of date. Unfortunate for newbies who don't know  
about the

 above link.

The better way to have the hump updated is to
- send an email to [EMAIL PROTECTED],
- or announce new software or updates on the caml-list, so I can add  
it to

or update the hump.


4) Questions on replacing finalizers and memory footprints
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/818e4443c627d478#9e1988d25a4e0cb9 



** Thomas Fischbacher asked and Richard Jones answered:

 Also, is there a simple way to implement a function (perhaps using
 Obj.magic) which will walk a (possibly 

[cwn] Attn: Development Editor, Latest Caml Weekly News

2007-10-23 Thread Alan Schmitt

Hello,

Here is the latest Caml Weekly News, for the week of October 16 to  
23, 2007.


1) pa_oo and pa_polymap for 3.10
2) Sexplib now available for OCaml 3.10


1) pa_oo and pa_polymap for 3.10
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/ 
b295006a4b3cb0c3/b8f65366ff33d2f5#b8f65366ff33d2f5


** Jacques Garrigue announced:

I've just added versions of pa_oo and pa_polymap working with 3.10.
Sorry for the long delay...

http://www.math.nagoya-u.ac.jp/~garrigue/code/ocaml.html


2) Sexplib now available for OCaml 3.10
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/ 
6d87dd2e32378d45/7357515c6ebe3223#7357515c6ebe3223


** Markus Mottl announced:

I am happy to announce that the Sexplib library has been ported to  
OCaml 3.10:


http://ocaml.info/home/ocaml_sources.html#sexplib310

It now depends on the type-conv library, which factors out common
functionality for future type conversion libraries (e.g. an upcoming
type-safe and extremely efficient binary protocol library):

http://ocaml.info/home/ocaml_sources.html#type-conv

Sexplib is also available through Godi, which will automatically
resolve the dependency on type-conv.

The new release also comes with several bug fixes, performance
improvements and small feature extensions.

Here is a short description of Sexplib (from the README):

This library contains functionality for parsing and pretty-printing
S-expressions. In addition to that it contains an extremely useful
preprocessing module for Camlp4, which can be used to automatically
generate code from type definitions for efficiently converting OCaml- 
values

to  S-expressions and vice versa. In combination with the parsing and
pretty-printing functionality this frees users from having to write  
their own
I/O-routines for datastructures they define. Possible errors during  
automatic

conversions from S-expressions to OCaml-values are reported in a very
human-readable way. Another module in the library allows you to  
extract and

replace sub-expressions in S-expressions.


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}$'?'1':1
zM
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
([EMAIL PROTECTED]) and I'll mail it to you, or go take  
a look at

the archive (http://alan.petitepomme.net/cwn/) or the RSS feed of the
archives (http://alan.petitepomme.net/cwn/cwn.rss). If you also wish
to receive it every week by mail, you may subscribe online at
http://lists.idyll.org/listinfo/caml-news-weekly/ .



--
Alan Schmitt http://alan.petitepomme.net/

The hacker: someone who figured things out and made something cool  
happen.

 .O.
 ..O
 OOO




PGP.sig
Description: This is a digitally signed message part
___
caml-news-weekly mailing list
caml-news-weekly@lists.idyll.org
http://lists.idyll.org/listinfo/caml-news-weekly


  1   2   >