From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA17033; Tue, 26 Aug 2003 02:36:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA23303 for ; Tue, 26 Aug 2003 02:36:11 +0200 (MET DST) Received: from proradius03 (m698e36d0.tmodns.net [208.54.142.105]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h7Q0aAf12139 for ; Tue, 26 Aug 2003 02:36:10 +0200 (MET DST) Received: from respighi.local. ([10.252.13.159]) by proradius03 (8.11.6+Sun/8.11.6) with ESMTP id h7Q0NRm19493 for ; Mon, 25 Aug 2003 17:23:27 -0700 (PDT) Date: Mon, 25 Aug 2003 17:37:45 -0700 Mime-Version: 1.0 (Apple Message framework v543) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: [Caml-list] automated binding generation (announce: Forklift) From: Jeff Henrikson To: caml-list@inria.fr Content-Transfer-Encoding: 7bit Message-Id: <827D7D5A-D75D-11D7-A290-00039375801A@yahoo.com> X-Mailer: Apple Mail (2.543) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; henrikson:01 jehenrik:01 swig:01 swig:01 stub:01 model:01 pre-alpha:01 henrikson:01 stub:01 annotations:01 generality:01 accessors:01 accessors:01 read-only:01 finalization:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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