The purpose of this project is to generate OCaml bindings from .eo files. Once completed, it may be used for ocaml-efl. What is OCaml ? =============== OCaml, originally known as Objective Caml, is the main implementation of the Caml programming language, created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy and others in 1996. OCaml extends the core Caml language with object-oriented constructs. OCaml's toolset includes an interactive top level interpreter, a bytecode compiler, and an optimizing native code compiler. It has a large standard library that makes it useful for many of the same applications as Python or Perl, as well as robust modular and object-oriented programming constructs that make it applicable for large-scale software engineering. OCaml is the successor to Caml Light. The acronym CAML originally stood for Categorical Abstract Machine Language, although OCaml abandons this abstract machine. OCaml is a free open source project managed and principally maintained by INRIA. Homepage: http://caml.inria.fr/index.en.html What are the Enlightenment Foundation Libraries (EFL) ? ======================================================= The Enlightenment Foundation Libraries (EFL) are a set of free and open source graphics libraries that grew out of the development of the Enlightenment window manager and Wayland compositor. EFL is developed by Enlightenment.org with some sponsorship from Samsung, ProFUSION and Free.fr. The project's focus is to make the EFL a flexible yet powerful and easy to use set of tools to extend the capabilities of both the Enlightenment window manager and other software projects based on the EFL. The libraries were created for version 0.17 of the window manager. The libraries are meant to be portable and optimized to be functional even on mobile devices such as smart phones and tablets. Homepage: http://www.enlightenment.org/ Elementary is a widget set based on the EFL that makes heavy use of Evas and Edje to provide a fast, stable, and scalable library that can be used to create both rich and fast applications that can be used on anything from every day desktop computers to small PDA's and set-top boxes. It is designed to fully expose the capability of the EFL. What are eo and eolian ? ======================== The EFL is a C library, but it use an object model system called 'eo'. For example, it features: * Inheritance * Interfaces * Mixins * Multiple inheritance * Method / property overriding * Properties * All object internals are opaque * Reference counting * Callbacks (all objects) * Cross references * Parent / child object hierarchy * Weak references * Key / value attachment on all objects * Code generation / maintenance to avoid boilerplate - Define your classes in Eo files cleanly * Multiple language support (beyond C) for bindings - Done by code generation and base type support . Currently C++ and Lua . C++ bindings use C ABI, not C++ ABI (fewer problems) Plans to add Python and JS (v8) * Runtime type safety for objects * Runtime method / property call safety (if not supported becomes NOOP) * Object indirection to remove pointer bugs * Multi-call per object de-reference (lowers object access overhead) * Construction finalizers allowing calls during construction for lower setup overheads. In particular, the interface is described in *.eo files (which can be parsed by a library called 'eolian') which make writing automatic bindings to various programming languages (OCaml in our case) since .eo files contain more information than regular C header files. The purpose of 'eolian_ocaml' is to create the tool to generate such bindings for OCaml. Even though, it is made for an easy binding with the EFL, it can be used for any C library that used eo (which is a general framework). What is the current status of eolian_ocaml ? ============================================ A program called 'eolian_ocaml_parse' (written in C and using eolian) is already written, and it extract information from .eo files and generated as its output some OCaml code that contains this information. From then, an automatic binding generator could be written in pure OCaml: This is the next step. Copying ======= eolian_ocaml is under the GNU GENERAL PUBLIC LICENSE v3 with an exception conerning the code generated by the executables and the file 'eo_file.ml'. You can find more information in the file LISENCE. What is required to build eolian_ocaml ? ======================================== To build eolian_ocaml you will need: - eina ( >= 1.13) - eolian ( >= 1.13) These are provided by the EFL. Of course, to exploit the generated output you will also need an OCaml installation. How to install ? ================ You can build and install eolian_ocaml with the usual way of installing autotools programs: ./configure make make install (as root or with sudo if necessary) How to use ? ============ The program 'eolian_ocaml_parse' can be used as follows: eolian_ocaml_parse directory1 directory2 ... This scans recursively the .eo files of the directories given as arguments and produce an output which can be redirected into an .ml file. For example, if you have extracted the EFL and elementary (version 1.13.0) in ~/src you can enter: eolian_ocaml_parse ~/src/efl-1.13.0/src/lib ~/src/elementary-1.13.0/src/lib > test.ml The module 'Test' described by 'test.ml' has the following signature: val world : Eo_file.Class.t list (the file 'eo_file.ml' is given with eolian_ocaml)
axiles/eolian_ocaml
Automatic generation of OCaml bindings from .eo files (still under development)
CNOASSERTION