Expand description
One dialect registry per process.
Razeri resolves platforms by name in hundreds of places — every renderer, every command, every binding. A registry built afresh at each of those calls would hold only the dialects linked into the binary, and a dialect loaded from a shared library at run time would land in whichever builder loaded it and be seen by nothing that resolves by name.
This module holds the one registry those calls read. It is built once, from the linked dialects plus whatever a plugin directory contributes, and it never changes afterwards. Two consequences follow, and both are the point:
- A plugin loaded here is visible everywhere. The command line’s
--target, the materialization core three calls deeper, and a Python caller in another process entirely all resolve through the same registry. - The directory is chosen before the first resolution, or not at all.
A registry that could change under a running process would let two
halves of one render disagree about what a name means. So the directory
is installed first — explicitly by a host that has one, or from
RAZERI_PLUGIN_DIRwhen the first resolution happens — and a later attempt to install a different one is refused rather than honoured.
Dialects live here, and so do event sinks (process_event_sinks): a sink
a plugin directory contributes reaches a host that emits through this one
registry, as a sink linked into the binary does. A plugin may also register
storage providers, language renderers and model adapters, and those still
reach only the builder that loaded them; the process-wide registry grows to
hold them when something resolves them by name the way dialects are
resolved.
Structs§
- Plugin
DirReport - What loading a plugin directory produced, kept for the life of the process so a face can report it — which library loaded, which was refused, and why.
Enums§
- Install
Error - Why an explicit installation was refused.
Constants§
- PLUGIN_
DIR_ ENV - The environment variable that names a directory of plugin shared libraries.
Functions§
- install_
plugin_ dir - Install a plugin directory as the one this process loads from, and build the registry now.
- plugin_
dir_ from_ environment - The directory
PLUGIN_DIR_ENVnames, if it is set to anything. - plugin_
dir_ report - The report from whichever directory this process loaded, if any.
- process_
event_ sinks - The event sinks every host in this process emits through: the ones linked into the binary, and the ones the plugin directory contributed.
- process_
registry - The registry every by-name resolution in this process reads.