Symmetry Integration Language (SIL) and SIL-Cling: A Comprehensive Overview

sil cling a story of three languages n.w
1 / 17
Embed
Share

Explore the Symmetry Integration Language (SIL) and its SIL-Cling plugin, designed for interoperability with other languages and systems. SIL-Cling bridges the gap between C++ libraries, offering a reflection system and seamless interfacing capabilities. Dive into the architecture, functionalities, and reflection information provided by these innovative tools.

  • SIL
  • Symmetry Integration Language
  • SIL-Cling
  • C++
  • Reflection

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. sil-cling: A Story of Three Languages Alexandru Militaru alexandru.cmilitaru@gmail.com DConf 2020

  2. Symmetry Integration Language (SIL) D-based domain specific language of functional flavour designed from the ground up to be easily interoperable with other languages and systems

  3. sil-cling SIL plugin that allows transparent calling of C++ libraries

  4. sil-cling: Architecture SIL written in D D s reflection mechanism sil-cling C API cppyy Cling Clang ROOT project (CERN) written in C++ LLVM

  5. Cling C++ interactive compiler, built on top of LLVM and Clang extends C++ to allow expressions and statements at the global namespace level can be used as a reflection system

  6. cppyy C/C++ wrapper around Cling - originally created for calling C++ from Python Provides: stable C and C++ reflection APIs direct interpreter access to compile C++ code object construction support generic wrappers for method/function dispatching

  7. sil-cling SIL plugin, allows interfacing between cppyy and SIL binds with cppyy through the direct inclusion of the latter s C header using dpp exposes wrappers of C++ entities to SIL through D s reflection mechanism ~ 2.5k SLoC

  8. sil-cling: Interface with SIL two core types: CPPNamespace ClingObj multiple functions exposed (e.g.): cppCompile(code) compile C++ code using Cling cppLoadLibrary(path) loads a shared library cppNamespaceInfo(name) provides namespace summary

  9. sil-cling: Reflection Information cppyy represents C++ classes, structs, and namespaces as scopes a scope object provides a full description of the C++ entity associated with it both CPPNamespace and ClingObj classes have a data member that holds a reference to their associated scope object

  10. sil-cling: Calling Interface object construction, method calling, and function calling all are done through the same interface the procedure is divided into three separate phases: 1. Overload resolution 2. Argument conversion 3. Calling

  11. sil-cling: Overload Resolution for a given object or namespace, fetch all the method/function overloads with the given name it s a match: a method overload with the right number of arguments each SIL Variable provided must have a valid type conversion to its corresponding parameter two iterations: first, we allow only exact conversions (e.g. long Variable C++ long) then we include lossy conversions too (e.g. long Variable C++ int)

  12. sil-cling: Argument Conversion depends on whether the SIL Variables provided as arguments hold a a SIL primitive type or a ClingObj ClingObj -> string comparisons between the type of the C++ object that it wraps and the type of the overload s parameter SIL primitive type -> must match one of the predefined TypeCoercion rules

  13. sil-cling: Calling examine the return value of the selected overload figure out what SIL type should it be converted to distinguish between primitive types, types that should be wrapped as ClingObjs, and types not supported yet

  14. sil-cling: Data Members involves an offset calculation

  15. sil-cling: Whats next? automatic instantiation of templates direct conversions to/from SIL arrays and std::vector

  16. sil-cling: Summary a SIL plugin that allows transparent calling of C++ libraries built using Cling and cppyy works with C++ Standard Library, Boost.Asio, dlib, Xapian, etc.

  17. one last thing Symmetry Investments is hiring D programmers! More details here.

Related


More Related Content