C++ links: interoperability - foreign function interfaces (FFIs)
- General
- Language-specific: Bash, C, C#, Common Lisp, D, Haskell, Java, JavaScript, Julia, Lua, Objective-C, PHP, Python, R, Rust, Scheme, Stata
- C++ Language Interface Foundation (CLIF)
- libffi: A portable foreign-function interface library
- SWIG: Simplified Wrapper and Interface Generator
- ctypes.sh: a foreign function interface for bash
- C handler wrapping in C++ - https://arekmd.github.io/wrapping-c-handlers/
- CppCon 2014: Lisa Lippincott "How to call C libraries from C++"
- https://www.youtube.com/watch?v=3ZO0V4Prefc
- https://github.com/CppCon/CppCon2014/tree/master/Presentations/How%20to%20call%20C%20libraries%20from%20C%2B%2B
- Code and slides from Lisa Lippincott's “How to Call C libraries from C++” presentation from Cppcon 2014
- https://github.com/jfirebaugh/PlusPlus
- Cross-language interfaces between C and C++ - https://gustedt.wordpress.com/2017/08/08/cross-language-interfaces-between-c-and-c/
- DragonFFI: C Foreign Function Interface and JIT using Clang/LLVM
- DragonFFI is a C Foreign Function Interface (FFI) library written in C++ and based on Clang/LLVM. It allows any language to call C functions thought the provided APIs and bindings.
- https://github.com/aguinet/dragonffi/
- FOSDEM 2018 - https://fosdem.org/2018/schedule/event/dragonffi/
- DragonFFI: FFI/JIT for the C language using Clang/LLVM - http://blog.llvm.org/2018/03/dragonffi-ffijit-for-c-language-using.html
- ffi-overhead: comparing the C FFI (foreign function interface) overhead for various programming languages
- Hourglass Interfaces for C++ APIs - CppCon 2014
- Skip the FFI: Embedding Clang for C Interoperability
- 2014 LLVM Developers' Meeting
- Jordan Rose, John McCall
- https://llvm.org/devmtg/2014-10/#talk18
- The Salami Method
- The Salami Method finely distinguishes between the different aspects and layers required for exposing platform-independent C++ on different “specific” platforms. At its extreme it strives to create a single, thin, transparent layer for each such aspect so that each layer is more easily built, tested, debugged, managed and maintained.
- http://videocortex.io/2017/salami-method/
- The Salami Method: multiplatform C++ development - Adi Shavit, CoreCpp IL Meetup, April 2018
- The Salami Method for Cross Platform Development - CppCon 2018; Adi Shavit
- CoreRTDemo: Building a native library in C# and calling it from C++
- https://github.com/encrypt0r/CoreRTDemo
- Writing Native Libraries in C# and using them in other languages
- CppSharp
- Tools and libraries to glue C/C++ APIs to high-level languages
- https://github.com/mono/CppSharp
- P/Invoke: A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
- The .NET Inter-Operability Operation
- Derbycon 2017; James Forshaw
- http://www.irongeek.com/i.php?page=videos/derbycon7/s13-the-net-inter-operability-operation-james-forshaw
- Using Span for high performance interop with unmanaged libraries
- Clasp — Bringing Common Lisp and C++ Together
- d++ - #include C and C++ headers in D files
- Zero Overhead Interface Between DLang & C++ Standard Lib
- Alexandru Razvan Caciulescu | DConf2017
- https://www.youtube.com/watch?v=c5zGnOWKaGo
- Calling C++ from Haskell - "The Hard Way"
- Cxx foreign function interface
- fficxx - FFI to C++ in Haskell
- Haskell-C++ Foreign Function Interface Generator
- http://ianwookim.org/fficxx/
- https://github.com/wavewave/fficxx
- inline-c-cpp: Lets you embed C++ code into Haskell
- GraalVM: JIT Compiler and Polyglot Runtime for the JVM
- http://www.graalvm.org/
- https://github.com/oracle/graal
- Running C++ - http://www.graalvm.org/docs/reference-manual/languages/llvm/#running-c
- Sulong, the LLVM bitcode implementation of Graal VM
- With Sulong you can execute C/C++, Fortran, and other programming languages that can be transformed to LLVM bitcode on Graal VM.
- https://github.com/graalvm/sulong
- JavaCPP: The missing bridge between Java and native C++
- java-native-benchmark: Benchmarking Java's native call APIs: JNI, JNA, JNR, BridJ and Project Panama
- jni.hpp: a modern, type-safe, header-only, C++14 wrapper for JNI (Java Native Interface)
- jnr-ffi: Java Abstracted Foreign Function Layer
- Java library for loading native libraries without writing JNI code by hand or using tools such as SWIG
- https://github.com/jnr/jnr-ffi
- Native Interfaces: The Phantom Menace
- NYJavaSIG, February 7, 2018
- Tony Printezis - JVM Engineer - Twitter
- JNI, Project Panama
- https://www.eventbrite.com/e/nyjavasig-native-interfaces-the-phantom-menace-and-java-9-compatibility-tickets-42519931259#
- https://www.youtube.com/watch?v=YxHb6kAGZ10
- Panama: A Foreign Policy for Java
- Devoxx 2018; Maurizio Cimadamore
- https://www.youtube.com/watch?v=cfxBrYud9KM
- Embind: Emscripten's tool to generate JavaScript bindings for C++ code
- Emmagic
- Easily transport your data structures between C++ and Javascript
- https://github.com/manaflair/emmagic
- nbind: a set of headers that make your C++11 library accessible from JavaScript.
- v8pp: Bind C++ functions and classes into V8 JavaScript engine
- Cxx.jl: The Julia C++ Interface
- Sol v2.0 - a C++ <-> Lua API
- Sol is a C++ library binding to Lua. It currently supports all Lua versions 5.1+ (LuaJIT 2.x included). Sol aims to be easy to use and easy to add to a project. The library is header-only for easy integration with projects.
- http://sol2.rtfd.org/
- https://github.com/ThePhD/sol2
- Scripting at the Speed of Thought: Lua and C++ with sol3 - CppCon 2018; JeanHeyd Meneide
- Lua in the Stingray 3D game engine - Niklas Frykholm - https://www.youtube.com/watch?v=wTjyM7d7_YA
- OC - Easily Declare/Invoke Objective-C APIs from C11 or C++11
- Macro magic for declaring/calling Objective-C APIs from C11 or C++. Preloads selectors, chooses the correct objc_msgSend to call per method/platform.
- https://github.com/garettbass/oc
- PHP++: C++11 Class wrap library for PHP7
- Calling C functions from Python
- part 1 - using ctypes - http://yizhang82.me/python-interop-ctypes
- part 2 - writing CPython extensions using Python/C API - http://yizhang82.me/python-interop-capi
- part 3 - deep dive into ctypes implementation in CPython
- cppyy: Automatic Python-C++ bindings
- Cython: Static Typing and C/C++ Interfacing in (C)Python
- StockholmCpp; October 24, 2019; Arda Aytekin
- https://www.youtube.com/watch?v=0R3fw7h64MY
- How and why to write Python binary extension modules using C++
- SwedenCpp::Stockholm::0x0F, September 20, 2018; Thomas Nyberg
- https://www.youtube.com/watch?v=LbiozBn9v6Y
- https://github.com/ApproximateIdentity/cpp_extension_talk
- pybind11 — Seamless operability between C++11 and Python
- https://github.com/pybind/pybind11
- http://pybind11.readthedocs.io
- pybind11 - seamless operability between C++11 and Python - EuroPython 2017; Ivan Smirnov
- Integrate Python and C++ with pybind11 - NDC 2018; Robert Smallshire
- Python - using C and C++ libraries with ctypes
- Wrappy: Wrapping python made easy
- Rcpp: Seamless R and C++ Integration
- http://rcpp.org/
- http://gallery.rcpp.org/
- http://dirk.eddelbuettel.com/code/rcpp.html
- http://dirk.eddelbuettel.com/presentations.html
- http://adv-r.had.co.nz/Rcpp.html
- Rcpp: Seamless R and C++ Integration - CppCon 2015: Matt P. Dziubinski
- bindgen: Automatically generates Rust FFI bindings to C and C++ libraries
- cbindgen: creates C/C++11 headers for Rust libraries which expose a public C API
- CXX: safe FFI between Rust and C++
- rustcxx: Using C++ from Rust made easy
- SCHeMe UnterstüTZung — easy Guile Scheme C++ bindings
- Stata commands for inline C++ code in do-files