From: Jeff Henrikson <jehenrik@yahoo.com>
To: caml-list@inria.fr
Subject: [Caml-list] automated binding generation (announce: Forklift)
Date: Mon, 25 Aug 2003 17:37:45 -0700 [thread overview]
Message-ID: <827D7D5A-D75D-11D7-A290-00039375801A@yahoo.com> (raw)
Hi OCaml users,
Forklift is a program for generating language bindings based on C
header files. It is similar in concept to SWIG or CamlIDL. Below I
append the features and limitations from the README file. Forklift
originally grew out of frustration trying to write an OCaml SWIG
language module about 18 months ago. After 2000 lines of C for SWIG, I
became convinced that I wasn't going to get what I wanted. So now
there is a new program that attempts to get what I want. Features
include a pleasing stub composition model for higher order type
converters.
This is a pre-alpha release. Your feedback is solicited. See the
"limitations" section for disclaimers.
Cheers,
Jeff Henrikson
http://jhenrikson.org/forklift/
FEATURES (aka "What makes Forklift different?")
-> Forklift generates foreign function interface stubs based on
reading C header files intact, without annotation. IDL and SWIG
also make stubs from header files, but they do so by requiring
inline modifications to the source code, making any stub
preparation irrelevant when version 2.0 of the header files
are released. Forklift's annotations are kept as separate input
files.
-> Forklift, like SWIG, works with C code stubs rather than an
exhaustive grammar for describing every possible type. This
makes it more flexible and allows it to describe multiple
representations for the same data.
-> Forklift requires enough structure of the C code to provide
higher order type representations. For example, given a way
to convert "int" variables, one can provide an abstract
way to convert arrays such that an int array conversion
can be generated.
-> Forklift's stub algebra admits full n variables -> k variables
transformation generality. For example we can map an (int,
int*)
pair in consecutive parameters to a HLL int array, where the
the first is taken to mean the length and the second a pointer.
-> Forklift provides for a rich pattern matching vocabulary, not
simply equality matching on variable names.
-> Forklift generates constructors, destructors and accessors
for data structures automatically. A flexible set of
options allow choices between single accessors vs bulk
accessors, read-only vs read-write accessors, etc. For
languages which support finalization, finalization methods
can be generated.
-> Forklift can be (and for the time being must be!) run as
an interactive session, typically as an emacs inferior
buffer. Its utility functions allow the user to query the
header files instead of reading them. So one can ask "what
functions pass a pointer to this structure as a first
parameter?" and get an exhaustive list of function
identifiers. This saves laborious reading, copy-pasting,
and editing.
LIMITATIONS
-- The callback module hasn't been written yet.
-- Forklift currently only implements an Objective Caml
language module.
-- Forklift currently free-rides on ocaml syntax, using the
toplevel as its interaction environment. In the future it will
have its own interactive language-agnostic syntax.
-- A C preprocessor emulator is not yet written, so header files
must be manually run through cpp.
-- IDL orthogonality has not yet been analyzed.
PREREQUISITES
Forklift requires:
ocaml >= 3.06, pcre, ocaml-pcre, ocaml emacs mode.
LICENSE? (from the README)
--------
Forklift
--------
Copyright (c) 2003 Jeff Henrikson
This is Release 0.5.0 of Forklift, a stub generator for foreign
function interfaces.
License is hereby granted to use this software and distribute it
for educational, research and nonprofit purposes, as long as this
copyright notice is retained and modifications are clearly marked.
ALL WARRANTIES ARE HEREBY DISCLAIMED.
N.B. A more commercially friendly license will be probably be chosen
soon. Maybe LGPL. But the current distribution is probably already
violating Freetype's license by including the headers in the way
that
they have been. More thinking is necessary.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
reply other threads:[~2003-08-26 0:36 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=827D7D5A-D75D-11D7-A290-00039375801A@yahoo.com \
--to=jehenrik@yahoo.com \
--cc=caml-list@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