in my c + + application i would like to expose the same API to different scripting languages. Is there a library that allows me to expose it once and that will expose to v8, luajit, cpython or mono?
SWIG to quote the web page:
The following scripting languages were supported in the final SWIG 1.1 release:
- Tcl 8.0 and newer versions.
- Python 1.5 and newer.
- Perl 5.003 or newer.
- Guile 1.3.4 and newer.
The following languages are also supported in swig-1.3.6 onwards.
- Java JDK 1.1 and newer.
- PHP support was added in swig-1.3.11.
- Objective Caml (Ocaml) and Pike support was added in swig-1.3.14.
- Support for C# and the Chicken scheme compiler was added in swig-1.3.18.
- Support for Allegro CL and Modula-3 was added in swig-1.3.22.
- Support for Lua, CLISP and Common Lisp with UFFI was added in swig-1.3.26.
- Support for Common Lisp with CFFI was added in swig-1.3.28.
- Support for R was added in swig-1.3.30.
- Support for Octave was added in swig-1.3.35.
- Support for the Go language was added in swig-2.0.1.
- Support for D was added in swig-2.0.2.
- There is also a SWIG Eiffel module - SWIGEiffel.
Which should hit most of your requirements.
SWIG is Free software, both Libre and FOSS, and distributed under the GPL license but specifically notes:
When SWIG is used as it is distributed by the SWIG developers, its output is not governed by SWIG's license (including the GPL). SWIG's output contains code from three sources:
- code generated by SWIG, which is not governed by copyright;
- code copied from the SWIG library which is permissively licensed to be redistributed without restriction;
- code derived from the user's input, which may be governed by the license of the code supplied by the user.