Plugins are written in OCaml. The compiled OCaml code is then
loaded in Stog with the
A plugin just registers new functions associated to tags. Here is an example:
Have a look at the
The plugin is simply compiled with
for native code or
for bytecode.
The plugin is used by specifying it on the
or, if the plugin is installed with ocamlfind:
With our plugin example, we can use the new "list":
This will be evaluated (reduced) to
The cache system (see
If a new rule defined by a plugin uses a file or implies a dependency
from an element to another, this rule must declare this dependency
using the Stog_plug.add_dep
If a plugin computes information which could be cached, it can declare a
new cache for this informations, using the
Stog_plug.register_cache
The Cache module to provide is very simple; have a look at the
Stog_cache.Cache