Features

Plugin System

The plugin system provides a hierarchical plugin namespace (kind of like packages/modules in Python), allowing each application and each subsystem within an application to install their plugins without interfering with the others.

A notion of plugin loaders: The default plugin loader is able to load shared C++ libaries. A plugin or application may register (an)other plugin loader(s) to implement loading of a different kind of plugins. This is used in the implementation of extension language plugin loaders that are able to load, say, a Python script as a plugin.

Scripting system

Yehia has a featureful facility for exposing a C++ API to scripting (aka extension) languages.

You describe the interface that should be visible from the scripting languages once using the Yehia IGDL (Interface Generator Definition Language). This will be translated into C++ code that injects the proper glue into the scripting language.

Once you've compiled the C++ code produced by the Yehia interface generator out of the IGDL, you're done. There is no need to compile different code for different languages, like in SWIG. The scripting language backends of Yehia will create the interfaces at runtime, when the extension plugin is loaded.

This facility features:

  • Scripting namespaces. Those are translated to the corresponding construct in the scripting language (e.g. packages/modules in Python).

  • A mapping for the basic datatypes: long, unsigned long, bool, double, char *, std::string and std::list as well as Yehia::Script::Any (equivalent to GOOPS <top>.

  • An interface for creating scripting language classes from C++ classes, including multiple inheritance.

  • Generic functions (the term is borrowed from GOOPS). A generic function contains one or more functions accepting different arguments. This is like a set of overloaded C++ functions (or methods). You can bind these generic functions to either:

    • The instances of a class (like normal C++ methods).

    • A class itself (like static C++ methods).

    • A script namespace (like C++ functions).

    Furthermore there is also the notion of getters and setters (also GOOPS terminology). Those are generic functions that allow the retrieval and setting of instance or class member variables.

    In Python, for example, you could have object.value invoke the getter function to retrieve the value and object.value = newval invoke the setter to set the value.

  • Overriding virtual functions in the scripting language.