|
1 | 1 | Using CppInterop |
2 | 2 | ---------------- |
3 | 3 |
|
4 | | -This section briefly describes all the key functionalities offered by CppInterop. |
5 | | -If you are just getting started with CppInterop, then this is the best place to start. |
6 | | -You may want to skim some sections on the first read. |
| 4 | +C++ Language Interoperability Layer |
| 5 | +=================================== |
7 | 6 |
|
8 | | -In case you haven't installed CppInterop already, then please do before proceeding |
9 | | -with this guide. |
| 7 | +The CppInterop comes with using it is a dynamic shared library, |
| 8 | +**libclangCppInterOp.so** which resides in the CppInterOp/build/lib/. |
10 | 9 |
|
11 | | -Let's get started. |
| 10 | +.. code-block:: bash |
12 | 11 |
|
13 | | -C++ Language Interoperability Layer |
14 | | -=================================== |
| 12 | + libInterop = ctypes.CDLL("./libclangCppInterOp.so") |
| 13 | + |
| 14 | +The above method of usage is for Python; for C, we can include the headers of |
| 15 | +the library. Including this library in our programme enables the user to use |
| 16 | +the abilities of CppInterOp. CppInterOp helps programmers with multiple |
| 17 | +verifications such as isClass, isBoolean, isStruct, and many more in different |
| 18 | +languages. With the interop layer, we can access the scopes, namespaces of |
| 19 | +classes and members that are being used. The interoperability layer helps us |
| 20 | +with the instantiation of templates, diagnostic interaction, creation of |
| 21 | +objects, and many more things. |
| 22 | + |
| 23 | +This section briefly describes all the key **features** offered by |
| 24 | +CppInterop. If you are just getting started with CppInterop, then this is the |
| 25 | +best place to start. |
| 26 | + |
| 27 | +Incremental Adoption |
| 28 | +==================== |
| 29 | +CppInterOp can be adopted incrementally. While the rest of the framework is the |
| 30 | +same, a small part of CppInterOp can be utilized. More components may be |
| 31 | +adopted over time. |
| 32 | + |
| 33 | +Minimalist by design |
| 34 | +==================== |
| 35 | +While the library includes some tricky code, it is designed to be simple and |
| 36 | +robust (simple function calls, no inheritance, etc.). The goal is to make it as |
| 37 | +close to the compiler API as possible, and each routine should do just one thing. |
| 38 | +that it was designed for. |
| 39 | + |
| 40 | +Further Enhancing the Dynamic/Automatic bindings in CPPYY |
| 41 | +========================================================= |
| 42 | +The main use case for CppInterOp is the CPPYY service. CPPYY is an |
| 43 | +automatic run-time bindings generator for Python and C++, and supports a wide |
| 44 | +range of C++ features (e.g., template instantiation). It operates on demand and |
| 45 | +generates only what is necessary. It requires a compiler (Cling or Clang-REPL). |
| 46 | +that can be available during programme runtime. |
| 47 | + |
| 48 | +Once CppInterOp is integrated with LLVM's Clang-REPL component (that can then |
| 49 | +be used as a runtime compiler for CPPYY), it will further enhance CPPYY's |
| 50 | +performance in the following ways: |
| 51 | + |
| 52 | + |
| 53 | +**Simpler codebase:** The removal of string parsing logic will lead to a simpler |
| 54 | +code base. |
| 55 | + |
| 56 | +**LLVM Integration:** The CppInterOp interfaces will be part of the LLVM |
| 57 | +toolchain (as part of Clang-REPL). |
| 58 | + |
| 59 | +**Better C++ Support:** C++ features such as Partial Template Specialisation will |
| 60 | +be available through CppInterOp. |
| 61 | + |
| 62 | +**Fewer Lines of Code:** A lot of dependencies and workarounds will be removed, |
| 63 | +reducing the lines of code required to execute CPPYY. |
| 64 | + |
| 65 | +**Well tested interoperability Layer:** The CppInterOp interfaces have full |
| 66 | +unit test coverage. |
15 | 67 |
|
16 | 68 |
|
| 69 | +In case you haven't already installed CppInterop, please do so before proceeding |
| 70 | +with the Installation And Usage Guide. |
| 71 | +:doc:`Installation and usage <InstallationAndUsage>` |
0 commit comments