caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Adrien <camaradetux@gmail.com>
To: Caml Mailing List <caml-list@yquem.inria.fr>
Subject: [Caml-list] [ANN] cowboy and cowboy/glib preview, C binding generation framework
Date: Wed, 18 Aug 2010 23:12:43 +0200	[thread overview]
Message-ID: <AANLkTim6PGU+6zdv0NXJKJm33naxigxunE0g26LUpE-+@mail.gmail.com> (raw)

Hi,

I am pleased to announce a preview release of cowboy, a framework for
the generation of C bindings. It is currently used to generate
bindings for glib-based libraries.

It's not a magical binding writer however: work is still needed in
order to create bindings. But it can ease their generation, help avoid
regular expression stunts and allow writing the generator in ocaml.

It provides an access to the list of a library's functions, enums,
structs... Yohann Padioleau's yacfe[2] C/C++/Java parser actually does
most of the work. It can "parse" cpp (the preprocessor kind), giving
access to valuable human-readable information.
The code in cowboy takes yacfe's output and simplifies it: dropping
function's implementation and only keeping names and prototypes. It
also keeps comments which often (doxygen, gtk-doc...) contain
annotations to tell an 'int array' from an 'out parameter', both being
'int*' in C.

Cowboy also provides a few helper functions and a sort of templates
for META, OCamlMakefile and OASIS files.


Currently, cowboy is used to generate bindings to glib-based libraries
(webkit-gtk is almost ready, others will follow). However it is not to
be used for everything.
Stating the obvious, it is only interesting when automation is worth
it. If the library is not big enough or if its API does not follow a
set of conventions, writing bindings by hand will be easier.


In any case, do not hesitate to ask me: on the mailing-list, through
private e-mail, or on IRC (freenode network, #ocaml or #ocaml-fr
channels, which I'm always connected to).


PS: Some have seen and might remember "ocaml-gir" which did a similar
job: cowboy has a more general scope and is also easier to work with
(gobject-introspection is very complex and under-documented, and it's
... weird).

PS2: I am aware that cowboy is unevenly documented. If you start
anything, again, do not hesitate to ask me.

[1] http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=cowboy/cowboy.git
(use the "snapshot" feature to download)
[2] http://padator.org/software-yacfe.php (see doc/yacfe on how to install it!)

 ---

Adrien Nader


                 reply	other threads:[~2010-08-18 21:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTim6PGU+6zdv0NXJKJm33naxigxunE0g26LUpE-+@mail.gmail.com \
    --to=camaradetux@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).