DatumHueEnterprise v0.0.24datumhue.com
Contents

plugin ABI

Native plugin ABI

A native plugin is a shared library that whoever runs the workstation installs in its plugin folder. It adds namespaces and handle classes to the datumhue.* API, and runs with the same authority as the workstation itself. An app never gains that authority by calling one: it reaches a plugin only when it is granted the plugin, as it is granted any other permission. A plugin exports a fixed set of C symbols and speaks MessagePack across the boundary.

The contract is a single frozen generation, 1. The host resolves dh_plugin_abi first and refuses the library unless it returns exactly that number: there is no negotiation and no cross-generation compatibility. Any change to the symbol list, a signature, the vtable layout, the value encoding, or the catalog schema is a new generation.

Every exported symbol and every vtable entry is an unsafe extern "C" function. No panic or foreign exception may unwind across the boundary; a plugin is built panic = "abort" or wraps each export in a shim that returns an encoded error instead.

Exported symbols

The host calls, in order: dh_plugin_abi (refusing on mismatch), dh_plugin_catalog (validated before any further plugin code runs), dh_plugin_init, then any number of dh_plugin_call / dh_plugin_begin invocations, and finally dh_plugin_shutdown exactly once. dh_plugin_call and dh_plugin_begin are invoked only on the host's exclusive Lua thread, one at a time.

SymbolSignatureRole
dh_plugin_abifn() -> u32ABI generation handshake; returns the generation the plugin was built against.
dh_plugin_catalogfn(out_len: *mut usize) -> *const u8Return the MessagePack catalog fragment (plugin-owned, valid until shutdown).
dh_plugin_initfn(host: *const DhHostV1) -> i32Receive the host services vtable and initialize.
dh_plugin_callfn(fn_id: u32, args: *const u8, args_len: usize, out: *mut DhBuf) -> i32Invoke a catalog function synchronously; must return promptly.
dh_plugin_beginfn(fn_id: u32, args: *const u8, args_len: usize, ticket: u64) -> i32Start an asynchronous catalog function; one completion is posted later.
dh_plugin_shutdownfn()Orderly teardown, called exactly once; the library is then unloaded.

Host services vtable

dh_plugin_init receives a pointer to a DhHostV1, the whole world a plugin sees: completion posting, logging, buffer allocation, and bulk-data handle creation. It stays valid until dh_plugin_shutdown returns, and every entry takes the struct's opaque ctx as its first argument. dh_plugin_call and dh_plugin_begin run on the host's exclusive Lua thread and must return promptly (the call blocks every running app for its duration); the vtable entries themselves are callable from any thread, so slow work runs on the plugin's own threads and reports back through post_completion.

FieldTypeRole
ctx*mut c_voidOpaque host context; passed back verbatim as the first argument of every entry.
post_completionfn(ctx, ticket: u64, status: i32, payload: *const u8, payload_len: usize)Post the one completion for a begin ticket; callable from any thread.
logfn(ctx, level: u32, msg: *const u8, msg_len: usize)Emit a log line at a DH_LOG_* level (unknown levels treated as info).
buf_allocfn(ctx, len: usize) -> DhBufAllocate a host-owned DhBuf of len zeroed bytes.
buf_freefn(ctx, buf: DhBuf)Release a DhBuf obtained from buf_alloc.
create_data_handlefn(ctx, arrow_ipc: *const u8, arrow_ipc_len: usize, out_handle: *mut u64) -> i32Register an Arrow IPC stream and receive a bulk-data id. A function whose catalog type is data_handle returns the id, and the host delivers it to Lua as a DataHandle. Each id is consumed exactly once.

A byte buffer that crosses the boundary is a DhBuf { ptr: *mut u8, len: usize } (ptr is null exactly when len == 0). It is allocated by buf_alloc and released by buf_free, or handed back to the host as a call out-buffer, which then owns it: each buffer is released exactly once and memory never crosses allocators. Argument and payload pointers are borrowed only until the callee returns; the callee copies what it needs.

Status and log codes

A call or completion returns one status code:

ConstantValueMeaning
DH_STATUS_OK0Success; result values (or an empty buffer) in the out-buffer or completion payload.
DH_STATUS_ERROR1Failure; a MessagePack PluginError in the out-buffer or completion payload.
DH_STATUS_UNSUPPORTED2The callee does not support the operation; carries no payload.

The vtable log entry takes one of these levels:

ConstantValue
DH_LOG_ERROR1
DH_LOG_WARN2
DH_LOG_INFO3
DH_LOG_DEBUG4
DH_LOG_TRACE5

Value model

Arguments, results, and typed errors cross as MessagePack. A single value encodes as a two-element array [tag, payload], where the tag is a small unsigned integer naming the variant. The integer tag is rename-immune, keeps integer and float distinct even for an integral float, keeps bin distinct from str, and makes a map an ordered list of pairs (a Lua table's keys may repeat and its order is meaningful). A tag the decoder does not know is an error, never a panic.

TagVariantPayload
0NilMessagePack nil
1BoolMessagePack bool
2IntMessagePack signed integer (i64)
3FloatMessagePack f64
4StrMessagePack str (UTF-8)
5BytesMessagePack bin
6ArrayMessagePack array of encoded values
7MapMessagePack array of [key, value] pairs
8Handle[class, id] (an opaque plugin handle)

Worked examples. Each value encodes to these bytes, and the bytes decode back to it:

ValueEncoding
Nil92 00 c0
Bool(true)92 01 c3
Bool(false)92 01 c2
Int(0)92 02 00
Int(-1)92 02 ff
Int(9223372036854775807)92 02 cf 7f ff ff ff ff ff ff ff
Int(-9223372036854775808)92 02 d3 80 00 00 00 00 00 00 00
Float(3.5)92 03 cb 40 0c 00 00 00 00 00 00
Float(-0.5)92 03 cb bf e0 00 00 00 00 00 00
Str("hello")92 04 a5 68 65 6c 6c 6f
Str("h\u{00e9}\u{2603}")92 04 a6 68 c3 a9 e2 98 83
Bytes([222, 173, 190, 239])92 05 c4 04 de ad be ef
Array([Int(1), Str("x"), Bool(true)])92 06 93 92 02 01 92 04 a1 78 92 01 c3
Map([(Str("k"), Int(1)), (Int(2), Nil)])92 07 92 92 92 04 a1 6b 92 02 01 92 92 02 02 92 00 c0
Handle(PluginHandle { class: "Scene", id: 42 })92 08 92 a5 53 63 65 6e 65 2a

The dh_plugin_call argument and result form is a MessagePack array of encoded values. [Int(1), Str("a")] encodes as 92 92 02 01 92 04 a1 61.

On DH_STATUS_ERROR the payload is a PluginError, encoded as the array [code, message, detail] (detail is nil or an ordered list of [key, value] pairs):

ErrorEncoding
PluginError { code: "bad", message: "nope", detail: None }93 a3 62 61 64 a4 6e 6f 70 65 c0
PluginError { code: "e", message: "m", detail: Some([("k", Int(7))]) }93 a1 65 a1 6d 91 92 a1 6b 92 02 07

Catalog fragment

A plugin declares its API surface as data, not from its symbols: dh_plugin_catalog returns a MessagePack CatalogFragment that mirrors the host registry's own model. The host validates it (schema, legal names, collisions) before dh_plugin_init runs, then merges it so plugin functions install through the same interpreter that installs core ones.

Type expressions (FragmentType) mirror the host registry type model. Optionality is a sibling bool on a parameter or field, not a variant; a nullable property is a Union with Nil.

VariantMeaning
NumberA Lua number (float subtype).
IntegerA Lua integer.
StringA Lua string.
BooleanA Lua boolean.
FunctionAn untyped Lua function value.
TableAn untyped Lua table.
NilLua nil.
AnyAn arbitrary Lua value.
Handle(name)A userdata handle class, referenced by name.
Array(T)A homogeneous array (T[]).
Map { key, value }A keyed table (table<K, V>).
Callback { params, returns }A typed Lua function the host invokes.
Enum { name, variants, variant_docs }A string restricted to a fixed set of variants.
Union(members)A union of alternatives (A | B).
InlineTable { name, fields, extends }A typed option table, optionally extending a base table.
StringLiteral(s)A single string literal (an overload discriminant).

Records. Each encodes as a MessagePack array of its fields in declaration order:

CatalogFragment

FieldTypeDescription
pluginStringThe plugin identifier (dotted path allowed).
versionsemverThe plugin's own semantic version.
min_abiu32Reserved: the handshake is exact-match, so the loader refuses any generation other than its own regardless of this field. Decoders still reject a fragment whose min_abi exceeds the host generation.
namespaces[FragmentNamespace]The namespaces this plugin contributes.
handle_classes[FragmentHandleClass]The handle classes this plugin contributes.
extensions[FragmentExtension]Methods added to host-owned extensible classes (Bytes).

FragmentNamespace

FieldTypeDescription
nameStringMounted as datumhue.<name> (dotted path allowed).
docStringNamespace documentation (may be empty).
functions[FragmentFn]The namespace functions.
properties[FragmentProperty]The namespace computed properties.
capabilityOption<String>A capability the whole namespace requires, if any.

FragmentHandleClass

FieldTypeDescription
nameStringThe class short-name, referenced by Handle.
docStringClass documentation (may be empty).
methods[FragmentFn]The class methods.
properties[FragmentProperty]The class computed properties.

FragmentExtension

FieldTypeDescription
classStringThe host-owned class the methods attach to. Hosts extend Bytes only; any other class refuses at load, as does a method name the core class or an earlier plugin already claims. Each method's receiver arrives as the class's marshalled value -- for Bytes, the raw payload bytes.
methods[FragmentFn]The added methods; dispatch ids share the fragment-wide id space.

FragmentFn

FieldTypeDescription
idu32The dispatch id (see below).
nameStringThe Lua-visible name.
params[FragmentParam]Parameters in declared order (no receiver for a method).
returns[FragmentType]The return types.
docStringDocumentation (may be empty).
suspendsboolWhether the call is async, driven through the begin path.

FragmentParam

FieldTypeDescription
nameStringThe parameter name (documentation only; calls are positional).
tyFragmentTypeThe parameter type.
optionalboolWhether the parameter may be omitted.

FragmentProperty

FieldTypeDescription
nameStringThe property name (a table key).
tyFragmentTypeThe property type (Union([T, Nil]) when nullable).
docStringDocumentation (may be empty).
get_idu32The dispatch id of the getter.
set_idOption<u32>The dispatch id of the setter, present iff writable.

FragmentField

FieldTypeDescription
nameStringThe option-table key.
tyFragmentTypeThe field type.
optionalboolWhether the key may be omitted.
docStringThe field documentation (may be empty).

Wire stability differs by shape. A struct encodes as an array of its fields in declaration order, so reordering fields breaks the wire while renaming one does not. A FragmentType variant encodes by name, so renaming a variant breaks the wire while reordering variants does not. Value tags, by contrast, are rename-immune integers. Any such change bumps the ABI generation.

Every callable and computed property carries a plugin-assigned dispatch id, unique across the whole fragment: FragmentFn.id for a namespace function or handle method, and FragmentProperty.get_id / set_id for a property's getter and setter. That id, and only that id, is what the call and begin symbols receive to select the callee; a property accessor is reached exactly like a function, and a fragment that reuses an id anywhere is rejected.

An example fragment declares plugin acme version 1.0.0 at min_abi 1: namespace acme with 1 function and 1 property, and handle class H. It encodes to 113 MessagePack bytes and decodes back to the same fragment.

datumhue.com

(c) 2026 Shuusei AB. Quote excerpts of this manual, with attribution to DatumHue, in your own documentation, tutorials, course materials, reviews, and other writing or video. Republishing it in whole or in substantial part needs written permission: support@datumhue.com.

Victor Mono is licensed under the SIL Open Font License 1.1
Copyright (c) 2024, Rune Bjørnerås (https://github.com/rubjo)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Try

    ↑↓ selectEnter openTab filter

    Settings

    Theme
    Text
    Print

    Keyboard shortcuts

    / or Ctrl KSearch
    ↑ ↓ EnterPick a result
    TabNext result filter
    j kNext or previous entry
    [ ]Previous or next page
    yCopy a link to the current entry
    ?These shortcuts
    EscClose

    On this page