From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA03509 for caml-redistribution; Fri, 5 Mar 1999 12:01:14 +0100 (MET) 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 LAA13239 for ; Fri, 5 Mar 1999 11:42:00 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id LAA16050 for ; Fri, 5 Mar 1999 11:41:59 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA06400; Fri, 5 Mar 1999 11:41:59 +0100 (MET) Message-ID: <19990305114159.01952@pauillac.inria.fr> Date: Fri, 5 Mar 1999 11:41:59 +0100 From: Xavier Leroy To: caml-list@inria.fr Subject: CamlIDL - stub code generator and COM binding for OCaml Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 Sender: weis Just like everyone else who has read the papers on H/Direct by Meijer, Peyton-Jones et al, I have been working lately on a COM binding for Objective Caml. I have just released one of the preliminary results of this work: CamlIDL 1.00. Sources and documentation are available from ftp://ftp.inria.fr/lang/caml-light/bazar-ocaml/camlidl-1.00.tar.gz ftp://ftp.inria.fr/lang/caml-light/bazar-ocaml/camlidl-1.00.doc.ps.gz ftp://ftp.inria.fr/lang/caml-light/bazar-ocaml/camlidl-1.00.doc.html.tar.gz The documentation can also be browsed at http://caml.inria.fr/camlidl/htmlman/ CamlIDL comprises two parts: - A stub code generator that generates the C stub code required for the Caml/C interface, based on an MIDL specification. (MIDL stands for Microsoft's Interface Description Language; it looks like C header files with some extra annotations, plus a notion of object interfaces that look like C++ classes without inheritance.) - A (currently small) library of functions and tools to import COM components in Caml applications, and export Caml code as COM components. CamlIDL can be used in several ways: - Under Unix and Windows, as a stub code generator for using C libraries from Caml. It takes care of the gory details of the Caml/C interface, such as all those pesky Val_xxx and Xxx_val macros, proper registration of GC roots, the different calling conventions from bytecode and from native-code, etc. - Under Unix and Windows, as a simple interface between Caml classes and C++ classes. The C++ fragment supported is that corresponding to COM interfaces, i.e. interface polymorphism, but not inheritance. Communication in both directions (COM/C++ object to Caml object and Caml object to COM/C++ object) is provided. - Under Windows, as a COM binding for Caml. There are two applications: * Use COM components from Caml applications. This should eventually allow Caml code to exploit many Windows libraries and "script" many Windows applications. See the H/Direct papers for nice examples. This hasn't been tried yet with CamlIDL, because of the incredible lack of documentation on Microsoft's components and on Microsoft's IDL extensions they use in their interfaces. * Encapsulate Caml code in COM components that can be used in other applications. This offers great potential for writing the juicy bits of an application in OCaml and use C++ or Visual Basic or Internet Explorer or whichever Microsoft behemoth to do the GUI and other boring parts. Currently, CamlIDL can create "in-proc servers" for Caml components (i.e. DLLs that are registered in the system registry and loaded automatically in applications that use the components). "Out-of-proc" servers and distributed objects are not supported yet. Currently, only native interfaces are supported, but not yet dispatch interfaces. While the stub generation aspects of CamlIDL are already relatively mature, the COM binding is still very preliminary. My hope in releasing it is that others more experienced with COM than I am will try it on real-world applications and let me know what is wrong or missing. - Xavier Leroy