Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 840d6a1894
Fetching contributors…

Cannot retrieve contributors at this time

256 lines (190 sloc) 5.438 kb
commons is OCaml library, complete standard library
% - extlib
% - battery
% - jane street core
% - commons/ in unison
% - stdext/ in xen api
% ...
getting started, commons.cma
why in single file ?
the most original features:
- +> or |>
- pr2/spf
- quicheck
- profile
- regression testing
- ocamltarzan and ?
maybe use latex visual trick to say when good function
make features stuff
configure, Makefile.config
cf readme.txt ?, MPI, Regexp, Backtrace
yes sometimes cpp is useful
cf also common\_extra
What was included? why includes that and not something else ?
Why include lib-sexp/ lib-json/ and keep stuff in external/
like ocamlbdb ?
sexp/json are ``fundamental'', they really help to debug and are
in standard in some language in some sense. Haskell has deriving
well first no c dependencies for sexp/json, pure ocaml code,
so can included it in a common.cma and people can link with
it easily. It's compositional.
%dup: readme.txt
This directory builds a common.cma library and also optionally
multiple commons_xxx.cma small libraries. The reason not to just build
a single one is that some functionnalities require external libraries
(like Berkeley DB, MPI, etc) or special version of OCaml (like for the
backtrace support) and I don't want to penalize the user by forcing
him to install all those libs before being able to use some of my
common helper functions. So, and other files offer
convenient helpers that do not require to install anything. In some
case I have directly included the code of those external libs when
there are simple such as for ANSITerminal in ocamlextra/, and for I have even be further by inlining its code in so
one can just do a open Common and have everything. Then if the user
wants to, he can also leverage the other commons_xxx libraries by
explicitely building them after he has installed the necessary
external files.
For many configurable things we can use some flags in ml files,
and have some -xxx command line argument to set them or not,
but for other things flags are not enough as they will not remove
the header and linker dependencies in Makefiles. A solution is
to use cpp and pre-process many files that have such configuration
issue. Another solution is to centralize all the cpp issue in one
file,, that acts as a generic wrapper for other
librairies and depending on the configuration actually call
the external library or provide a fake empty services indicating
that the service is not present.
So you should have a ../configure that call cpp on
to set those linking-related configuration settings.
why in single file ?
%was in
(* I put those functions here and not in to try to avoid
* as much as possible dependencies in so I can more easily
* make ocaml script that just do a load without the need
* to load many other files (like, or and
* other recursive dependencies).
* Note that you can still use the functions below from an open Common.
* You don't need to do a 'open Common_extra'; loading the commons.cma is
* enough to make the connexions.
\commons is governed by the following copyright:
This manual is copyright 2009 Yoann Padioleau,
and distributed under the terms of the
GNU Free Documentation License version 1.3.
\section{Source organization}
%ls -lR
%DONE common.mli
%SEMI readme.txt
%SEMI authors.txt
%SEMI credits.txt
%put other directories ? the lib-xxx ?
{\bf Function} & {\bf Chapter} & {\bf Modules} \\
Main services
& \ref{chapter:parse-entry-point}
& [[parse_c.mli]] \\
% and parsing_stat.mli ?
& & \\
\caption{Chapters and modules}
\section{API organization}
Maybe a few code was borrowed from Pixel (Pascal Rigaux)
and Julia Lawall may have written a few helpers.
%dup: credits.txt
Thanks to:
\item Richard Jones for his dumper module,
%ref ?
\item Brian Hurt and Nicolas Cannasse for their dynArray module,
%ref ?
\item Troestler Christophe for his ANSITerminal module,
%ref ?
\item Sebastien ferre for his suffix tree module
%ref ?
\item Jane street for their backtrace module and sexplib
%ref ? now obsolete
Jump to Line
Something went wrong with that request. Please try again.